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 "MEDFileEntities.hxx"
41 #include "MEDFileMeshReadSelector.hxx"
42 #include "MEDFileFieldOverView.hxx"
43 #include "MEDLoaderTypemaps.i"
44 #include "SauvReader.hxx"
45 #include "SauvWriter.hxx"
47 using namespace MEDCoupling;
50 #if SWIG_VERSION >= 0x010329
51 %template() std::vector<std::string>;
54 %typemap(out) MEDCoupling::MEDFileMesh*
56 $result=convertMEDFileMesh($1,$owner);
59 %typemap(out) MEDCoupling::MEDFileParameter1TS*
61 $result=convertMEDFileParameter1TS($1,$owner);
64 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
66 $result=convertMEDFileFieldMultiTS($1,$owner);
69 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
71 $result=convertMEDFileField1TS($1,$owner);
74 %typemap(out) MEDCoupling::MEDMeshMultiLev*
76 $result=convertMEDMeshMultiLev($1,$owner);
79 %newobject ReadUMeshFromFamiliesSwig;
80 %newobject ReadUMeshFromGroupsSwig;
81 %newobject ReadFieldSwig;
82 %newobject MEDCoupling::ReadUMeshFromFile;
83 %newobject MEDCoupling::ReadMeshFromFile;
84 %newobject MEDCoupling::ReadFieldCell;
85 %newobject MEDCoupling::ReadFieldNode;
86 %newobject MEDCoupling::ReadFieldGauss;
87 %newobject MEDCoupling::ReadFieldGaussNE;
88 %newobject MEDCoupling::MEDFileMesh::New;
89 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
90 %newobject MEDCoupling::MEDFileMesh::deepCopy;
91 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
92 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
93 %newobject MEDCoupling::MEDFileMesh::__getitem__;
94 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
95 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
97 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
101 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
102 %newobject MEDCoupling::MEDFileMesh::getGlobalNumFieldAtLevel;
103 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
104 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
105 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
106 %newobject MEDCoupling::MEDFileMesh::cartesianize;
107 %newobject MEDCoupling::MEDFileData::getJoints;
108 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
109 %newobject MEDCoupling::MEDFileUMesh::New;
110 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
111 %newobject MEDCoupling::MEDFileUMesh::getCoords;
112 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
113 %newobject MEDCoupling::MEDFileUMesh::getGroup;
114 %newobject MEDCoupling::MEDFileUMesh::getGroups;
115 %newobject MEDCoupling::MEDFileUMesh::getFamily;
116 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
117 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
120 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
121 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
122 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
123 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
124 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
125 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
126 %newobject MEDCoupling::MEDFileUMesh::extractPart;
127 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
128 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
129 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
130 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
131 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
132 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
133 %newobject MEDCoupling::MEDFileCMesh::New;
134 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
136 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
137 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
138 %newobject MEDCoupling::MEDFileMeshes::New;
139 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
140 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
141 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
142 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
143 %newobject MEDCoupling::MEDFileMeshes::__iter__;
145 %newobject MEDCoupling::MEDFileMeshSupports::New;
146 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
148 %newobject MEDCoupling::MEDFileStructureElements::New;
150 %newobject MEDCoupling::MEDFileFields::New;
151 %newobject MEDCoupling::MEDFileFields::NewAdv;
152 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
153 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
154 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
155 %newobject MEDCoupling::MEDFileFields::deepCopy;
156 %newobject MEDCoupling::MEDFileFields::shallowCpy;
157 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
158 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
159 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
160 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
161 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
162 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
163 %newobject MEDCoupling::MEDFileFields::__iter__;
164 %newobject MEDCoupling::MEDFileFields::extractPart;
166 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
167 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
168 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
169 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
170 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
173 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
174 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
175 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
176 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
177 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
178 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
179 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
182 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
183 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
184 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
185 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
186 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
187 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
188 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
189 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
190 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
191 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
192 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
193 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
195 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
196 %newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
197 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
198 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
199 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
200 %newobject MEDCoupling::MEDFileField1TS::New;
201 %newobject MEDCoupling::MEDFileField1TS::field;
202 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
203 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
204 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
205 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
206 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
207 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
209 %newobject MEDCoupling::MEDFileIntField1TS::New;
210 %newobject MEDCoupling::MEDFileIntField1TS::field;
211 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
212 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
213 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
214 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
215 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
216 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
218 %newobject MEDCoupling::MEDFileData::New;
219 %newobject MEDCoupling::MEDFileData::deepCopy;
220 %newobject MEDCoupling::MEDFileData::getMeshes;
221 %newobject MEDCoupling::MEDFileData::getFields;
222 %newobject MEDCoupling::MEDFileData::getParams;
223 %newobject MEDCoupling::MEDFileData::Aggregate;
225 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
227 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
228 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
229 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
230 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
231 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
232 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
233 %newobject MEDCoupling::MEDFileParameters::New;
234 %newobject MEDCoupling::MEDFileParameters::deepCopy;
235 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
236 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
237 %newobject MEDCoupling::MEDFileParameters::__getitem__;
239 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
240 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
241 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
242 %newobject MEDCoupling::MEDFileJointOneStep::New;
243 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
244 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
245 %newobject MEDCoupling::MEDFileJoint::New;
246 %newobject MEDCoupling::MEDFileJoint::deepCopy;
247 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
248 %newobject MEDCoupling::MEDFileJoints::New;
249 %newobject MEDCoupling::MEDFileJoints::deepCopy;
250 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
251 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
252 %newobject MEDCoupling::MEDFileJoints::__getitem__;
253 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
254 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
255 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
256 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
257 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
258 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
259 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
260 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
261 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
263 %newobject MEDCoupling::SauvWriter::New;
264 %newobject MEDCoupling::SauvReader::New;
265 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
267 %newobject MEDCoupling::MEDFileMeshStruct::New;
268 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
269 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
270 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
271 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
272 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
274 %feature("unref") MEDFileMesh "$this->decrRef();"
275 %feature("unref") MEDFileUMesh "$this->decrRef();"
276 %feature("unref") MEDFileCMesh "$this->decrRef();"
277 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
278 %feature("unref") MEDFileMeshes "$this->decrRef();"
279 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
280 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
281 %feature("unref") MEDFileField1TS "$this->decrRef();"
282 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
283 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
284 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
285 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
286 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
287 %feature("unref") MEDFileStructureElements "$this->decrRef();"
288 %feature("unref") MEDFileFields "$this->decrRef();"
289 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
290 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
291 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
292 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
293 %feature("unref") MEDFileParameters "$this->decrRef();"
294 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
295 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
296 %feature("unref") MEDFileJoint "$this->decrRef();"
297 %feature("unref") MEDFileJoints "$this->decrRef();"
298 %feature("unref") MEDFileEquivalences "$this->decrRef();"
299 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
300 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
301 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
302 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
303 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
304 %feature("unref") MEDFileData "$this->decrRef();"
305 %feature("unref") SauvReader "$this->decrRef();"
306 %feature("unref") SauvWriter "$this->decrRef();"
307 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
308 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
309 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
310 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
311 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
312 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
314 namespace MEDCoupling
317 std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
318 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
319 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
320 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
321 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
322 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
323 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
324 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
325 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
326 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
327 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
328 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
329 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
330 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
331 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
332 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
333 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
334 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
335 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
336 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
337 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
338 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
339 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
340 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
341 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);
342 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);
343 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);
344 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);
345 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
346 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
347 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
348 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
349 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
350 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
353 %rename (MEDFileVersion) MEDFileVersionSwig;
354 %rename (GetFieldIterations) GetFieldIterationsSwig;
355 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
356 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
357 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
358 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
359 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
360 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
361 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
362 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
363 %rename (WriteUMeshes) WriteUMeshesSwig;
364 %rename (GetTypesOfField) GetTypesOfFieldSwig;
365 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
366 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
367 %rename (ReadField) ReadFieldSwig;
371 PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
373 int major,minor,release;
374 MEDCoupling::MEDFileVersion(major,minor,release);
375 PyObject *ret(PyTuple_New(3));
376 PyTuple_SetItem(ret,0,SWIG_From_int(major));
377 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
378 PyTuple_SetItem(ret,2,SWIG_From_int(release));
382 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName) throw(INTERP_KERNEL::Exception)
384 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName));
388 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
390 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName));
394 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
396 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
400 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(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)
402 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
406 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
408 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
409 PyObject *ret=PyList_New(res.size());
411 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
413 PyObject *elt=PyTuple_New(2);
414 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
415 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
416 PyList_SetItem(ret,rk,elt);
421 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
423 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
424 PyObject *ret=PyList_New(res.size());
426 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
428 PyObject *elt=PyTuple_New(3);
429 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
430 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
431 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
432 PyList_SetItem(ret,rk,elt);
437 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
439 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
440 PyObject *ret=PyList_New(res.size());
442 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
444 PyObject *elt=PyTuple_New(2);
445 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
446 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
447 PyList_SetItem(ret,rk,elt);
452 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
454 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
455 PyObject *ret=PyList_New(res.size());
457 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
459 PyObject *elt=PyTuple_New(2);
460 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
461 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
462 PyList_SetItem(ret,rk,elt);
467 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
469 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
470 PyObject *ret=PyList_New(res.size());
472 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
474 PyObject *elt=PyTuple_New(2);
475 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
476 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
477 PyList_SetItem(ret,rk,elt);
482 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
484 int meshDim,spaceDim,numberOfNodes;
485 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
486 PyObject *ret=PyTuple_New(4);
487 PyObject *elt0=PyList_New(res.size());
489 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
491 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
493 PyObject *elt1=PyList_New(obj2.size());
494 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
496 PyObject *elt2=PyTuple_New(2);
497 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
498 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
499 PyList_SetItem(elt1,j,elt2);
501 PyList_SetItem(elt0,i,elt1);
503 PyTuple_SetItem(ret,0,elt0);
504 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
505 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
506 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
510 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
511 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
513 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
514 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
515 return convertFieldDoubleVecToPy(res);
518 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
520 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
521 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
522 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
525 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
527 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
528 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
529 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
532 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
534 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
535 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
536 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
539 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
541 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
543 PyObject *ret=PyList_New(size);
544 for(int i=0;i<size;i++)
545 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
549 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
551 std::vector<std::string> grps;
552 converPyListToVecString(li,grps);
553 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
556 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
558 std::vector<std::string> fams;
559 converPyListToVecString(li,fams);
560 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
564 namespace MEDCoupling
566 class MEDFileWritable
569 void copyOptionsFrom(const MEDFileWritable& other) const;
570 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
571 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
572 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
573 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
576 class MEDFileWritableStandAlone : public MEDFileWritable
579 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
580 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
583 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
585 MCAuto<DataArrayByte> ret(self->serialize());
589 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
591 PyObject *ret(PyList_New(0));
595 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
599 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
602 PyObject *ret(PyTuple_New(1));
603 PyObject *ret0(PyDict_New());
604 DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
605 PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
606 {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
607 PyObject *tmp1(PyInt_FromLong(0));
608 PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
609 PyTuple_SetItem(ret,0,ret0);
613 throw INTERP_KERNEL::Exception("PyWrap of MEDFileData.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
619 class MEDFileMeshReadSelector
622 MEDFileMeshReadSelector();
623 MEDFileMeshReadSelector(unsigned int code);
624 unsigned int getCode() const;
625 void setCode(unsigned int newCode);
626 bool isCellFamilyFieldReading() const;
627 bool isNodeFamilyFieldReading() const;
628 bool isCellNameFieldReading() const;
629 bool isNodeNameFieldReading() const;
630 bool isCellNumFieldReading() const;
631 bool isNodeNumFieldReading() const;
632 bool isGlobalNodeNumFieldReading() const;
633 void setCellFamilyFieldReading(bool b);
634 void setNodeFamilyFieldReading(bool b);
635 void setCellNameFieldReading(bool b);
636 void setNodeNameFieldReading(bool b);
637 void setCellNumFieldReading(bool b);
638 void setNodeNumFieldReading(bool b);
639 void setGlobalNodeNumFieldReading(bool b);
642 std::string __str__() const throw(INTERP_KERNEL::Exception)
644 std::ostringstream oss;
649 std::string __repr__() const throw(INTERP_KERNEL::Exception)
651 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
657 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
660 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
661 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
662 throw(INTERP_KERNEL::Exception);
663 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
664 INTERP_KERNEL::NormalizedCellType loc_geo_type,
665 INTERP_KERNEL::NormalizedCellType rem_geo_type)
666 throw(INTERP_KERNEL::Exception);
667 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
668 MEDFileJointCorrespondence *deepCopy() const;
669 MEDFileJointCorrespondence *shallowCpy() const;
670 void setIsNodal(bool isNodal);
671 bool getIsNodal() const;
672 bool isEqual(const MEDFileJointCorrespondence *other) const;
673 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
674 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
675 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
676 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
677 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
678 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
679 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);
680 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
683 MEDFileJointCorrespondence()
685 return MEDFileJointCorrespondence::New();
687 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
689 return MEDFileJointCorrespondence::New(correspondence);
691 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
692 INTERP_KERNEL::NormalizedCellType loc_geo_type,
693 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
695 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
698 std::string __str__() const throw(INTERP_KERNEL::Exception)
700 return self->simpleRepr();
705 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
708 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
709 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
710 MEDFileJointOneStep *deepCopy() const;
711 MEDFileJointOneStep *shallowCpy() const;
712 bool isEqual(const MEDFileJointOneStep *other) const;
713 void setOrder(int order);
714 int getOrder() const;
715 void setIteration(int it);
716 int getIteration() const;
717 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
718 int getNumberOfCorrespondences() const;
719 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
720 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
721 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
724 MEDFileJointOneStep()
726 return MEDFileJointOneStep::New();
729 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
731 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
734 std::string __str__() const throw(INTERP_KERNEL::Exception)
736 return self->simpleRepr();
741 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
744 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
745 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
746 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception);
747 MEDFileJoint *deepCopy() const;
748 MEDFileJoint *shallowCpy() const;
749 bool isEqual(const MEDFileJoint *other) const;
750 void setLocalMeshName(const std::string& name);
751 std::string getLocalMeshName() const;
752 void setRemoteMeshName(const std::string& name);
753 std::string getRemoteMeshName() const;
754 void setDescription(const std::string& name);
755 std::string getDescription() const;
756 void setJointName(const std::string& name);
757 std::string getJointName() const;
758 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
759 void setDomainNumber(const int& number);
760 int getDomainNumber() const;
761 void pushStep(MEDFileJointOneStep* step);
762 int getNumberOfSteps() const;
763 MEDFileJointOneStep *getStepAtPos(int i) const;
764 std::string simpleRepr() const;
769 return MEDFileJoint::New();
772 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
774 return MEDFileJoint::New(fileName,mName,num);
777 MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception)
779 return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
782 std::string __str__() const throw(INTERP_KERNEL::Exception)
784 return self->simpleRepr();
789 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
792 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
793 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
794 MEDFileJoints *deepCopy() const;
795 std::string simpleRepr() const;
796 std::string getMeshName() const;
797 int getNumberOfJoints() const;
798 std::vector<std::string> getJointsNames() const;
799 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
800 void resize(int newSize) throw(INTERP_KERNEL::Exception);
801 void pushJoint(MEDFileJoint *joint);
802 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
803 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
808 return MEDFileJoints::New();
811 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
813 return MEDFileJoints::New(fileName,meshName);
816 std::string __str__() const throw(INTERP_KERNEL::Exception)
818 return self->simpleRepr();
821 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
825 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
830 else if(PyString_Check(obj))
832 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
838 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
841 int __len__() const throw(INTERP_KERNEL::Exception)
843 return self->getNumberOfJoints();
846 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
848 MEDFileJoint *ret=self->getJointAtPos(i);
854 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
856 MEDFileJoint *ret=self->getJointWithName(paramName);
864 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
867 MEDFileEquivalenceBase();
870 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
873 MEDFileEquivalenceData();
875 void setArray(DataArrayInt *data);
878 DataArrayInt *getArray()
880 DataArrayInt *ret(self->getArray());
881 if(ret) ret->incrRef();
887 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
890 MEDFileEquivalenceNode();
893 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
896 MEDFileEquivalenceCell();
899 std::size_t size() const;
900 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
901 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
904 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
906 DataArrayInt *ret(self->getArray(type));
907 if(ret) ret->incrRef();
911 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
913 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
914 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
915 PyObject *res=PyList_New(result.size());
916 for(int i=0;iL!=result.end(); i++, iL++)
917 PyList_SetItem(res,i,PyInt_FromLong(*iL));
923 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
926 MEDFileEquivalencePair();
928 std::string getName() const;
929 void setName(const std::string& name);
930 std::string getDescription() const;
931 void setDescription(const std::string& descr);
932 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
935 MEDFileEquivalenceCell *initCell()
937 MEDFileEquivalenceCell *ret(self->initCell());
938 if(ret) ret->incrRef();
942 MEDFileEquivalenceNode *initNode()
944 MEDFileEquivalenceNode *ret(self->initNode());
945 if(ret) ret->incrRef();
949 MEDFileEquivalenceCell *getCell()
951 MEDFileEquivalenceCell *ret(self->getCell());
952 if(ret) ret->incrRef();
956 MEDFileEquivalenceNode *getNode()
958 MEDFileEquivalenceNode *ret(self->getNode());
959 if(ret) ret->incrRef();
965 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
968 MEDFileEquivalences();
971 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
972 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
973 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
977 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
979 MEDFileEquivalencePair *ret(self->getEquivalence(i));
980 if(ret) ret->incrRef();
983 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
985 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
986 if(ret) ret->incrRef();
990 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
992 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
993 if(ret) ret->incrRef();
999 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
1002 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1003 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1004 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1005 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
1006 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
1007 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
1008 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
1009 void setName(const std::string& name);
1010 std::string getName();
1011 std::string getUnivName() const;
1012 bool getUnivNameWrStatus() const;
1013 void setUnivNameWrStatus(bool newStatus);
1014 void setDescription(const std::string& name);
1015 std::string getDescription() const;
1016 void setOrder(int order);
1017 int getOrder() const;
1018 void setIteration(int it);
1020 void setTimeValue(double time);
1021 void setTime(int dt, int it, double time);
1022 double getTimeValue() const;
1023 void setTimeUnit(const std::string& unit);
1024 std::string getTimeUnit() const;
1025 void setAxisType(MEDCouplingAxisType at);
1026 MEDCouplingAxisType getAxisType() const;
1027 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
1028 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1029 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
1030 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1031 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
1032 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
1033 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1034 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1035 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1036 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
1037 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
1038 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
1039 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1040 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1042 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
1043 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
1044 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1045 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1046 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1047 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1048 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1049 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1050 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1051 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1052 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1053 void clearFamMap() throw(INTERP_KERNEL::Exception);
1054 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1055 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1056 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1057 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1058 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1059 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1060 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1061 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1062 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1063 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1064 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1065 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1066 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1067 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1068 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1069 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1070 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1071 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1072 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1073 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1074 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1075 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1076 static std::string GetMagicFamilyStr();
1077 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1078 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1079 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1080 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1081 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1082 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1083 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1084 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1085 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1086 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1087 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1088 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1089 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1090 void setFamilyInfo(const std::map<std::string,int>& info);
1091 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1092 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1093 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1094 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1095 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1096 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1097 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1098 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1099 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1100 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1101 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1102 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1103 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1104 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1105 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1106 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1107 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1108 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1109 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1110 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1111 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1113 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1114 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1115 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1116 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1117 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr) throw(INTERP_KERNEL::Exception);
1118 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1119 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1120 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1121 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1122 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1123 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1124 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1125 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1126 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1127 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1128 int getNumberOfJoints();
1129 MEDFileJoints *getJoints();
1130 void setJoints( MEDFileJoints* joints );
1131 void initializeEquivalences();
1132 void killEquivalences();
1133 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1134 void killStructureElements() throw(INTERP_KERNEL::Exception);
1137 std::string __str__() const throw(INTERP_KERNEL::Exception)
1139 return self->simpleRepr();
1142 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1144 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1147 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1150 double tmp0=self->getTime(tmp1,tmp2);
1151 PyObject *res = PyList_New(3);
1152 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1153 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1154 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1158 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1161 bool ret0=self->isEqual(other,eps,what);
1162 PyObject *res=PyList_New(2);
1163 PyObject *ret0Py=ret0?Py_True:Py_False;
1165 PyList_SetItem(res,0,ret0Py);
1166 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1170 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1172 std::vector<const DataArrayInt *> grps;
1173 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1174 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1177 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1180 bool ret0=self->areFamsEqual(other,what);
1181 PyObject *res=PyList_New(2);
1182 PyObject *ret0Py=ret0?Py_True:Py_False;
1184 PyList_SetItem(res,0,ret0Py);
1185 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1189 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1192 bool ret0=self->areGrpsEqual(other,what);
1193 PyObject *res=PyList_New(2);
1194 PyObject *ret0Py=ret0?Py_True:Py_False;
1196 PyList_SetItem(res,0,ret0Py);
1197 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1201 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1203 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1204 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1205 PyObject *res=PyList_New(result.size());
1206 for(int i=0;iL!=result.end(); i++, iL++)
1207 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1211 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1213 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1214 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1215 PyObject *res=PyList_New(result.size());
1216 for(int i=0;iL!=result.end(); i++, iL++)
1217 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1221 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1223 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1226 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1229 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1231 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1234 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1237 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1239 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1242 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1245 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1247 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1250 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1253 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1255 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1258 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1261 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1264 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1265 PyObject *ret=PyTuple_New(2);
1266 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1267 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1271 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1273 DataArrayInt *ret3=0;
1274 std::vector<int> ret1,ret2;
1275 bool ret0=self->unPolyze(ret1,ret2,ret3);
1276 PyObject *ret=PyTuple_New(4);
1277 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1279 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1280 for(int j=0;j<(int)ret1.size()/3;j++)
1282 PyObject *retLev2=PyList_New(3);
1283 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1284 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1285 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1286 PyList_SetItem(retLev1_0,j,retLev2);
1288 PyTuple_SetItem(ret,1,retLev1_0);
1290 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1291 for(int j=0;j<(int)ret2.size()/3;j++)
1293 PyObject *retLev2=PyList_New(3);
1294 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1295 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1296 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1297 PyList_SetItem(retLev1_1,j,retLev2);
1299 PyTuple_SetItem(ret,2,retLev1_1);
1301 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1305 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1307 MEDFileEquivalences *ret(self->getEquivalences());
1308 if(ret) ret->incrRef();
1312 virtual DataArrayInt *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1314 MCAuto<DataArrayInt> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1320 class MEDFileUMesh : public MEDFileMesh
1323 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1324 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1325 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1326 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1327 static MEDFileUMesh *New();
1328 static const char *GetSpeStr4ExtMesh();
1330 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1331 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1332 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1333 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1334 void clearNodeAndCellNumbers();
1336 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1337 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1338 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1339 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1340 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1341 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1342 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1343 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1344 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1345 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1347 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1348 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1349 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1350 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1351 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1352 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1353 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1354 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1355 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1356 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1357 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1358 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1359 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1360 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1361 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1364 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1366 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1369 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1371 return MEDFileUMesh::New(fileName,mrs);
1374 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1376 return MEDFileUMesh::New(mem);
1379 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1381 return MEDFileUMesh::New(db);
1386 return MEDFileUMesh::New();
1390 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1392 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1395 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)
1397 std::vector<int> typesCpp1;
1398 convertPyToNewIntArr3(types,typesCpp1);
1399 std::size_t sz(typesCpp1.size());
1400 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1401 for(std::size_t ii=0;ii<sz;ii++)
1402 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1403 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1406 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1407 {// put an empty dict in input to say to __new__ to call __init__...
1408 PyObject *ret(PyTuple_New(1));
1409 PyObject *ret0(PyDict_New());
1410 PyTuple_SetItem(ret,0,ret0);
1414 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1416 std::vector<double> a0;
1417 std::vector<int> a1;
1418 std::vector<std::string> a2;
1419 std::vector< MCAuto<DataArrayInt> > a3;
1420 MCAuto<DataArrayDouble> a4;
1421 self->serialize(a0,a1,a2,a3,a4);
1422 PyObject *ret(PyTuple_New(5));
1423 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1424 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1426 PyObject *ret2(PyList_New(sz));
1427 for(int i=0;i<sz;i++)
1428 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1429 PyTuple_SetItem(ret,2,ret2);
1431 PyObject *ret3(PyList_New(sz));
1432 for(int i=0;i<sz;i++)
1434 DataArrayInt *elt(a3[i]);
1437 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1439 PyTuple_SetItem(ret,3,ret3);
1440 DataArrayDouble *ret4(a4);
1443 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1447 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1449 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1450 if(!PyTuple_Check(inp))
1451 throw INTERP_KERNEL::Exception(MSG);
1452 int sz(PyTuple_Size(inp));
1454 throw INTERP_KERNEL::Exception(MSG);
1455 std::vector<double> a0;
1456 std::vector<int> a1;
1457 std::vector<std::string> a2;
1458 std::vector< MCAuto<DataArrayInt> > a3;
1459 MCAuto<DataArrayDouble> a4;
1461 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1463 fillArrayWithPyListDbl3(a0py,tmp,a0);
1464 convertPyToNewIntArr3(a1py,a1);
1465 fillStringVector(a2py,a2);
1467 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1469 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1470 if(!SWIG_IsOK(status))
1471 throw INTERP_KERNEL::Exception(MSG);
1472 a4=reinterpret_cast<DataArrayDouble *>(argp);
1473 if((DataArrayDouble *)a4)
1476 std::vector< DataArrayInt * > a3Tmp;
1477 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1478 std::size_t sz(a3Tmp.size());
1480 for(std::size_t i=0;i<sz;i++)
1484 a3Tmp[i]->incrRef();
1486 self->unserialize(a0,a1,a2,a3,a4);
1490 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1493 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1494 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1497 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1500 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1503 self->setMeshAtLevel(meshDimRelToMax,m1);
1506 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1509 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1511 self->removeMeshAtLevel(meshDimRelToMax);
1514 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1516 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1518 DataArrayDouble *a,*a2;
1519 DataArrayDoubleTuple *aa,*aa2;
1520 std::vector<double> bb,bb2;
1522 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1523 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1524 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1528 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1530 std::vector<const MEDFileUMesh *> meshesCpp;
1531 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1532 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1536 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1538 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1539 return convertVecPairIntToPy(ret);
1542 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1544 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1545 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1546 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1549 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1551 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1552 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1553 return self->extractPart(extractDefCpp);
1556 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1558 std::vector<const MEDCouplingUMesh *> ms;
1559 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1560 self->setMeshes(ms,renum);
1563 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1565 std::vector<const MEDCouplingUMesh *> ms;
1566 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1567 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1570 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1572 std::vector<const MEDCouplingUMesh *> ms;
1573 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1574 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1577 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1579 DataArrayDouble *ret=self->getCoords();
1585 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1587 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1590 return const_cast<PartDefinition *>(ret);
1593 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1595 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1596 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1597 PyObject *ret=PyTuple_New(3);
1598 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1599 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1600 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1604 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1606 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1612 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1614 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1615 std::size_t sz(tmp.size());
1616 PyObject *ret=PyList_New(sz);
1617 for(std::size_t i=0;i<sz;i++)
1621 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1628 class MEDFileStructuredMesh : public MEDFileMesh
1633 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1635 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1643 class MEDFileCMesh : public MEDFileStructuredMesh
1646 static MEDFileCMesh *New();
1647 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1648 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1649 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1650 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1651 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1656 return MEDFileCMesh::New();
1659 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1661 return MEDFileCMesh::New(fileName,mrs);
1664 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1666 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1669 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1671 return MEDFileCMesh::New(db);
1675 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1677 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1680 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1682 const MEDCouplingCMesh *tmp=self->getMesh();
1685 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1690 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1693 static MEDFileCurveLinearMesh *New();
1694 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1695 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1696 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1697 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1700 MEDFileCurveLinearMesh()
1702 return MEDFileCurveLinearMesh::New();
1705 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1707 return MEDFileCurveLinearMesh::New(fileName,mrs);
1710 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1712 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1715 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1717 return MEDFileCurveLinearMesh::New(db);
1721 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1723 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1726 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1728 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1731 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1736 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1739 static MEDFileMeshMultiTS *New();
1740 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1741 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1742 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1743 std::string getName() const throw(INTERP_KERNEL::Exception);
1744 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1745 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1748 MEDFileMeshMultiTS()
1750 return MEDFileMeshMultiTS::New();
1753 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1755 return MEDFileMeshMultiTS::New(fileName);
1758 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1760 return MEDFileMeshMultiTS::New(fileName,mName);
1763 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1765 MEDFileMesh *ret=self->getOneTimeStep();
1773 class MEDFileMeshesIterator
1778 PyObject *next() throw(INTERP_KERNEL::Exception)
1780 MEDFileMesh *ret=self->nextt();
1784 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1788 PyErr_SetString(PyExc_StopIteration,"No more data.");
1795 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1798 static MEDFileMeshes *New();
1799 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1800 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1801 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1802 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1804 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1805 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1806 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1807 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1808 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1809 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1810 void killStructureElements() throw(INTERP_KERNEL::Exception);
1815 return MEDFileMeshes::New();
1818 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1820 return MEDFileMeshes::New(fileName);
1823 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1825 return MEDFileMeshes::New(db);
1829 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1831 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1834 std::string __str__() const throw(INTERP_KERNEL::Exception)
1836 return self->simpleRepr();
1839 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1841 if(PyInt_Check(obj))
1843 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1848 else if(PyString_Check(obj))
1850 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1856 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1859 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1861 self->setMeshAtPos(obj,mesh);
1865 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1867 return self->iterator();
1870 int __len__() const throw(INTERP_KERNEL::Exception)
1872 return self->getNumberOfMeshes();
1875 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1877 MEDFileMesh *ret=self->getMeshAtPos(i);
1882 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1884 MEDFileMesh *ret=self->getMeshWithName(mname);
1892 class MEDFileFieldLoc : public RefCountObject
1895 std::string getName() const;
1896 int getDimension() const;
1897 int getNumberOfGaussPoints() const;
1898 int getNumberOfPointsInCells() const;
1899 const std::vector<double>& getRefCoords() const;
1900 const std::vector<double>& getGaussCoords() const;
1901 const std::vector<double>& getGaussWeights() const;
1902 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1905 std::string __str__() const throw(INTERP_KERNEL::Exception)
1907 return self->repr();
1912 class MEDFileFieldGlobsReal
1915 void resetContent();
1916 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1917 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1918 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1919 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1920 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1921 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1922 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1923 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1924 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1925 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1926 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1927 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1928 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1929 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1930 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1931 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1932 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1933 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1934 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1935 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1936 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1937 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1938 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1939 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1940 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1941 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1942 void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
1945 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1947 const DataArrayInt *ret=self->getProfile(pflName);
1950 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1953 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1955 const DataArrayInt *ret=self->getProfileFromId(pflId);
1958 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1961 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1963 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1966 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1969 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1971 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1974 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1977 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1979 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1980 return convertVecPairVecStToPy(ret);
1983 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1985 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1986 return convertVecPairVecStToPy(ret);
1989 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1991 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1992 self->changePflsNames(v);
1995 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1997 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1998 self->changePflsRefsNamesGen(v);
2001 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2003 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2004 self->changePflsNamesInStruct(v);
2007 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2009 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2010 self->changeLocsNames(v);
2013 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
2015 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2016 self->changeLocsRefsNamesGen(v);
2019 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2021 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2022 self->changeLocsNamesInStruct(v);
2025 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
2027 std::ostringstream oss;
2028 self->simpleReprGlobs(oss);
2034 class MEDFileEntities
2039 static MEDFileEntities *BuildFrom(PyObject *entities) throw(INTERP_KERNEL::Exception)
2041 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2042 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2044 std::size_t sz(inp0.size());
2046 for(std::size_t i=0;i<sz;i++)
2047 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2049 return MEDFileEntities::BuildFrom(&inp);
2056 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2059 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2060 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2061 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2062 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
2063 void loadArrays() throw(INTERP_KERNEL::Exception);
2064 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2065 void unloadArrays() throw(INTERP_KERNEL::Exception);
2066 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2067 int getDimension() const throw(INTERP_KERNEL::Exception);
2068 int getIteration() const throw(INTERP_KERNEL::Exception);
2069 int getOrder() const throw(INTERP_KERNEL::Exception);
2070 std::string getName() throw(INTERP_KERNEL::Exception);
2071 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2072 std::string getMeshName() throw(INTERP_KERNEL::Exception);
2073 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2074 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2075 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2076 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2077 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2078 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2079 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2080 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2081 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2082 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2083 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2084 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2085 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2088 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2091 double tmp0=self->getTime(tmp1,tmp2);
2092 PyObject *res = PyList_New(3);
2093 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2094 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2095 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2099 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2101 std::pair<int,int> res=self->getDtIt();
2102 PyObject *elt=PyTuple_New(2);
2103 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2104 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2108 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2110 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2113 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2115 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2118 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2120 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2121 return self->changeMeshNames(modifTab);
2124 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2126 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2127 PyObject *ret2=PyList_New(ret.size());
2128 for(int i=0;i<(int)ret.size();i++)
2129 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2133 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2135 std::vector<int> ret1;
2136 int ret0=self->getNonEmptyLevels(mname,ret1);
2137 PyObject *elt=PyTuple_New(2);
2138 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2139 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2143 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2145 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2146 std::vector< std::vector<TypeOfField> > typesF;
2147 std::vector< std::vector<std::string> > pfls;
2148 std::vector< std::vector<std::string> > locs;
2149 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2151 PyObject *ret2=PyList_New(sz);
2152 for(int i=0;i<sz;i++)
2154 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2155 const std::vector<TypeOfField>& typesFI=typesF[i];
2156 const std::vector<std::string>& pflsI=pfls[i];
2157 const std::vector<std::string>& locsI=locs[i];
2158 PyObject *elt=PyTuple_New(2);
2159 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2160 int sz2=ret[i].size();
2161 PyObject *elt2=PyList_New(sz2);
2162 for(int j=0;j<sz2;j++)
2164 PyObject *elt3=PyTuple_New(4);
2165 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2166 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));
2167 PyTuple_SetItem(elt3,1,elt4);
2168 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2169 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2170 PyList_SetItem(elt2,j,elt3);
2172 PyTuple_SetItem(elt,1,elt2);
2173 PyList_SetItem(ret2,i,elt);
2178 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2180 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2181 std::size_t sz=ret.size();
2182 PyObject *retPy=PyList_New(sz);
2183 for(std::size_t i=0;i<sz;i++)
2184 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2188 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2190 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2191 std::size_t sz=ret.size();
2192 PyObject *retPy=PyList_New(sz);
2193 for(std::size_t i=0;i<sz;i++)
2194 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2198 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2200 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2201 std::size_t sz=ret.size();
2202 PyObject *retPy=PyList_New(sz);
2203 for(std::size_t i=0;i<sz;i++)
2204 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2208 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2210 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2211 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2212 return self->extractPart(extractDefCpp,mm);
2217 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2220 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2221 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2222 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2223 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2224 static MEDFileField1TS *New();
2225 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2226 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2227 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2228 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2229 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2230 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2231 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2233 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2234 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2235 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2236 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2239 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2241 return MEDFileField1TS::New(fileName,loadAll);
2244 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2246 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2249 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2251 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2254 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2256 return MEDFileField1TS::New(db);
2261 return MEDFileField1TS::New();
2265 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2267 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2270 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2272 const DataArrayDouble *arr=0;
2274 arr=field->getArray();
2275 self->copyTinyInfoFrom(field,arr);
2278 std::string __str__() const throw(INTERP_KERNEL::Exception)
2280 return self->simpleRepr();
2283 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2285 DataArrayInt *ret1=0;
2286 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2287 PyObject *ret=PyTuple_New(2);
2288 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2289 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2293 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2295 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2296 std::vector< std::vector<TypeOfField> > typesF;
2297 std::vector< std::vector<std::string> > pfls;
2298 std::vector< std::vector<std::string> > locs;
2299 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2301 PyObject *ret2=PyList_New(sz);
2302 for(int i=0;i<sz;i++)
2304 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2305 const std::vector<TypeOfField>& typesFI=typesF[i];
2306 const std::vector<std::string>& pflsI=pfls[i];
2307 const std::vector<std::string>& locsI=locs[i];
2308 PyObject *elt=PyTuple_New(2);
2309 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2310 int sz2=ret[i].size();
2311 PyObject *elt2=PyList_New(sz2);
2312 for(int j=0;j<sz2;j++)
2314 PyObject *elt3=PyTuple_New(4);
2315 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2316 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2317 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2318 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2319 PyList_SetItem(elt2,j,elt3);
2321 PyTuple_SetItem(elt,1,elt2);
2322 PyList_SetItem(ret2,i,elt);
2327 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2329 DataArrayDouble *ret=self->getUndergroundDataArray();
2335 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2337 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2338 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2341 PyObject *ret=PyTuple_New(2);
2342 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2343 std::size_t sz=elt1Cpp.size();
2344 PyObject *elt=PyList_New(sz);
2345 for(std::size_t i=0;i<sz;i++)
2347 PyObject *elt1=PyTuple_New(2);
2348 PyObject *elt2=PyTuple_New(2);
2349 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2350 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2351 PyObject *elt3=PyTuple_New(2);
2352 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2353 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2354 PyTuple_SetItem(elt1,0,elt2);
2355 PyTuple_SetItem(elt1,1,elt3);
2356 PyList_SetItem(elt,i,elt1);
2358 PyTuple_SetItem(ret,1,elt);
2364 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2367 static MEDFileIntField1TS *New();
2368 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2369 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2370 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2371 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2372 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2374 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2375 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2376 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2377 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2378 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2379 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2380 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2381 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2384 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2386 return MEDFileIntField1TS::New();
2389 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2391 return MEDFileIntField1TS::New(fileName,loadAll);
2394 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2396 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2399 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2401 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2404 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2406 return MEDFileIntField1TS::New(db);
2410 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2412 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2415 std::string __str__() const throw(INTERP_KERNEL::Exception)
2417 return self->simpleRepr();
2420 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2422 DataArrayInt *ret1=0;
2423 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2424 PyObject *ret=PyTuple_New(2);
2425 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2426 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2430 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2432 DataArrayInt *ret=self->getUndergroundDataArray();
2440 class MEDFileAnyTypeFieldMultiTSIterator
2445 PyObject *next() throw(INTERP_KERNEL::Exception)
2447 MEDFileAnyTypeField1TS *ret=self->nextt();
2449 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2452 PyErr_SetString(PyExc_StopIteration,"No more data.");
2459 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2462 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2463 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2464 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2465 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2466 std::string getName() const throw(INTERP_KERNEL::Exception);
2467 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2468 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2469 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2470 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2471 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2472 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2473 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2474 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2475 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2476 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2477 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2478 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2479 void loadArrays() throw(INTERP_KERNEL::Exception);
2480 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2481 void unloadArrays() throw(INTERP_KERNEL::Exception);
2482 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2484 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2485 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2486 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2487 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2488 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2489 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2492 int __len__() const throw(INTERP_KERNEL::Exception)
2494 return self->getNumberOfTS();
2497 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2499 if(elt0 && PyInt_Check(elt0))
2501 int pos=PyInt_AS_LONG(elt0);
2504 else if(elt0 && PyTuple_Check(elt0))
2506 if(PyTuple_Size(elt0)==2)
2508 PyObject *o0=PyTuple_GetItem(elt0,0);
2509 PyObject *o1=PyTuple_GetItem(elt0,1);
2510 if(PyInt_Check(o0) && PyInt_Check(o1))
2512 int iter=PyInt_AS_LONG(o0);
2513 int order=PyInt_AS_LONG(o1);
2514 return self->getPosOfTimeStep(iter,order);
2517 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 !");
2520 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 !");
2522 else if(elt0 && PyFloat_Check(elt0))
2524 double val=PyFloat_AS_DOUBLE(elt0);
2525 return self->getPosGivenTime(val);
2528 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2531 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2533 std::vector< std::pair<int,int> > res(self->getIterations());
2534 return convertVecPairIntToPy(res);
2537 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2539 std::vector<double> ret1;
2540 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2541 std::size_t sz=ret.size();
2542 PyObject *ret2=PyList_New(sz);
2543 for(std::size_t i=0;i<sz;i++)
2545 PyObject *elt=PyTuple_New(3);
2546 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2547 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2548 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2549 PyList_SetItem(ret2,i,elt);
2554 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2556 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2557 PyObject *ret2=PyList_New(ret.size());
2558 for(int i=0;i<(int)ret.size();i++)
2560 const std::vector<TypeOfField>& rett=ret[i];
2561 PyObject *ret3=PyList_New(rett.size());
2562 for(int j=0;j<(int)rett.size();j++)
2563 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2564 PyList_SetItem(ret2,i,ret3);
2569 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2571 std::vector<int> ret1;
2572 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2573 PyObject *elt=PyTuple_New(2);
2574 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2575 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2579 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2581 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2582 std::vector< std::vector<TypeOfField> > typesF;
2583 std::vector< std::vector<std::string> > pfls;
2584 std::vector< std::vector<std::string> > locs;
2585 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2587 PyObject *ret2=PyList_New(sz);
2588 for(int i=0;i<sz;i++)
2590 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2591 const std::vector<TypeOfField>& typesFI=typesF[i];
2592 const std::vector<std::string>& pflsI=pfls[i];
2593 const std::vector<std::string>& locsI=locs[i];
2594 PyObject *elt=PyTuple_New(2);
2595 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2596 int sz2=ret[i].size();
2597 PyObject *elt2=PyList_New(sz2);
2598 for(int j=0;j<sz2;j++)
2600 PyObject *elt3=PyTuple_New(4);
2601 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2602 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));
2603 PyTuple_SetItem(elt3,1,elt4);
2604 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2605 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2606 PyList_SetItem(elt2,j,elt3);
2608 PyTuple_SetItem(elt,1,elt2);
2609 PyList_SetItem(ret2,i,elt);
2614 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2616 if(PyList_Check(elts))
2618 int sz=PyList_Size(elts);
2619 std::vector<int> ret(sz);
2620 for(int i=0;i<sz;i++)
2622 PyObject *elt=PyList_GetItem(elts,i);
2623 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2629 std::vector<int> ret(1);
2630 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2635 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2637 if(PySlice_Check(elts))
2639 Py_ssize_t strt=2,stp=2,step=2;
2640 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2641 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2642 self->eraseTimeStepIds2(strt,stp,step);
2646 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2647 if(!idsToRemove.empty())
2648 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2652 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2656 std::vector<int> pos2;
2657 DataArrayInt *pos3=0;
2658 DataArrayIntTuple *pos4=0;
2659 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2664 self->eraseTimeStepIds(&pos1,&pos1+1);
2671 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2676 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2680 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2684 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2686 return self->iterator();
2689 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2691 if(elt0 && PyList_Check(elt0))
2693 int sz=PyList_Size(elt0);
2694 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2695 int *pt=da->getPointer();
2696 for(int i=0;i<sz;i++,pt++)
2698 PyObject *elt1=PyList_GetItem(elt0,i);
2699 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2701 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2703 else if(elt0 && PySlice_Check(elt0))
2705 Py_ssize_t strt=2,stp=2,step=2;
2706 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2707 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2708 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2711 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2714 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2716 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2717 return self->changeMeshNames(modifTab);
2720 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2722 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2723 std::size_t sz=ret.size();
2724 PyObject *retPy=PyList_New(sz);
2725 for(std::size_t i=0;i<sz;i++)
2726 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2730 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2732 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2733 std::size_t sz=ret.size();
2734 PyObject *retPy=PyList_New(sz);
2735 for(std::size_t i=0;i<sz;i++)
2736 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2740 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2742 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2743 std::size_t sz=ret.size();
2744 PyObject *retPy=PyList_New(sz);
2745 for(std::size_t i=0;i<sz;i++)
2746 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2750 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2753 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2754 if(SWIG_IsOK(status))
2756 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2760 std::vector<MEDFileAnyTypeField1TS *> tmp;
2761 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2762 self->pushBackTimeSteps(tmp);
2766 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2768 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2769 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2770 return self->extractPart(extractDefCpp,mm);
2773 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2775 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2776 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2777 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2778 std::size_t sz=ret.size();
2779 PyObject *retPy=PyList_New(sz);
2780 for(std::size_t i=0;i<sz;i++)
2782 std::size_t sz2=ret[i].size();
2783 PyObject *ret1Py=PyList_New(sz2);
2784 for(std::size_t j=0;j<sz2;j++)
2786 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2789 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2791 PyList_SetItem(retPy,i,ret1Py);
2796 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2798 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2799 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2800 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2801 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2802 if(ret2.size()!=ret.size())
2804 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2805 throw INTERP_KERNEL::Exception(oss.str().c_str());
2807 std::size_t sz=ret.size();
2808 PyObject *retPy=PyList_New(sz);
2809 for(std::size_t i=0;i<sz;i++)
2811 std::size_t sz2=ret[i].size();
2812 PyObject *ret0Py=PyTuple_New(2);
2813 PyObject *ret1Py=PyList_New(sz2);
2814 for(std::size_t j=0;j<sz2;j++)
2816 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2819 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2821 PyTuple_SetItem(ret0Py,0,ret1Py);
2822 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2823 PyList_SetItem(retPy,i,ret0Py);
2830 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2833 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2834 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2835 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2836 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2838 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2839 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2840 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2841 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2842 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2843 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2845 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2846 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2847 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2850 MEDFileFieldMultiTS()
2852 return MEDFileFieldMultiTS::New();
2855 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2857 return MEDFileFieldMultiTS::New(fileName,loadAll);
2860 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2862 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2865 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2867 return MEDFileFieldMultiTS::New(db);
2871 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2873 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2876 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2878 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2879 std::size_t sz(tmp.size());
2880 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2881 for(std::size_t i=0;i<sz;i++)
2883 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2884 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2886 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2889 std::string __str__() const throw(INTERP_KERNEL::Exception)
2891 return self->simpleRepr();
2894 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2896 DataArrayInt *ret1=0;
2897 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2898 PyObject *ret=PyTuple_New(2);
2899 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2900 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2904 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2906 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2907 std::vector< std::vector<TypeOfField> > typesF;
2908 std::vector< std::vector<std::string> > pfls;
2909 std::vector< std::vector<std::string> > locs;
2910 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2912 PyObject *ret2=PyList_New(sz);
2913 for(int i=0;i<sz;i++)
2915 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2916 const std::vector<TypeOfField>& typesFI=typesF[i];
2917 const std::vector<std::string>& pflsI=pfls[i];
2918 const std::vector<std::string>& locsI=locs[i];
2919 PyObject *elt=PyTuple_New(2);
2920 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2921 int sz2=ret[i].size();
2922 PyObject *elt2=PyList_New(sz2);
2923 for(int j=0;j<sz2;j++)
2925 PyObject *elt3=PyTuple_New(4);
2926 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2927 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2928 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2929 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2930 PyList_SetItem(elt2,j,elt3);
2932 PyTuple_SetItem(elt,1,elt2);
2933 PyList_SetItem(ret2,i,elt);
2937 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2939 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2945 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2947 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2948 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2951 PyObject *ret=PyTuple_New(2);
2952 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2953 std::size_t sz=elt1Cpp.size();
2954 PyObject *elt=PyList_New(sz);
2955 for(std::size_t i=0;i<sz;i++)
2957 PyObject *elt1=PyTuple_New(2);
2958 PyObject *elt2=PyTuple_New(2);
2959 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2960 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2961 PyObject *elt3=PyTuple_New(2);
2962 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2963 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2964 PyTuple_SetItem(elt1,0,elt2);
2965 PyTuple_SetItem(elt1,1,elt3);
2966 PyList_SetItem(elt,i,elt1);
2968 PyTuple_SetItem(ret,1,elt);
2974 class MEDFileFieldsIterator
2979 PyObject *next() throw(INTERP_KERNEL::Exception)
2981 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2983 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2986 PyErr_SetString(PyExc_StopIteration,"No more data.");
2993 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2996 static MEDFileIntFieldMultiTS *New();
2997 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2998 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2999 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3001 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
3002 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
3003 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
3004 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
3005 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3006 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3007 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3008 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3009 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3012 MEDFileIntFieldMultiTS()
3014 return MEDFileIntFieldMultiTS::New();
3017 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3019 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
3022 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3024 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
3027 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3029 return MEDFileIntFieldMultiTS::New(db);
3033 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3035 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
3038 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3040 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3041 std::size_t sz(tmp.size());
3042 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3043 for(std::size_t i=0;i<sz;i++)
3045 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3046 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3048 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3051 std::string __str__() const throw(INTERP_KERNEL::Exception)
3053 return self->simpleRepr();
3056 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3058 DataArrayInt *ret1=0;
3059 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3060 PyObject *ret=PyTuple_New(2);
3061 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3062 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3066 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3068 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3076 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3079 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3080 std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3083 MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3085 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3086 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3094 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3097 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3099 MEDFileStructureElements();
3102 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3105 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3106 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3107 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3108 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
3109 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3110 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3111 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3112 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3113 void loadArrays() throw(INTERP_KERNEL::Exception);
3114 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3115 void unloadArrays() throw(INTERP_KERNEL::Exception);
3116 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3117 int getNumberOfFields() const;
3118 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3119 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3121 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3122 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3123 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3124 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3125 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3126 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3127 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3128 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3129 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3130 void killStructureElements() throw(INTERP_KERNEL::Exception);
3131 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3132 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3133 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3134 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3135 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3140 return MEDFileFields::New();
3143 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3145 return MEDFileFields::New(fileName,loadAll);
3148 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3150 return MEDFileFields::New(db);
3153 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
3155 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3159 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3161 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3164 std::string __str__() const throw(INTERP_KERNEL::Exception)
3166 return self->simpleRepr();
3169 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3171 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3175 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3177 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3181 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3183 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3184 std::size_t sz(tmp.size());
3185 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3186 for(std::size_t i=0;i<sz;i++)
3188 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3189 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3191 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3194 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3196 std::vector< std::pair<std::string,std::string> > ps;
3197 self->getMeshSENames(ps);
3198 return convertVectPairStToPy(ps);
3201 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3204 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3205 PyObject *ret=PyTuple_New(2);
3206 PyObject *ret_0=PyList_New(ret0.size());
3208 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3210 PyObject *elt=PyTuple_New(2);
3211 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3212 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3213 PyList_SetItem(ret_0,rk,elt);
3215 PyTuple_SetItem(ret,0,ret_0);
3216 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3217 PyTuple_SetItem(ret,1,ret_1);
3221 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3223 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3224 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3227 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3229 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3230 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3233 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3235 if(obj && PyList_Check(obj))
3237 int sz=PyList_Size(obj);
3238 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3239 int *pt=da->getPointer();
3240 for(int i=0;i<sz;i++,pt++)
3242 PyObject *elt1=PyList_GetItem(obj,i);
3243 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3245 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3248 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3251 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3253 self->setFieldAtPos(obj,field);
3257 int __len__() const throw(INTERP_KERNEL::Exception)
3259 return self->getNumberOfFields();
3262 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3264 return self->iterator();
3267 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3269 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3270 return self->changeMeshNames(modifTab);
3273 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3275 if(elt0 && PyInt_Check(elt0))
3277 return PyInt_AS_LONG(elt0);
3279 else if(elt0 && PyString_Check(elt0))
3280 return self->getPosFromFieldName(PyString_AsString(elt0));
3282 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3285 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3287 if(PyList_Check(elts))
3289 int sz=PyList_Size(elts);
3290 std::vector<int> ret(sz);
3291 for(int i=0;i<sz;i++)
3293 PyObject *elt=PyList_GetItem(elts,i);
3294 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3300 std::vector<int> ret(1);
3301 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3306 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3308 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3309 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3310 self->pushFields(tmp);
3313 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3315 if(elts && PySlice_Check(elts))
3317 Py_ssize_t strt=2,stp=2,step=2;
3318 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3319 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3320 self->destroyFieldsAtPos2(strt,stp,step);
3324 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3325 if(!idsToRemove.empty())
3326 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3330 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3332 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3333 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3334 return self->extractPart(extractDefCpp,mm);
3339 class MEDFileParameter1TS : public RefCountObject
3342 void setIteration(int it);
3343 int getIteration() const;
3344 void setOrder(int order);
3345 int getOrder() const;
3346 void setTimeValue(double time);
3347 void setTime(int dt, int it, double time);
3348 double getTime(int& dt, int& it);
3349 double getTimeValue() const;
3352 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3355 void setValue(double val) throw(INTERP_KERNEL::Exception);
3356 double getValue() const throw(INTERP_KERNEL::Exception);
3357 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3360 std::string __str__() const throw(INTERP_KERNEL::Exception)
3362 return self->simpleRepr();
3367 class MEDFileParameterTinyInfo : public MEDFileWritable
3370 void setDescription(const std::string& name);
3371 std::string getDescription() const;
3372 void setTimeUnit(const std::string& unit);
3373 std::string getTimeUnit() const;
3376 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3379 static MEDFileParameterDouble1TS *New();
3380 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3381 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3382 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3383 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3384 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3385 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3386 std::string getName() const throw(INTERP_KERNEL::Exception);
3387 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3390 MEDFileParameterDouble1TS()
3392 return MEDFileParameterDouble1TS::New();
3395 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3397 return MEDFileParameterDouble1TS::New(fileName);
3400 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3402 return MEDFileParameterDouble1TS::New(fileName,paramName);
3405 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3407 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3410 std::string __str__() const throw(INTERP_KERNEL::Exception)
3412 return self->simpleRepr();
3415 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3418 bool ret0=self->isEqual(other,eps,what);
3419 PyObject *res=PyList_New(2);
3420 PyObject *ret0Py=ret0?Py_True:Py_False;
3422 PyList_SetItem(res,0,ret0Py);
3423 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3429 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3432 static MEDFileParameterMultiTS *New();
3433 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3434 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3435 std::string getName() const;
3436 void setName(const std::string& name);
3437 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3438 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3439 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3440 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3441 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3442 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3443 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3444 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3447 MEDFileParameterMultiTS()
3449 return MEDFileParameterMultiTS::New();
3452 MEDFileParameterMultiTS(const std::string& fileName)
3454 return MEDFileParameterMultiTS::New(fileName);
3457 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3459 return MEDFileParameterMultiTS::New(fileName,paramName);
3462 std::string __str__() const throw(INTERP_KERNEL::Exception)
3464 return self->simpleRepr();
3467 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3470 bool ret0=self->isEqual(other,eps,what);
3471 PyObject *res=PyList_New(2);
3472 PyObject *ret0Py=ret0?Py_True:Py_False;
3474 PyList_SetItem(res,0,ret0Py);
3475 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3479 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3483 std::vector<int> pos2;
3484 DataArrayInt *pos3=0;
3485 DataArrayIntTuple *pos4=0;
3486 convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3491 self->eraseTimeStepIds(&pos1,&pos1+1);
3498 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3503 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3507 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3511 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3513 if(elt0 && PyInt_Check(elt0))
3515 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3518 else if(elt0 && PyTuple_Check(elt0))
3520 if(PyTuple_Size(elt0)==2)
3522 PyObject *o0=PyTuple_GetItem(elt0,0);
3523 PyObject *o1=PyTuple_GetItem(elt0,1);
3524 if(PyInt_Check(o0) && PyInt_Check(o1))
3526 int iter=PyInt_AS_LONG(o0);
3527 int order=PyInt_AS_LONG(o1);
3528 return self->getPosOfTimeStep(iter,order);
3531 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 !");
3534 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 !");
3536 else if(elt0 && PyFloat_Check(elt0))
3538 double val=PyFloat_AS_DOUBLE(elt0);
3539 return self->getPosGivenTime(val);
3542 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3545 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3547 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3553 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3555 if(PyList_Check(elts))
3557 int sz=PyList_Size(elts);
3558 std::vector<int> ret(sz);
3559 for(int i=0;i<sz;i++)
3561 PyObject *elt=PyList_GetItem(elts,i);
3562 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3568 std::vector<int> ret(1);
3569 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3574 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3576 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3577 if(!idsToRemove.empty())
3578 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3581 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3583 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3589 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3591 std::vector< std::pair<int,int> > res=self->getIterations();
3592 PyObject *ret=PyList_New(res.size());
3594 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3596 PyObject *elt=PyTuple_New(2);
3597 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3598 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3599 PyList_SetItem(ret,rk,elt);
3604 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3606 std::vector<double> res2;
3607 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3608 PyObject *ret=PyList_New(res.size());
3610 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3612 PyObject *elt=PyTuple_New(3);
3613 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3614 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3615 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3616 PyList_SetItem(ret,rk,elt);
3623 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3626 static MEDFileParameters *New();
3627 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3628 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3629 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3630 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3631 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3632 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3633 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3634 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3635 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3636 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3637 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3642 return MEDFileParameters::New();
3645 MEDFileParameters(const std::string& fileName)
3647 return MEDFileParameters::New(fileName);
3650 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3652 return MEDFileParameters::New(db);
3656 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3658 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3661 std::string __str__() const throw(INTERP_KERNEL::Exception)
3663 return self->simpleRepr();
3666 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3668 if(PyInt_Check(obj))
3670 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3675 else if(PyString_Check(obj))
3677 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3683 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3686 int __len__() const throw(INTERP_KERNEL::Exception)
3688 return self->getNumberOfParams();
3691 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3693 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3699 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3701 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3707 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3710 bool ret0=self->isEqual(other,eps,what);
3711 PyObject *res=PyList_New(2);
3712 PyObject *ret0Py=ret0?Py_True:Py_False;
3714 PyList_SetItem(res,0,ret0Py);
3715 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3721 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3724 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3725 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3726 static MEDFileData *New();
3727 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3728 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3729 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3730 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3731 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3732 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3733 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3735 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3736 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3737 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3738 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3739 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3743 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3745 return MEDFileData::New(fileName);
3748 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3750 return MEDFileData::New(db);
3755 return MEDFileData::New();
3758 std::string __str__() const throw(INTERP_KERNEL::Exception)
3760 return self->simpleRepr();
3763 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3765 MEDFileMeshes *ret=self->getMeshes();
3771 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3773 MEDFileParameters *ret=self->getParams();
3779 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3781 MEDFileFields *ret=self->getFields();
3787 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3789 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3790 return self->changeMeshNames(modifTab);
3793 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3795 std::vector<const MEDFileData *> mfdsCpp;
3796 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3797 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3802 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3804 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3809 class SauvReader : public RefCountObject
3812 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3813 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3816 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3818 return SauvReader::New(fileName);
3823 class SauvWriter : public RefCountObject
3826 static SauvWriter * New();
3827 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3828 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3829 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3830 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3833 SauvWriter() throw(INTERP_KERNEL::Exception)
3835 return SauvWriter::New();
3842 class MEDFileMeshStruct;
3844 class MEDFileField1TSStructItem
3847 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3850 class MEDFileMeshStruct : public RefCountObject
3853 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3855 ~MEDFileMeshStruct();
3858 class MEDMeshMultiLev : public RefCountObject
3861 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3862 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3863 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3869 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3871 DataArrayInt *famIds(0);
3872 bool isWithoutCopy(false);
3873 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3874 PyObject *ret=PyTuple_New(2);
3875 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3877 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3878 PyTuple_SetItem(ret,1,ret1Py);
3882 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3884 DataArrayInt *numIds(0);
3885 bool isWithoutCopy(false);
3886 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3887 PyObject *ret=PyTuple_New(2);
3888 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3890 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3891 PyTuple_SetItem(ret,1,ret1Py);
3895 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3897 DataArrayInt *famIds(0);
3898 bool isWithoutCopy(false);
3899 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3900 PyObject *ret=PyTuple_New(2);
3901 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3903 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3904 PyTuple_SetItem(ret,1,ret1Py);
3908 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3910 DataArrayInt *numIds(0);
3911 bool isWithoutCopy(false);
3912 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3913 PyObject *ret=PyTuple_New(2);
3914 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3916 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3917 PyTuple_SetItem(ret,1,ret1Py);
3921 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3923 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3924 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3925 PyObject *res(PyList_New(result.size()));
3926 for(int i=0;iL!=result.end(); i++, iL++)
3927 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3933 class MEDUMeshMultiLev : public MEDMeshMultiLev
3936 ~MEDUMeshMultiLev();
3940 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3942 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3943 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3944 PyObject *ret0Py=ncc?Py_True:Py_False;
3946 PyObject *ret=PyTuple_New(7);
3947 PyTuple_SetItem(ret,0,ret0Py);
3948 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3949 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3950 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3951 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3952 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3953 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3959 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3962 ~MEDStructuredMeshMultiLev();
3965 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3968 ~MEDCMeshMultiLev();
3972 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3975 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3976 std::size_t sz(objs.size());
3977 PyObject *ret(PyTuple_New(2));
3978 PyObject *ret0=PyList_New(sz);
3979 for(std::size_t i=0;i<sz;i++)
3980 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3981 PyTuple_SetItem(ret,0,ret0);
3982 PyObject *ret1Py(isInternal?Py_True:Py_False);
3984 PyTuple_SetItem(ret,1,ret1Py);
3990 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3993 ~MEDCurveLinearMeshMultiLev();
3997 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3999 DataArrayDouble *ret0(0);
4000 std::vector<int> ret1;
4002 self->buildVTUArrays(ret0,ret1,ret2);
4003 std::size_t sz(ret1.size());
4004 PyObject *ret=PyTuple_New(3);
4005 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4006 PyObject *ret1Py=PyList_New(sz);
4007 for(std::size_t i=0;i<sz;i++)
4008 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
4009 PyTuple_SetItem(ret,1,ret1Py);
4010 PyObject *ret2Py(ret2?Py_True:Py_False);
4012 PyTuple_SetItem(ret,2,ret2Py);
4018 class MEDFileFastCellSupportComparator : public RefCountObject
4021 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
4022 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4023 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4024 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
4026 ~MEDFileFastCellSupportComparator();
4030 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
4032 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4033 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4034 PyObject *res(PyList_New(result.size()));
4035 for(int i=0;iL!=result.end(); i++, iL++)
4036 PyList_SetItem(res,i,PyInt_FromLong(*iL));