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 std::string __str__() const throw(INTERP_KERNEL::Exception)
779 return self->simpleRepr();
784 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
787 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
788 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
789 MEDFileJoints *deepCopy() const;
790 std::string simpleRepr() const;
791 std::string getMeshName() const;
792 int getNumberOfJoints() const;
793 std::vector<std::string> getJointsNames() const;
794 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
795 void resize(int newSize) throw(INTERP_KERNEL::Exception);
796 void pushJoint(MEDFileJoint *joint);
797 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
798 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
803 return MEDFileJoints::New();
806 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
808 return MEDFileJoints::New(fileName,meshName);
811 std::string __str__() const throw(INTERP_KERNEL::Exception)
813 return self->simpleRepr();
816 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
820 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
825 else if(PyString_Check(obj))
827 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
833 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
836 int __len__() const throw(INTERP_KERNEL::Exception)
838 return self->getNumberOfJoints();
841 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
843 MEDFileJoint *ret=self->getJointAtPos(i);
849 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
851 MEDFileJoint *ret=self->getJointWithName(paramName);
859 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
862 MEDFileEquivalenceBase();
865 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
868 MEDFileEquivalenceData();
870 void setArray(DataArrayInt *data);
873 DataArrayInt *getArray()
875 DataArrayInt *ret(self->getArray());
876 if(ret) ret->incrRef();
882 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
885 MEDFileEquivalenceNode();
888 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
891 MEDFileEquivalenceCell();
894 std::size_t size() const;
895 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
896 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
899 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
901 DataArrayInt *ret(self->getArray(type));
902 if(ret) ret->incrRef();
906 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
908 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
909 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
910 PyObject *res=PyList_New(result.size());
911 for(int i=0;iL!=result.end(); i++, iL++)
912 PyList_SetItem(res,i,PyInt_FromLong(*iL));
918 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
921 MEDFileEquivalencePair();
923 std::string getName() const;
924 void setName(const std::string& name);
925 std::string getDescription() const;
926 void setDescription(const std::string& descr);
927 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
930 MEDFileEquivalenceCell *initCell()
932 MEDFileEquivalenceCell *ret(self->initCell());
933 if(ret) ret->incrRef();
937 MEDFileEquivalenceNode *initNode()
939 MEDFileEquivalenceNode *ret(self->initNode());
940 if(ret) ret->incrRef();
944 MEDFileEquivalenceCell *getCell()
946 MEDFileEquivalenceCell *ret(self->getCell());
947 if(ret) ret->incrRef();
951 MEDFileEquivalenceNode *getNode()
953 MEDFileEquivalenceNode *ret(self->getNode());
954 if(ret) ret->incrRef();
960 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
963 MEDFileEquivalences();
966 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
967 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
968 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
972 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
974 MEDFileEquivalencePair *ret(self->getEquivalence(i));
975 if(ret) ret->incrRef();
978 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
980 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
981 if(ret) ret->incrRef();
985 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
987 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
988 if(ret) ret->incrRef();
994 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
997 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
998 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
999 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1000 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
1001 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
1002 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
1003 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
1004 void setName(const std::string& name);
1005 std::string getName();
1006 std::string getUnivName() const;
1007 bool getUnivNameWrStatus() const;
1008 void setUnivNameWrStatus(bool newStatus);
1009 void setDescription(const std::string& name);
1010 std::string getDescription() const;
1011 void setOrder(int order);
1012 int getOrder() const;
1013 void setIteration(int it);
1015 void setTimeValue(double time);
1016 void setTime(int dt, int it, double time);
1017 double getTimeValue() const;
1018 void setTimeUnit(const std::string& unit);
1019 std::string getTimeUnit() const;
1020 void setAxisType(MEDCouplingAxisType at);
1021 MEDCouplingAxisType getAxisType() const;
1022 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
1023 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1024 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
1025 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1026 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
1027 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
1028 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1029 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1030 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1031 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
1032 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
1033 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
1034 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1035 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1037 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
1038 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
1039 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1040 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1041 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1042 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1043 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1044 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1045 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1046 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1047 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1048 void clearFamMap() throw(INTERP_KERNEL::Exception);
1049 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1050 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1051 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1052 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1053 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1054 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1055 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1056 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1057 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1058 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1059 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1060 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1061 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1062 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1063 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1064 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1065 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1066 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1067 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1068 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1069 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1070 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1071 static std::string GetMagicFamilyStr();
1072 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1073 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1074 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1075 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1076 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1077 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1078 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1079 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1080 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1081 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1082 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1083 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1084 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1085 void setFamilyInfo(const std::map<std::string,int>& info);
1086 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1087 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1088 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1089 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1090 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1091 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1092 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1093 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1094 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1095 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1096 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1097 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1098 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1099 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1100 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1101 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1102 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1103 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1104 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1105 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1106 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1108 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1109 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1110 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1111 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1112 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr) throw(INTERP_KERNEL::Exception);
1113 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1114 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1115 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1116 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1117 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1118 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1119 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1120 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1121 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1122 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1123 int getNumberOfJoints();
1124 MEDFileJoints *getJoints();
1125 void setJoints( MEDFileJoints* joints );
1126 void initializeEquivalences();
1127 void killEquivalences();
1128 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1129 void killStructureElements() throw(INTERP_KERNEL::Exception);
1132 std::string __str__() const throw(INTERP_KERNEL::Exception)
1134 return self->simpleRepr();
1137 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1139 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1142 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1145 double tmp0=self->getTime(tmp1,tmp2);
1146 PyObject *res = PyList_New(3);
1147 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1148 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1149 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1153 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1156 bool ret0=self->isEqual(other,eps,what);
1157 PyObject *res=PyList_New(2);
1158 PyObject *ret0Py=ret0?Py_True:Py_False;
1160 PyList_SetItem(res,0,ret0Py);
1161 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1165 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1167 std::vector<const DataArrayInt *> grps;
1168 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1169 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1172 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1175 bool ret0=self->areFamsEqual(other,what);
1176 PyObject *res=PyList_New(2);
1177 PyObject *ret0Py=ret0?Py_True:Py_False;
1179 PyList_SetItem(res,0,ret0Py);
1180 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1184 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1187 bool ret0=self->areGrpsEqual(other,what);
1188 PyObject *res=PyList_New(2);
1189 PyObject *ret0Py=ret0?Py_True:Py_False;
1191 PyList_SetItem(res,0,ret0Py);
1192 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1196 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1198 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1199 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1200 PyObject *res=PyList_New(result.size());
1201 for(int i=0;iL!=result.end(); i++, iL++)
1202 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1206 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1208 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1209 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1210 PyObject *res=PyList_New(result.size());
1211 for(int i=0;iL!=result.end(); i++, iL++)
1212 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1216 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1218 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1221 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1224 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1226 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1229 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1232 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1234 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1237 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1240 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1242 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1245 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1248 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1250 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1253 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1256 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1259 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1260 PyObject *ret=PyTuple_New(2);
1261 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1262 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1266 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1268 DataArrayInt *ret3=0;
1269 std::vector<int> ret1,ret2;
1270 bool ret0=self->unPolyze(ret1,ret2,ret3);
1271 PyObject *ret=PyTuple_New(4);
1272 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1274 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1275 for(int j=0;j<(int)ret1.size()/3;j++)
1277 PyObject *retLev2=PyList_New(3);
1278 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1279 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1280 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1281 PyList_SetItem(retLev1_0,j,retLev2);
1283 PyTuple_SetItem(ret,1,retLev1_0);
1285 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1286 for(int j=0;j<(int)ret2.size()/3;j++)
1288 PyObject *retLev2=PyList_New(3);
1289 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1290 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1291 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1292 PyList_SetItem(retLev1_1,j,retLev2);
1294 PyTuple_SetItem(ret,2,retLev1_1);
1296 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1300 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1302 MEDFileEquivalences *ret(self->getEquivalences());
1303 if(ret) ret->incrRef();
1307 virtual DataArrayInt *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1309 MCAuto<DataArrayInt> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1315 class MEDFileUMesh : public MEDFileMesh
1318 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1319 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1320 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1321 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1322 static MEDFileUMesh *New();
1323 static const char *GetSpeStr4ExtMesh();
1325 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1326 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1327 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1328 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1329 void clearNodeAndCellNumbers();
1331 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1332 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1333 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1334 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1335 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1336 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1337 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1338 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1339 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1340 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1342 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1343 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1344 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1345 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1346 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1347 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1348 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1349 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1350 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1351 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1352 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1353 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1354 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1355 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1356 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1359 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1361 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1364 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1366 return MEDFileUMesh::New(fileName,mrs);
1369 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1371 return MEDFileUMesh::New(mem);
1374 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1376 return MEDFileUMesh::New(db);
1381 return MEDFileUMesh::New();
1385 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1387 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1390 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)
1392 std::vector<int> typesCpp1;
1393 convertPyToNewIntArr3(types,typesCpp1);
1394 std::size_t sz(typesCpp1.size());
1395 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1396 for(std::size_t ii=0;ii<sz;ii++)
1397 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1398 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1401 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1402 {// put an empty dict in input to say to __new__ to call __init__...
1403 PyObject *ret(PyTuple_New(1));
1404 PyObject *ret0(PyDict_New());
1405 PyTuple_SetItem(ret,0,ret0);
1409 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1411 std::vector<double> a0;
1412 std::vector<int> a1;
1413 std::vector<std::string> a2;
1414 std::vector< MCAuto<DataArrayInt> > a3;
1415 MCAuto<DataArrayDouble> a4;
1416 self->serialize(a0,a1,a2,a3,a4);
1417 PyObject *ret(PyTuple_New(5));
1418 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1419 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1421 PyObject *ret2(PyList_New(sz));
1422 for(int i=0;i<sz;i++)
1423 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1424 PyTuple_SetItem(ret,2,ret2);
1426 PyObject *ret3(PyList_New(sz));
1427 for(int i=0;i<sz;i++)
1429 DataArrayInt *elt(a3[i]);
1432 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1434 PyTuple_SetItem(ret,3,ret3);
1435 DataArrayDouble *ret4(a4);
1438 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1442 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1444 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1445 if(!PyTuple_Check(inp))
1446 throw INTERP_KERNEL::Exception(MSG);
1447 int sz(PyTuple_Size(inp));
1449 throw INTERP_KERNEL::Exception(MSG);
1450 std::vector<double> a0;
1451 std::vector<int> a1;
1452 std::vector<std::string> a2;
1453 std::vector< MCAuto<DataArrayInt> > a3;
1454 MCAuto<DataArrayDouble> a4;
1456 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1458 fillArrayWithPyListDbl3(a0py,tmp,a0);
1459 convertPyToNewIntArr3(a1py,a1);
1460 fillStringVector(a2py,a2);
1462 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1464 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1465 if(!SWIG_IsOK(status))
1466 throw INTERP_KERNEL::Exception(MSG);
1467 a4=reinterpret_cast<DataArrayDouble *>(argp);
1468 if((DataArrayDouble *)a4)
1471 std::vector< DataArrayInt * > a3Tmp;
1472 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1473 std::size_t sz(a3Tmp.size());
1475 for(std::size_t i=0;i<sz;i++)
1479 a3Tmp[i]->incrRef();
1481 self->unserialize(a0,a1,a2,a3,a4);
1485 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1488 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1489 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1492 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1495 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1498 self->setMeshAtLevel(meshDimRelToMax,m1);
1501 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1504 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1506 self->removeMeshAtLevel(meshDimRelToMax);
1509 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1511 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1513 DataArrayDouble *a,*a2;
1514 DataArrayDoubleTuple *aa,*aa2;
1515 std::vector<double> bb,bb2;
1517 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1518 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1519 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1523 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1525 std::vector<const MEDFileUMesh *> meshesCpp;
1526 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1527 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1531 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1533 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1534 return convertVecPairIntToPy(ret);
1537 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1539 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1540 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1541 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1544 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1546 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1547 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1548 return self->extractPart(extractDefCpp);
1551 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1553 std::vector<const MEDCouplingUMesh *> ms;
1554 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1555 self->setMeshes(ms,renum);
1558 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1560 std::vector<const MEDCouplingUMesh *> ms;
1561 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1562 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1565 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1567 std::vector<const MEDCouplingUMesh *> ms;
1568 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1569 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1572 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1574 DataArrayDouble *ret=self->getCoords();
1580 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1582 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1585 return const_cast<PartDefinition *>(ret);
1588 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1590 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1591 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1592 PyObject *ret=PyTuple_New(3);
1593 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1594 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1595 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1599 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1601 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1607 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1609 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1610 std::size_t sz(tmp.size());
1611 PyObject *ret=PyList_New(sz);
1612 for(std::size_t i=0;i<sz;i++)
1616 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1623 class MEDFileStructuredMesh : public MEDFileMesh
1628 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1630 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1638 class MEDFileCMesh : public MEDFileStructuredMesh
1641 static MEDFileCMesh *New();
1642 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1643 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1644 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1645 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1646 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1651 return MEDFileCMesh::New();
1654 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1656 return MEDFileCMesh::New(fileName,mrs);
1659 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1661 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1664 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1666 return MEDFileCMesh::New(db);
1670 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1672 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1675 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1677 const MEDCouplingCMesh *tmp=self->getMesh();
1680 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1685 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1688 static MEDFileCurveLinearMesh *New();
1689 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1690 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1691 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1692 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1695 MEDFileCurveLinearMesh()
1697 return MEDFileCurveLinearMesh::New();
1700 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1702 return MEDFileCurveLinearMesh::New(fileName,mrs);
1705 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1707 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1710 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1712 return MEDFileCurveLinearMesh::New(db);
1716 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1718 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1721 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1723 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1726 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1731 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1734 static MEDFileMeshMultiTS *New();
1735 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1736 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1737 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1738 std::string getName() const throw(INTERP_KERNEL::Exception);
1739 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1740 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1743 MEDFileMeshMultiTS()
1745 return MEDFileMeshMultiTS::New();
1748 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1750 return MEDFileMeshMultiTS::New(fileName);
1753 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1755 return MEDFileMeshMultiTS::New(fileName,mName);
1758 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1760 MEDFileMesh *ret=self->getOneTimeStep();
1768 class MEDFileMeshesIterator
1773 PyObject *next() throw(INTERP_KERNEL::Exception)
1775 MEDFileMesh *ret=self->nextt();
1779 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1783 PyErr_SetString(PyExc_StopIteration,"No more data.");
1790 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1793 static MEDFileMeshes *New();
1794 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1795 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1796 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1797 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1799 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1800 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1801 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1802 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1803 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1804 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1805 void killStructureElements() throw(INTERP_KERNEL::Exception);
1810 return MEDFileMeshes::New();
1813 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1815 return MEDFileMeshes::New(fileName);
1818 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1820 return MEDFileMeshes::New(db);
1824 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1826 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1829 std::string __str__() const throw(INTERP_KERNEL::Exception)
1831 return self->simpleRepr();
1834 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1836 if(PyInt_Check(obj))
1838 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1843 else if(PyString_Check(obj))
1845 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1851 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1854 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1856 self->setMeshAtPos(obj,mesh);
1860 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1862 return self->iterator();
1865 int __len__() const throw(INTERP_KERNEL::Exception)
1867 return self->getNumberOfMeshes();
1870 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1872 MEDFileMesh *ret=self->getMeshAtPos(i);
1877 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1879 MEDFileMesh *ret=self->getMeshWithName(mname);
1887 class MEDFileFieldLoc : public RefCountObject
1890 std::string getName() const;
1891 int getDimension() const;
1892 int getNumberOfGaussPoints() const;
1893 int getNumberOfPointsInCells() const;
1894 const std::vector<double>& getRefCoords() const;
1895 const std::vector<double>& getGaussCoords() const;
1896 const std::vector<double>& getGaussWeights() const;
1897 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1900 std::string __str__() const throw(INTERP_KERNEL::Exception)
1902 return self->repr();
1907 class MEDFileFieldGlobsReal
1910 void resetContent();
1911 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1912 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1913 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1914 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1915 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1916 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1917 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1918 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1919 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1920 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1921 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1922 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1923 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1924 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1925 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1926 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1927 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1928 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1929 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1930 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1931 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1932 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1933 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1934 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1935 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1936 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1937 void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
1940 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1942 const DataArrayInt *ret=self->getProfile(pflName);
1945 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1948 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1950 const DataArrayInt *ret=self->getProfileFromId(pflId);
1953 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1956 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1958 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1961 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1964 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1966 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1969 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1972 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1974 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1975 return convertVecPairVecStToPy(ret);
1978 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1980 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1981 return convertVecPairVecStToPy(ret);
1984 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1986 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1987 self->changePflsNames(v);
1990 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1992 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1993 self->changePflsRefsNamesGen(v);
1996 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1998 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1999 self->changePflsNamesInStruct(v);
2002 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2004 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2005 self->changeLocsNames(v);
2008 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
2010 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2011 self->changeLocsRefsNamesGen(v);
2014 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2016 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2017 self->changeLocsNamesInStruct(v);
2020 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
2022 std::ostringstream oss;
2023 self->simpleReprGlobs(oss);
2029 class MEDFileEntities
2034 static MEDFileEntities *BuildFrom(PyObject *entities) throw(INTERP_KERNEL::Exception)
2036 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2037 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2039 std::size_t sz(inp0.size());
2041 for(std::size_t i=0;i<sz;i++)
2042 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2044 return MEDFileEntities::BuildFrom(&inp);
2051 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2054 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2055 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2056 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2057 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
2058 void loadArrays() throw(INTERP_KERNEL::Exception);
2059 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2060 void unloadArrays() throw(INTERP_KERNEL::Exception);
2061 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2062 int getDimension() const throw(INTERP_KERNEL::Exception);
2063 int getIteration() const throw(INTERP_KERNEL::Exception);
2064 int getOrder() const throw(INTERP_KERNEL::Exception);
2065 std::string getName() throw(INTERP_KERNEL::Exception);
2066 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2067 std::string getMeshName() throw(INTERP_KERNEL::Exception);
2068 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2069 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2070 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2071 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2072 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2073 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2074 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2075 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2076 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2077 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2078 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2079 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2080 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2083 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2086 double tmp0=self->getTime(tmp1,tmp2);
2087 PyObject *res = PyList_New(3);
2088 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2089 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2090 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2094 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2096 std::pair<int,int> res=self->getDtIt();
2097 PyObject *elt=PyTuple_New(2);
2098 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2099 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2103 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2105 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2108 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2110 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2113 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2115 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2116 return self->changeMeshNames(modifTab);
2119 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2121 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2122 PyObject *ret2=PyList_New(ret.size());
2123 for(int i=0;i<(int)ret.size();i++)
2124 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2128 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2130 std::vector<int> ret1;
2131 int ret0=self->getNonEmptyLevels(mname,ret1);
2132 PyObject *elt=PyTuple_New(2);
2133 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2134 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2138 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2140 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2141 std::vector< std::vector<TypeOfField> > typesF;
2142 std::vector< std::vector<std::string> > pfls;
2143 std::vector< std::vector<std::string> > locs;
2144 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2146 PyObject *ret2=PyList_New(sz);
2147 for(int i=0;i<sz;i++)
2149 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2150 const std::vector<TypeOfField>& typesFI=typesF[i];
2151 const std::vector<std::string>& pflsI=pfls[i];
2152 const std::vector<std::string>& locsI=locs[i];
2153 PyObject *elt=PyTuple_New(2);
2154 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2155 int sz2=ret[i].size();
2156 PyObject *elt2=PyList_New(sz2);
2157 for(int j=0;j<sz2;j++)
2159 PyObject *elt3=PyTuple_New(4);
2160 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2161 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));
2162 PyTuple_SetItem(elt3,1,elt4);
2163 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2164 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2165 PyList_SetItem(elt2,j,elt3);
2167 PyTuple_SetItem(elt,1,elt2);
2168 PyList_SetItem(ret2,i,elt);
2173 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2175 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2176 std::size_t sz=ret.size();
2177 PyObject *retPy=PyList_New(sz);
2178 for(std::size_t i=0;i<sz;i++)
2179 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2183 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2185 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2186 std::size_t sz=ret.size();
2187 PyObject *retPy=PyList_New(sz);
2188 for(std::size_t i=0;i<sz;i++)
2189 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2193 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2195 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2196 std::size_t sz=ret.size();
2197 PyObject *retPy=PyList_New(sz);
2198 for(std::size_t i=0;i<sz;i++)
2199 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2203 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2205 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2206 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2207 return self->extractPart(extractDefCpp,mm);
2212 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2215 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2216 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2217 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2218 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2219 static MEDFileField1TS *New();
2220 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2221 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2222 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2223 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2224 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2225 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2226 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2228 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2229 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2230 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2231 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2234 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2236 return MEDFileField1TS::New(fileName,loadAll);
2239 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2241 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2244 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2246 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2249 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2251 return MEDFileField1TS::New(db);
2256 return MEDFileField1TS::New();
2260 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2262 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2265 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2267 const DataArrayDouble *arr=0;
2269 arr=field->getArray();
2270 self->copyTinyInfoFrom(field,arr);
2273 std::string __str__() const throw(INTERP_KERNEL::Exception)
2275 return self->simpleRepr();
2278 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2280 DataArrayInt *ret1=0;
2281 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2282 PyObject *ret=PyTuple_New(2);
2283 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2284 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2288 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2290 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2291 std::vector< std::vector<TypeOfField> > typesF;
2292 std::vector< std::vector<std::string> > pfls;
2293 std::vector< std::vector<std::string> > locs;
2294 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2296 PyObject *ret2=PyList_New(sz);
2297 for(int i=0;i<sz;i++)
2299 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2300 const std::vector<TypeOfField>& typesFI=typesF[i];
2301 const std::vector<std::string>& pflsI=pfls[i];
2302 const std::vector<std::string>& locsI=locs[i];
2303 PyObject *elt=PyTuple_New(2);
2304 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2305 int sz2=ret[i].size();
2306 PyObject *elt2=PyList_New(sz2);
2307 for(int j=0;j<sz2;j++)
2309 PyObject *elt3=PyTuple_New(4);
2310 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2311 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2312 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2313 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2314 PyList_SetItem(elt2,j,elt3);
2316 PyTuple_SetItem(elt,1,elt2);
2317 PyList_SetItem(ret2,i,elt);
2322 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2324 DataArrayDouble *ret=self->getUndergroundDataArray();
2330 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2332 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2333 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2336 PyObject *ret=PyTuple_New(2);
2337 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2338 std::size_t sz=elt1Cpp.size();
2339 PyObject *elt=PyList_New(sz);
2340 for(std::size_t i=0;i<sz;i++)
2342 PyObject *elt1=PyTuple_New(2);
2343 PyObject *elt2=PyTuple_New(2);
2344 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2345 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2346 PyObject *elt3=PyTuple_New(2);
2347 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2348 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2349 PyTuple_SetItem(elt1,0,elt2);
2350 PyTuple_SetItem(elt1,1,elt3);
2351 PyList_SetItem(elt,i,elt1);
2353 PyTuple_SetItem(ret,1,elt);
2359 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2362 static MEDFileIntField1TS *New();
2363 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2364 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2365 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2366 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2367 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2369 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2370 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2371 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2372 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2373 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2374 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2375 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2376 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2379 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2381 return MEDFileIntField1TS::New();
2384 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2386 return MEDFileIntField1TS::New(fileName,loadAll);
2389 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2391 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2394 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2396 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2399 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2401 return MEDFileIntField1TS::New(db);
2405 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2407 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2410 std::string __str__() const throw(INTERP_KERNEL::Exception)
2412 return self->simpleRepr();
2415 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2417 DataArrayInt *ret1=0;
2418 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2419 PyObject *ret=PyTuple_New(2);
2420 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2421 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2425 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2427 DataArrayInt *ret=self->getUndergroundDataArray();
2435 class MEDFileAnyTypeFieldMultiTSIterator
2440 PyObject *next() throw(INTERP_KERNEL::Exception)
2442 MEDFileAnyTypeField1TS *ret=self->nextt();
2444 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2447 PyErr_SetString(PyExc_StopIteration,"No more data.");
2454 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2457 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2458 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2459 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2460 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2461 std::string getName() const throw(INTERP_KERNEL::Exception);
2462 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2463 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2464 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2465 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2466 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2467 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2468 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2469 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2470 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2471 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2472 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2473 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2474 void loadArrays() throw(INTERP_KERNEL::Exception);
2475 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2476 void unloadArrays() throw(INTERP_KERNEL::Exception);
2477 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2479 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2480 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2481 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2482 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2483 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2484 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2487 int __len__() const throw(INTERP_KERNEL::Exception)
2489 return self->getNumberOfTS();
2492 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2494 if(elt0 && PyInt_Check(elt0))
2496 int pos=PyInt_AS_LONG(elt0);
2499 else if(elt0 && PyTuple_Check(elt0))
2501 if(PyTuple_Size(elt0)==2)
2503 PyObject *o0=PyTuple_GetItem(elt0,0);
2504 PyObject *o1=PyTuple_GetItem(elt0,1);
2505 if(PyInt_Check(o0) && PyInt_Check(o1))
2507 int iter=PyInt_AS_LONG(o0);
2508 int order=PyInt_AS_LONG(o1);
2509 return self->getPosOfTimeStep(iter,order);
2512 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 !");
2515 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 !");
2517 else if(elt0 && PyFloat_Check(elt0))
2519 double val=PyFloat_AS_DOUBLE(elt0);
2520 return self->getPosGivenTime(val);
2523 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2526 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2528 std::vector< std::pair<int,int> > res(self->getIterations());
2529 return convertVecPairIntToPy(res);
2532 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2534 std::vector<double> ret1;
2535 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2536 std::size_t sz=ret.size();
2537 PyObject *ret2=PyList_New(sz);
2538 for(std::size_t i=0;i<sz;i++)
2540 PyObject *elt=PyTuple_New(3);
2541 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2542 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2543 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2544 PyList_SetItem(ret2,i,elt);
2549 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2551 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2552 PyObject *ret2=PyList_New(ret.size());
2553 for(int i=0;i<(int)ret.size();i++)
2555 const std::vector<TypeOfField>& rett=ret[i];
2556 PyObject *ret3=PyList_New(rett.size());
2557 for(int j=0;j<(int)rett.size();j++)
2558 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2559 PyList_SetItem(ret2,i,ret3);
2564 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2566 std::vector<int> ret1;
2567 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2568 PyObject *elt=PyTuple_New(2);
2569 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2570 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2574 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2576 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2577 std::vector< std::vector<TypeOfField> > typesF;
2578 std::vector< std::vector<std::string> > pfls;
2579 std::vector< std::vector<std::string> > locs;
2580 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2582 PyObject *ret2=PyList_New(sz);
2583 for(int i=0;i<sz;i++)
2585 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2586 const std::vector<TypeOfField>& typesFI=typesF[i];
2587 const std::vector<std::string>& pflsI=pfls[i];
2588 const std::vector<std::string>& locsI=locs[i];
2589 PyObject *elt=PyTuple_New(2);
2590 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2591 int sz2=ret[i].size();
2592 PyObject *elt2=PyList_New(sz2);
2593 for(int j=0;j<sz2;j++)
2595 PyObject *elt3=PyTuple_New(4);
2596 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2597 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));
2598 PyTuple_SetItem(elt3,1,elt4);
2599 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2600 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2601 PyList_SetItem(elt2,j,elt3);
2603 PyTuple_SetItem(elt,1,elt2);
2604 PyList_SetItem(ret2,i,elt);
2609 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2611 if(PyList_Check(elts))
2613 int sz=PyList_Size(elts);
2614 std::vector<int> ret(sz);
2615 for(int i=0;i<sz;i++)
2617 PyObject *elt=PyList_GetItem(elts,i);
2618 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2624 std::vector<int> ret(1);
2625 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2630 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2632 if(PySlice_Check(elts))
2634 Py_ssize_t strt=2,stp=2,step=2;
2635 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2636 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2637 self->eraseTimeStepIds2(strt,stp,step);
2641 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2642 if(!idsToRemove.empty())
2643 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2647 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2651 std::vector<int> pos2;
2652 DataArrayInt *pos3=0;
2653 DataArrayIntTuple *pos4=0;
2654 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2659 self->eraseTimeStepIds(&pos1,&pos1+1);
2666 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2671 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2675 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2679 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2681 return self->iterator();
2684 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2686 if(elt0 && PyList_Check(elt0))
2688 int sz=PyList_Size(elt0);
2689 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2690 int *pt=da->getPointer();
2691 for(int i=0;i<sz;i++,pt++)
2693 PyObject *elt1=PyList_GetItem(elt0,i);
2694 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2696 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2698 else if(elt0 && PySlice_Check(elt0))
2700 Py_ssize_t strt=2,stp=2,step=2;
2701 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2702 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2703 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2706 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2709 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2711 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2712 return self->changeMeshNames(modifTab);
2715 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2717 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2718 std::size_t sz=ret.size();
2719 PyObject *retPy=PyList_New(sz);
2720 for(std::size_t i=0;i<sz;i++)
2721 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2725 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2727 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2728 std::size_t sz=ret.size();
2729 PyObject *retPy=PyList_New(sz);
2730 for(std::size_t i=0;i<sz;i++)
2731 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2735 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2737 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2738 std::size_t sz=ret.size();
2739 PyObject *retPy=PyList_New(sz);
2740 for(std::size_t i=0;i<sz;i++)
2741 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2745 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2748 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2749 if(SWIG_IsOK(status))
2751 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2755 std::vector<MEDFileAnyTypeField1TS *> tmp;
2756 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2757 self->pushBackTimeSteps(tmp);
2761 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2763 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2764 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2765 return self->extractPart(extractDefCpp,mm);
2768 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2770 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2771 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2772 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2773 std::size_t sz=ret.size();
2774 PyObject *retPy=PyList_New(sz);
2775 for(std::size_t i=0;i<sz;i++)
2777 std::size_t sz2=ret[i].size();
2778 PyObject *ret1Py=PyList_New(sz2);
2779 for(std::size_t j=0;j<sz2;j++)
2781 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2784 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2786 PyList_SetItem(retPy,i,ret1Py);
2791 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2793 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2794 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2795 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2796 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2797 if(ret2.size()!=ret.size())
2799 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2800 throw INTERP_KERNEL::Exception(oss.str().c_str());
2802 std::size_t sz=ret.size();
2803 PyObject *retPy=PyList_New(sz);
2804 for(std::size_t i=0;i<sz;i++)
2806 std::size_t sz2=ret[i].size();
2807 PyObject *ret0Py=PyTuple_New(2);
2808 PyObject *ret1Py=PyList_New(sz2);
2809 for(std::size_t j=0;j<sz2;j++)
2811 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2814 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2816 PyTuple_SetItem(ret0Py,0,ret1Py);
2817 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2818 PyList_SetItem(retPy,i,ret0Py);
2825 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2828 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2829 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2830 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2831 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2833 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2834 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2835 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2836 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2837 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2838 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2840 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2841 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2842 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2845 MEDFileFieldMultiTS()
2847 return MEDFileFieldMultiTS::New();
2850 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2852 return MEDFileFieldMultiTS::New(fileName,loadAll);
2855 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2857 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2860 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2862 return MEDFileFieldMultiTS::New(db);
2866 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2868 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2871 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2873 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2874 std::size_t sz(tmp.size());
2875 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2876 for(std::size_t i=0;i<sz;i++)
2878 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2879 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2881 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2884 std::string __str__() const throw(INTERP_KERNEL::Exception)
2886 return self->simpleRepr();
2889 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2891 DataArrayInt *ret1=0;
2892 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2893 PyObject *ret=PyTuple_New(2);
2894 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2895 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2899 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2901 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2902 std::vector< std::vector<TypeOfField> > typesF;
2903 std::vector< std::vector<std::string> > pfls;
2904 std::vector< std::vector<std::string> > locs;
2905 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2907 PyObject *ret2=PyList_New(sz);
2908 for(int i=0;i<sz;i++)
2910 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2911 const std::vector<TypeOfField>& typesFI=typesF[i];
2912 const std::vector<std::string>& pflsI=pfls[i];
2913 const std::vector<std::string>& locsI=locs[i];
2914 PyObject *elt=PyTuple_New(2);
2915 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2916 int sz2=ret[i].size();
2917 PyObject *elt2=PyList_New(sz2);
2918 for(int j=0;j<sz2;j++)
2920 PyObject *elt3=PyTuple_New(4);
2921 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2922 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2923 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2924 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2925 PyList_SetItem(elt2,j,elt3);
2927 PyTuple_SetItem(elt,1,elt2);
2928 PyList_SetItem(ret2,i,elt);
2932 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2934 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2940 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2942 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2943 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2946 PyObject *ret=PyTuple_New(2);
2947 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2948 std::size_t sz=elt1Cpp.size();
2949 PyObject *elt=PyList_New(sz);
2950 for(std::size_t i=0;i<sz;i++)
2952 PyObject *elt1=PyTuple_New(2);
2953 PyObject *elt2=PyTuple_New(2);
2954 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2955 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2956 PyObject *elt3=PyTuple_New(2);
2957 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2958 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2959 PyTuple_SetItem(elt1,0,elt2);
2960 PyTuple_SetItem(elt1,1,elt3);
2961 PyList_SetItem(elt,i,elt1);
2963 PyTuple_SetItem(ret,1,elt);
2969 class MEDFileFieldsIterator
2974 PyObject *next() throw(INTERP_KERNEL::Exception)
2976 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2978 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2981 PyErr_SetString(PyExc_StopIteration,"No more data.");
2988 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2991 static MEDFileIntFieldMultiTS *New();
2992 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2993 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2994 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2996 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2997 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2998 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2999 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
3000 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3001 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3002 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3003 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3004 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3007 MEDFileIntFieldMultiTS()
3009 return MEDFileIntFieldMultiTS::New();
3012 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3014 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
3017 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3019 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
3022 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3024 return MEDFileIntFieldMultiTS::New(db);
3028 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3030 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
3033 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3035 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3036 std::size_t sz(tmp.size());
3037 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3038 for(std::size_t i=0;i<sz;i++)
3040 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3041 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3043 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3046 std::string __str__() const throw(INTERP_KERNEL::Exception)
3048 return self->simpleRepr();
3051 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3053 DataArrayInt *ret1=0;
3054 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3055 PyObject *ret=PyTuple_New(2);
3056 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3057 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3061 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3063 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3071 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3074 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3075 std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3078 MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3080 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3081 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3089 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3092 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3094 MEDFileStructureElements();
3097 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3100 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3101 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3102 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3103 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
3104 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3105 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3106 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3107 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3108 void loadArrays() throw(INTERP_KERNEL::Exception);
3109 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3110 void unloadArrays() throw(INTERP_KERNEL::Exception);
3111 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3112 int getNumberOfFields() const;
3113 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3114 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3116 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3117 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3118 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3119 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3120 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3121 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3122 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3123 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3124 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3125 void killStructureElements() throw(INTERP_KERNEL::Exception);
3126 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3127 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3128 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3129 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3130 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3135 return MEDFileFields::New();
3138 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3140 return MEDFileFields::New(fileName,loadAll);
3143 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3145 return MEDFileFields::New(db);
3148 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
3150 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3154 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3156 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3159 std::string __str__() const throw(INTERP_KERNEL::Exception)
3161 return self->simpleRepr();
3164 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3166 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3170 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3172 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3176 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3178 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3179 std::size_t sz(tmp.size());
3180 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3181 for(std::size_t i=0;i<sz;i++)
3183 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3184 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3186 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3189 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3191 std::vector< std::pair<std::string,std::string> > ps;
3192 self->getMeshSENames(ps);
3193 return convertVectPairStToPy(ps);
3196 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3199 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3200 PyObject *ret=PyTuple_New(2);
3201 PyObject *ret_0=PyList_New(ret0.size());
3203 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3205 PyObject *elt=PyTuple_New(2);
3206 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3207 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3208 PyList_SetItem(ret_0,rk,elt);
3210 PyTuple_SetItem(ret,0,ret_0);
3211 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3212 PyTuple_SetItem(ret,1,ret_1);
3216 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3218 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3219 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3222 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3224 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3225 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3228 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3230 if(obj && PyList_Check(obj))
3232 int sz=PyList_Size(obj);
3233 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3234 int *pt=da->getPointer();
3235 for(int i=0;i<sz;i++,pt++)
3237 PyObject *elt1=PyList_GetItem(obj,i);
3238 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3240 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3243 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3246 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3248 self->setFieldAtPos(obj,field);
3252 int __len__() const throw(INTERP_KERNEL::Exception)
3254 return self->getNumberOfFields();
3257 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3259 return self->iterator();
3262 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3264 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3265 return self->changeMeshNames(modifTab);
3268 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3270 if(elt0 && PyInt_Check(elt0))
3272 return PyInt_AS_LONG(elt0);
3274 else if(elt0 && PyString_Check(elt0))
3275 return self->getPosFromFieldName(PyString_AsString(elt0));
3277 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3280 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3282 if(PyList_Check(elts))
3284 int sz=PyList_Size(elts);
3285 std::vector<int> ret(sz);
3286 for(int i=0;i<sz;i++)
3288 PyObject *elt=PyList_GetItem(elts,i);
3289 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3295 std::vector<int> ret(1);
3296 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3301 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3303 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3304 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3305 self->pushFields(tmp);
3308 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3310 if(elts && PySlice_Check(elts))
3312 Py_ssize_t strt=2,stp=2,step=2;
3313 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3314 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3315 self->destroyFieldsAtPos2(strt,stp,step);
3319 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3320 if(!idsToRemove.empty())
3321 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3325 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3327 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3328 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3329 return self->extractPart(extractDefCpp,mm);
3334 class MEDFileParameter1TS : public RefCountObject
3337 void setIteration(int it);
3338 int getIteration() const;
3339 void setOrder(int order);
3340 int getOrder() const;
3341 void setTimeValue(double time);
3342 void setTime(int dt, int it, double time);
3343 double getTime(int& dt, int& it);
3344 double getTimeValue() const;
3347 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3350 void setValue(double val) throw(INTERP_KERNEL::Exception);
3351 double getValue() const throw(INTERP_KERNEL::Exception);
3352 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3355 std::string __str__() const throw(INTERP_KERNEL::Exception)
3357 return self->simpleRepr();
3362 class MEDFileParameterTinyInfo : public MEDFileWritable
3365 void setDescription(const std::string& name);
3366 std::string getDescription() const;
3367 void setTimeUnit(const std::string& unit);
3368 std::string getTimeUnit() const;
3371 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3374 static MEDFileParameterDouble1TS *New();
3375 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3376 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3377 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3378 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3379 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3380 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3381 std::string getName() const throw(INTERP_KERNEL::Exception);
3382 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3385 MEDFileParameterDouble1TS()
3387 return MEDFileParameterDouble1TS::New();
3390 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3392 return MEDFileParameterDouble1TS::New(fileName);
3395 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3397 return MEDFileParameterDouble1TS::New(fileName,paramName);
3400 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3402 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3405 std::string __str__() const throw(INTERP_KERNEL::Exception)
3407 return self->simpleRepr();
3410 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3413 bool ret0=self->isEqual(other,eps,what);
3414 PyObject *res=PyList_New(2);
3415 PyObject *ret0Py=ret0?Py_True:Py_False;
3417 PyList_SetItem(res,0,ret0Py);
3418 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3424 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3427 static MEDFileParameterMultiTS *New();
3428 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3429 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3430 std::string getName() const;
3431 void setName(const std::string& name);
3432 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3433 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3434 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3435 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3436 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3437 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3438 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3439 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3442 MEDFileParameterMultiTS()
3444 return MEDFileParameterMultiTS::New();
3447 MEDFileParameterMultiTS(const std::string& fileName)
3449 return MEDFileParameterMultiTS::New(fileName);
3452 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3454 return MEDFileParameterMultiTS::New(fileName,paramName);
3457 std::string __str__() const throw(INTERP_KERNEL::Exception)
3459 return self->simpleRepr();
3462 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3465 bool ret0=self->isEqual(other,eps,what);
3466 PyObject *res=PyList_New(2);
3467 PyObject *ret0Py=ret0?Py_True:Py_False;
3469 PyList_SetItem(res,0,ret0Py);
3470 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3474 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3478 std::vector<int> pos2;
3479 DataArrayInt *pos3=0;
3480 DataArrayIntTuple *pos4=0;
3481 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3486 self->eraseTimeStepIds(&pos1,&pos1+1);
3493 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3498 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3502 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3506 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3508 if(elt0 && PyInt_Check(elt0))
3510 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3513 else if(elt0 && PyTuple_Check(elt0))
3515 if(PyTuple_Size(elt0)==2)
3517 PyObject *o0=PyTuple_GetItem(elt0,0);
3518 PyObject *o1=PyTuple_GetItem(elt0,1);
3519 if(PyInt_Check(o0) && PyInt_Check(o1))
3521 int iter=PyInt_AS_LONG(o0);
3522 int order=PyInt_AS_LONG(o1);
3523 return self->getPosOfTimeStep(iter,order);
3526 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 !");
3529 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 !");
3531 else if(elt0 && PyFloat_Check(elt0))
3533 double val=PyFloat_AS_DOUBLE(elt0);
3534 return self->getPosGivenTime(val);
3537 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3540 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3542 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3548 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3550 if(PyList_Check(elts))
3552 int sz=PyList_Size(elts);
3553 std::vector<int> ret(sz);
3554 for(int i=0;i<sz;i++)
3556 PyObject *elt=PyList_GetItem(elts,i);
3557 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3563 std::vector<int> ret(1);
3564 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3569 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3571 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3572 if(!idsToRemove.empty())
3573 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3576 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3578 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3584 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3586 std::vector< std::pair<int,int> > res=self->getIterations();
3587 PyObject *ret=PyList_New(res.size());
3589 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3591 PyObject *elt=PyTuple_New(2);
3592 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3593 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3594 PyList_SetItem(ret,rk,elt);
3599 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3601 std::vector<double> res2;
3602 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3603 PyObject *ret=PyList_New(res.size());
3605 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3607 PyObject *elt=PyTuple_New(3);
3608 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3609 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3610 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3611 PyList_SetItem(ret,rk,elt);
3618 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3621 static MEDFileParameters *New();
3622 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3623 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3624 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3625 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3626 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3627 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3628 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3629 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3630 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3631 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3632 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3637 return MEDFileParameters::New();
3640 MEDFileParameters(const std::string& fileName)
3642 return MEDFileParameters::New(fileName);
3645 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3647 return MEDFileParameters::New(db);
3651 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3653 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3656 std::string __str__() const throw(INTERP_KERNEL::Exception)
3658 return self->simpleRepr();
3661 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3663 if(PyInt_Check(obj))
3665 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3670 else if(PyString_Check(obj))
3672 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3678 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3681 int __len__() const throw(INTERP_KERNEL::Exception)
3683 return self->getNumberOfParams();
3686 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3688 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3694 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3696 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3702 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3705 bool ret0=self->isEqual(other,eps,what);
3706 PyObject *res=PyList_New(2);
3707 PyObject *ret0Py=ret0?Py_True:Py_False;
3709 PyList_SetItem(res,0,ret0Py);
3710 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3716 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3719 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3720 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3721 static MEDFileData *New();
3722 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3723 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3724 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3725 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3726 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3727 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3728 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3730 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3731 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3732 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3733 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3734 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3738 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3740 return MEDFileData::New(fileName);
3743 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3745 return MEDFileData::New(db);
3750 return MEDFileData::New();
3753 std::string __str__() const throw(INTERP_KERNEL::Exception)
3755 return self->simpleRepr();
3758 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3760 MEDFileMeshes *ret=self->getMeshes();
3766 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3768 MEDFileParameters *ret=self->getParams();
3774 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3776 MEDFileFields *ret=self->getFields();
3782 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3784 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3785 return self->changeMeshNames(modifTab);
3788 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3790 std::vector<const MEDFileData *> mfdsCpp;
3791 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3792 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3797 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3799 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3804 class SauvReader : public RefCountObject
3807 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3808 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3811 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3813 return SauvReader::New(fileName);
3818 class SauvWriter : public RefCountObject
3821 static SauvWriter * New();
3822 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3823 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3824 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3825 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3828 SauvWriter() throw(INTERP_KERNEL::Exception)
3830 return SauvWriter::New();
3837 class MEDFileMeshStruct;
3839 class MEDFileField1TSStructItem
3842 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3845 class MEDFileMeshStruct : public RefCountObject
3848 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3850 ~MEDFileMeshStruct();
3853 class MEDMeshMultiLev : public RefCountObject
3856 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3857 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3858 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3864 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3866 DataArrayInt *famIds(0);
3867 bool isWithoutCopy(false);
3868 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3869 PyObject *ret=PyTuple_New(2);
3870 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3872 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3873 PyTuple_SetItem(ret,1,ret1Py);
3877 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3879 DataArrayInt *numIds(0);
3880 bool isWithoutCopy(false);
3881 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3882 PyObject *ret=PyTuple_New(2);
3883 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3885 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3886 PyTuple_SetItem(ret,1,ret1Py);
3890 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3892 DataArrayInt *famIds(0);
3893 bool isWithoutCopy(false);
3894 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3895 PyObject *ret=PyTuple_New(2);
3896 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3898 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3899 PyTuple_SetItem(ret,1,ret1Py);
3903 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3905 DataArrayInt *numIds(0);
3906 bool isWithoutCopy(false);
3907 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3908 PyObject *ret=PyTuple_New(2);
3909 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3911 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3912 PyTuple_SetItem(ret,1,ret1Py);
3916 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3918 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3919 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3920 PyObject *res(PyList_New(result.size()));
3921 for(int i=0;iL!=result.end(); i++, iL++)
3922 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3928 class MEDUMeshMultiLev : public MEDMeshMultiLev
3931 ~MEDUMeshMultiLev();
3935 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3937 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3938 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3939 PyObject *ret0Py=ncc?Py_True:Py_False;
3941 PyObject *ret=PyTuple_New(7);
3942 PyTuple_SetItem(ret,0,ret0Py);
3943 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3944 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3945 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3946 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3947 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3948 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3954 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3957 ~MEDStructuredMeshMultiLev();
3960 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3963 ~MEDCMeshMultiLev();
3967 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3970 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3971 std::size_t sz(objs.size());
3972 PyObject *ret(PyTuple_New(2));
3973 PyObject *ret0=PyList_New(sz);
3974 for(std::size_t i=0;i<sz;i++)
3975 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3976 PyTuple_SetItem(ret,0,ret0);
3977 PyObject *ret1Py(isInternal?Py_True:Py_False);
3979 PyTuple_SetItem(ret,1,ret1Py);
3985 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3988 ~MEDCurveLinearMeshMultiLev();
3992 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3994 DataArrayDouble *ret0(0);
3995 std::vector<int> ret1;
3997 self->buildVTUArrays(ret0,ret1,ret2);
3998 std::size_t sz(ret1.size());
3999 PyObject *ret=PyTuple_New(3);
4000 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4001 PyObject *ret1Py=PyList_New(sz);
4002 for(std::size_t i=0;i<sz;i++)
4003 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
4004 PyTuple_SetItem(ret,1,ret1Py);
4005 PyObject *ret2Py(ret2?Py_True:Py_False);
4007 PyTuple_SetItem(ret,2,ret2Py);
4013 class MEDFileFastCellSupportComparator : public RefCountObject
4016 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
4017 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4018 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4019 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
4021 ~MEDFileFastCellSupportComparator();
4025 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
4027 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4028 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4029 PyObject *res(PyList_New(result.size()));
4030 for(int i=0;iL!=result.end(); i++, iL++)
4031 PyList_SetItem(res,i,PyInt_FromLong(*iL));