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::MEDFileJointCorrespondence::getCorrespondence;
243 %newobject MEDCoupling::MEDFileJointOneStep::New;
244 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
245 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
246 %newobject MEDCoupling::MEDFileJointOneStep::getCorrespondenceAtPos;
247 %newobject MEDCoupling::MEDFileJointOneStep::__getitem__;
248 %newobject MEDCoupling::MEDFileJoint::New;
249 %newobject MEDCoupling::MEDFileJoint::deepCopy;
250 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
251 %newobject MEDCoupling::MEDFileJoint::getStepAtPos;
252 %newobject MEDCoupling::MEDFileJoint::__getitem__;
253 %newobject MEDCoupling::MEDFileJoints::New;
254 %newobject MEDCoupling::MEDFileJoints::deepCopy;
255 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
256 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
257 %newobject MEDCoupling::MEDFileJoints::__getitem__;
258 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
259 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
260 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
261 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
262 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
263 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
264 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
265 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
266 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
268 %newobject MEDCoupling::SauvWriter::New;
269 %newobject MEDCoupling::SauvReader::New;
270 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
272 %newobject MEDCoupling::MEDFileMeshStruct::New;
273 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
274 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
275 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
276 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
277 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
279 %feature("unref") MEDFileMesh "$this->decrRef();"
280 %feature("unref") MEDFileUMesh "$this->decrRef();"
281 %feature("unref") MEDFileCMesh "$this->decrRef();"
282 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
283 %feature("unref") MEDFileMeshes "$this->decrRef();"
284 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
285 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
286 %feature("unref") MEDFileField1TS "$this->decrRef();"
287 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
288 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
289 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
290 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
291 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
292 %feature("unref") MEDFileStructureElements "$this->decrRef();"
293 %feature("unref") MEDFileFields "$this->decrRef();"
294 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
295 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
296 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
297 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
298 %feature("unref") MEDFileParameters "$this->decrRef();"
299 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
300 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
301 %feature("unref") MEDFileJoint "$this->decrRef();"
302 %feature("unref") MEDFileJoints "$this->decrRef();"
303 %feature("unref") MEDFileEquivalences "$this->decrRef();"
304 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
305 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
306 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
307 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
308 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
309 %feature("unref") MEDFileData "$this->decrRef();"
310 %feature("unref") SauvReader "$this->decrRef();"
311 %feature("unref") SauvWriter "$this->decrRef();"
312 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
313 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
314 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
315 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
316 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
317 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
319 namespace MEDCoupling
322 std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
323 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
324 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
325 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
326 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
327 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
328 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
329 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
330 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
331 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
332 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
333 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
334 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
335 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
336 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
337 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
338 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
339 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
340 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
341 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
342 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
343 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
344 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
345 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
346 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);
347 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);
348 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);
349 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);
350 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
351 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
352 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
353 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
354 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
355 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
358 %rename (MEDFileVersion) MEDFileVersionSwig;
359 %rename (GetFieldIterations) GetFieldIterationsSwig;
360 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
361 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
362 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
363 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
364 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
365 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
366 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
367 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
368 %rename (WriteUMeshes) WriteUMeshesSwig;
369 %rename (GetTypesOfField) GetTypesOfFieldSwig;
370 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
371 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
372 %rename (ReadField) ReadFieldSwig;
376 PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
378 int major,minor,release;
379 MEDCoupling::MEDFileVersion(major,minor,release);
380 PyObject *ret(PyTuple_New(3));
381 PyTuple_SetItem(ret,0,SWIG_From_int(major));
382 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
383 PyTuple_SetItem(ret,2,SWIG_From_int(release));
387 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName) throw(INTERP_KERNEL::Exception)
389 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName));
393 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
395 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName));
399 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
401 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
405 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)
407 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
411 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
413 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
414 PyObject *ret=PyList_New(res.size());
416 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
418 PyObject *elt=PyTuple_New(2);
419 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
420 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
421 PyList_SetItem(ret,rk,elt);
426 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
428 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
429 PyObject *ret=PyList_New(res.size());
431 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
433 PyObject *elt=PyTuple_New(3);
434 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
435 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
436 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
437 PyList_SetItem(ret,rk,elt);
442 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
444 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
445 PyObject *ret=PyList_New(res.size());
447 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
449 PyObject *elt=PyTuple_New(2);
450 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
451 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
452 PyList_SetItem(ret,rk,elt);
457 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
459 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
460 PyObject *ret=PyList_New(res.size());
462 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
464 PyObject *elt=PyTuple_New(2);
465 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
466 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
467 PyList_SetItem(ret,rk,elt);
472 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
474 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
475 PyObject *ret=PyList_New(res.size());
477 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
479 PyObject *elt=PyTuple_New(2);
480 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
481 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
482 PyList_SetItem(ret,rk,elt);
487 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
489 int meshDim,spaceDim,numberOfNodes;
490 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
491 PyObject *ret=PyTuple_New(4);
492 PyObject *elt0=PyList_New(res.size());
494 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
496 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
498 PyObject *elt1=PyList_New(obj2.size());
499 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
501 PyObject *elt2=PyTuple_New(2);
502 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
503 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
504 PyList_SetItem(elt1,j,elt2);
506 PyList_SetItem(elt0,i,elt1);
508 PyTuple_SetItem(ret,0,elt0);
509 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
510 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
511 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
515 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
516 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
518 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
519 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
520 return convertFieldDoubleVecToPy(res);
523 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
525 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
526 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
527 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
530 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
532 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
533 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
534 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
537 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
539 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
540 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
541 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
544 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
546 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
548 PyObject *ret=PyList_New(size);
549 for(int i=0;i<size;i++)
550 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
554 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
556 std::vector<std::string> grps;
557 converPyListToVecString(li,grps);
558 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
561 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
563 std::vector<std::string> fams;
564 converPyListToVecString(li,fams);
565 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
569 namespace MEDCoupling
571 class MEDFileWritable
574 void copyOptionsFrom(const MEDFileWritable& other) const;
575 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
576 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
577 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
578 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
581 class MEDFileWritableStandAlone : public MEDFileWritable
584 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
585 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
588 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
590 MCAuto<DataArrayByte> ret(self->serialize());
594 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
596 PyObject *ret(PyList_New(0));
600 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
604 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
607 PyObject *ret(PyTuple_New(1));
608 PyObject *ret0(PyDict_New());
609 DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
610 PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
611 {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
612 PyObject *tmp1(PyInt_FromLong(0));
613 PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
614 PyTuple_SetItem(ret,0,ret0);
618 throw INTERP_KERNEL::Exception("PyWrap of MEDFileData.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
624 class MEDFileMeshReadSelector
627 MEDFileMeshReadSelector();
628 MEDFileMeshReadSelector(unsigned int code);
629 unsigned int getCode() const;
630 void setCode(unsigned int newCode);
631 bool isCellFamilyFieldReading() const;
632 bool isNodeFamilyFieldReading() const;
633 bool isCellNameFieldReading() const;
634 bool isNodeNameFieldReading() const;
635 bool isCellNumFieldReading() const;
636 bool isNodeNumFieldReading() const;
637 bool isGlobalNodeNumFieldReading() const;
638 void setCellFamilyFieldReading(bool b);
639 void setNodeFamilyFieldReading(bool b);
640 void setCellNameFieldReading(bool b);
641 void setNodeNameFieldReading(bool b);
642 void setCellNumFieldReading(bool b);
643 void setNodeNumFieldReading(bool b);
644 void setGlobalNodeNumFieldReading(bool b);
647 std::string __str__() const throw(INTERP_KERNEL::Exception)
649 std::ostringstream oss;
654 std::string __repr__() const throw(INTERP_KERNEL::Exception)
656 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
662 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
665 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
666 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
667 throw(INTERP_KERNEL::Exception);
668 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
669 INTERP_KERNEL::NormalizedCellType loc_geo_type,
670 INTERP_KERNEL::NormalizedCellType rem_geo_type)
671 throw(INTERP_KERNEL::Exception);
672 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
673 MEDFileJointCorrespondence *deepCopy() const;
674 MEDFileJointCorrespondence *shallowCpy() const;
675 void setIsNodal(bool isNodal);
676 bool getIsNodal() const;
677 bool isEqual(const MEDFileJointCorrespondence *other) const;
678 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
679 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
680 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
681 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
682 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
683 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);
684 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
687 MEDFileJointCorrespondence()
689 return MEDFileJointCorrespondence::New();
691 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
693 return MEDFileJointCorrespondence::New(correspondence);
695 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
696 INTERP_KERNEL::NormalizedCellType loc_geo_type,
697 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
699 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
702 std::string __str__() const throw(INTERP_KERNEL::Exception)
704 return self->simpleRepr();
707 DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception)
709 const DataArrayInt *ret(self->getCorrespondence());
712 return const_cast<DataArrayInt *>(ret);
717 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
720 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
721 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
722 MEDFileJointOneStep *deepCopy() const;
723 MEDFileJointOneStep *shallowCpy() const;
724 bool isEqual(const MEDFileJointOneStep *other) const;
725 void setOrder(int order);
726 int getOrder() const;
727 void setIteration(int it);
728 int getIteration() const;
729 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
730 int getNumberOfCorrespondences() const;
731 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
732 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
735 MEDFileJointOneStep()
737 return MEDFileJointOneStep::New();
740 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
742 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
745 std::string __str__() const throw(INTERP_KERNEL::Exception)
747 return self->simpleRepr();
750 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const throw(INTERP_KERNEL::Exception)
752 MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
758 MEDFileJointCorrespondence *__getitem__(int i) const throw(INTERP_KERNEL::Exception)
760 return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
765 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
768 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
769 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
770 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception);
771 MEDFileJoint *deepCopy() const;
772 MEDFileJoint *shallowCpy() const;
773 bool isEqual(const MEDFileJoint *other) const;
774 void setLocalMeshName(const std::string& name);
775 std::string getLocalMeshName() const;
776 void setRemoteMeshName(const std::string& name);
777 std::string getRemoteMeshName() const;
778 void setDescription(const std::string& name);
779 std::string getDescription() const;
780 void setJointName(const std::string& name);
781 std::string getJointName() const;
782 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
783 void setDomainNumber(const int& number);
784 int getDomainNumber() const;
785 void pushStep(MEDFileJointOneStep* step);
786 int getNumberOfSteps() const;
787 std::string simpleRepr() const;
792 return MEDFileJoint::New();
795 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
797 return MEDFileJoint::New(fileName,mName,num);
800 MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception)
802 return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
805 std::string __str__() const throw(INTERP_KERNEL::Exception)
807 return self->simpleRepr();
810 MEDFileJointOneStep *getStepAtPos(int i) const throw(INTERP_KERNEL::Exception)
812 MEDFileJointOneStep *ret(self->getStepAtPos(i));
818 MEDFileJointOneStep *__getitem__(int i) throw(INTERP_KERNEL::Exception)
820 return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
825 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
828 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
829 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
830 MEDFileJoints *deepCopy() const;
831 std::string simpleRepr() const;
832 std::string getMeshName() const;
833 int getNumberOfJoints() const;
834 std::vector<std::string> getJointsNames() const;
835 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
836 void resize(int newSize) throw(INTERP_KERNEL::Exception);
837 void pushJoint(MEDFileJoint *joint);
838 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
839 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
844 return MEDFileJoints::New();
847 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
849 return MEDFileJoints::New(fileName,meshName);
852 std::string __str__() const throw(INTERP_KERNEL::Exception)
854 return self->simpleRepr();
857 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
861 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
866 else if(PyString_Check(obj))
868 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
874 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
877 int __len__() const throw(INTERP_KERNEL::Exception)
879 return self->getNumberOfJoints();
882 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
884 MEDFileJoint *ret=self->getJointAtPos(i);
890 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
892 MEDFileJoint *ret=self->getJointWithName(paramName);
900 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
903 MEDFileEquivalenceBase();
906 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
909 MEDFileEquivalenceData();
911 void setArray(DataArrayInt *data);
914 DataArrayInt *getArray()
916 DataArrayInt *ret(self->getArray());
917 if(ret) ret->incrRef();
923 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
926 MEDFileEquivalenceNode();
929 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
932 MEDFileEquivalenceCell();
935 std::size_t size() const;
936 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
937 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
940 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
942 DataArrayInt *ret(self->getArray(type));
943 if(ret) ret->incrRef();
947 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
949 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
950 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
951 PyObject *res=PyList_New(result.size());
952 for(int i=0;iL!=result.end(); i++, iL++)
953 PyList_SetItem(res,i,PyInt_FromLong(*iL));
959 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
962 MEDFileEquivalencePair();
964 std::string getName() const;
965 void setName(const std::string& name);
966 std::string getDescription() const;
967 void setDescription(const std::string& descr);
968 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
971 MEDFileEquivalenceCell *initCell()
973 MEDFileEquivalenceCell *ret(self->initCell());
974 if(ret) ret->incrRef();
978 MEDFileEquivalenceNode *initNode()
980 MEDFileEquivalenceNode *ret(self->initNode());
981 if(ret) ret->incrRef();
985 MEDFileEquivalenceCell *getCell()
987 MEDFileEquivalenceCell *ret(self->getCell());
988 if(ret) ret->incrRef();
992 MEDFileEquivalenceNode *getNode()
994 MEDFileEquivalenceNode *ret(self->getNode());
995 if(ret) ret->incrRef();
1001 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
1004 MEDFileEquivalences();
1007 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
1008 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
1009 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
1013 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
1015 MEDFileEquivalencePair *ret(self->getEquivalence(i));
1016 if(ret) ret->incrRef();
1019 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
1021 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
1022 if(ret) ret->incrRef();
1026 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
1028 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
1029 if(ret) ret->incrRef();
1035 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
1038 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1039 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1040 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1041 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
1042 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
1043 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
1044 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
1045 void setName(const std::string& name);
1046 std::string getName();
1047 std::string getUnivName() const;
1048 bool getUnivNameWrStatus() const;
1049 void setUnivNameWrStatus(bool newStatus);
1050 void setDescription(const std::string& name);
1051 std::string getDescription() const;
1052 void setOrder(int order);
1053 int getOrder() const;
1054 void setIteration(int it);
1056 void setTimeValue(double time);
1057 void setTime(int dt, int it, double time);
1058 double getTimeValue() const;
1059 void setTimeUnit(const std::string& unit);
1060 std::string getTimeUnit() const;
1061 void setAxisType(MEDCouplingAxisType at);
1062 MEDCouplingAxisType getAxisType() const;
1063 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
1064 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1065 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
1066 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1067 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
1068 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
1069 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1070 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1071 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1072 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
1073 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
1074 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
1075 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1076 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1078 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
1079 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
1080 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1081 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1082 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1083 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1084 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1085 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1086 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1087 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1088 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1089 void clearFamMap() throw(INTERP_KERNEL::Exception);
1090 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1091 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1092 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1093 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1094 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1095 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1096 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1097 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1098 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1099 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1100 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1101 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1102 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1103 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1104 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1105 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1106 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1107 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1108 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1109 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1110 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1111 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1112 static std::string GetMagicFamilyStr();
1113 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1114 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1115 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1116 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1117 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1118 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1119 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1120 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1121 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1122 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1123 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1124 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1125 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1126 void setFamilyInfo(const std::map<std::string,int>& info);
1127 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1128 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1129 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1130 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1131 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1132 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1133 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1134 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1135 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1136 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1137 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1138 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1139 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1140 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1141 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1142 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1143 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1144 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1145 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1146 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1147 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1149 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1150 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1151 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1152 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1153 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr) throw(INTERP_KERNEL::Exception);
1154 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1155 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1156 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1157 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1158 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1159 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1160 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1161 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1162 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1163 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1164 int getNumberOfJoints();
1165 MEDFileJoints *getJoints();
1166 void setJoints( MEDFileJoints* joints );
1167 void initializeEquivalences();
1168 void killEquivalences();
1169 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1170 void killStructureElements() throw(INTERP_KERNEL::Exception);
1173 std::string __str__() const throw(INTERP_KERNEL::Exception)
1175 return self->simpleRepr();
1178 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1180 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1183 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1186 double tmp0=self->getTime(tmp1,tmp2);
1187 PyObject *res = PyList_New(3);
1188 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1189 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1190 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1194 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1197 bool ret0=self->isEqual(other,eps,what);
1198 PyObject *res=PyList_New(2);
1199 PyObject *ret0Py=ret0?Py_True:Py_False;
1201 PyList_SetItem(res,0,ret0Py);
1202 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1206 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1208 std::vector<const DataArrayInt *> grps;
1209 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1210 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1213 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1216 bool ret0=self->areFamsEqual(other,what);
1217 PyObject *res=PyList_New(2);
1218 PyObject *ret0Py=ret0?Py_True:Py_False;
1220 PyList_SetItem(res,0,ret0Py);
1221 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1225 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1228 bool ret0=self->areGrpsEqual(other,what);
1229 PyObject *res=PyList_New(2);
1230 PyObject *ret0Py=ret0?Py_True:Py_False;
1232 PyList_SetItem(res,0,ret0Py);
1233 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1237 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1239 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1240 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1241 PyObject *res=PyList_New(result.size());
1242 for(int i=0;iL!=result.end(); i++, iL++)
1243 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1247 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1249 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1250 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1251 PyObject *res=PyList_New(result.size());
1252 for(int i=0;iL!=result.end(); i++, iL++)
1253 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1257 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1259 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1262 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1265 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1267 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1270 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1273 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1275 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1278 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1281 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1283 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1286 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1289 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1291 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1294 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1297 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1300 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1301 PyObject *ret=PyTuple_New(2);
1302 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1303 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1307 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1309 DataArrayInt *ret3=0;
1310 std::vector<int> ret1,ret2;
1311 bool ret0=self->unPolyze(ret1,ret2,ret3);
1312 PyObject *ret=PyTuple_New(4);
1313 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1315 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1316 for(int j=0;j<(int)ret1.size()/3;j++)
1318 PyObject *retLev2=PyList_New(3);
1319 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1320 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1321 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1322 PyList_SetItem(retLev1_0,j,retLev2);
1324 PyTuple_SetItem(ret,1,retLev1_0);
1326 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1327 for(int j=0;j<(int)ret2.size()/3;j++)
1329 PyObject *retLev2=PyList_New(3);
1330 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1331 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1332 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1333 PyList_SetItem(retLev1_1,j,retLev2);
1335 PyTuple_SetItem(ret,2,retLev1_1);
1337 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1341 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1343 MEDFileEquivalences *ret(self->getEquivalences());
1344 if(ret) ret->incrRef();
1348 virtual DataArrayInt *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1350 MCAuto<DataArrayInt> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1356 class MEDFileUMesh : public MEDFileMesh
1359 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1360 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1361 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1362 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1363 static MEDFileUMesh *New();
1364 static const char *GetSpeStr4ExtMesh();
1366 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1367 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1368 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1369 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1370 void clearNodeAndCellNumbers();
1372 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1373 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1374 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1375 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1376 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1377 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1378 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1379 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1380 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1381 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1383 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1384 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1385 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1386 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1387 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1388 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1389 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1390 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1391 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1392 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1393 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1394 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1395 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1396 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1397 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1400 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1402 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1405 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1407 return MEDFileUMesh::New(fileName,mrs);
1410 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1412 return MEDFileUMesh::New(mem);
1415 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1417 return MEDFileUMesh::New(db);
1422 return MEDFileUMesh::New();
1426 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1428 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1431 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)
1433 std::vector<int> typesCpp1;
1434 convertPyToNewIntArr3(types,typesCpp1);
1435 std::size_t sz(typesCpp1.size());
1436 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1437 for(std::size_t ii=0;ii<sz;ii++)
1438 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1439 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1442 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1443 {// put an empty dict in input to say to __new__ to call __init__...
1444 PyObject *ret(PyTuple_New(1));
1445 PyObject *ret0(PyDict_New());
1446 PyTuple_SetItem(ret,0,ret0);
1450 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1452 std::vector<double> a0;
1453 std::vector<int> a1;
1454 std::vector<std::string> a2;
1455 std::vector< MCAuto<DataArrayInt> > a3;
1456 MCAuto<DataArrayDouble> a4;
1457 self->serialize(a0,a1,a2,a3,a4);
1458 PyObject *ret(PyTuple_New(5));
1459 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1460 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1462 PyObject *ret2(PyList_New(sz));
1463 for(int i=0;i<sz;i++)
1464 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1465 PyTuple_SetItem(ret,2,ret2);
1467 PyObject *ret3(PyList_New(sz));
1468 for(int i=0;i<sz;i++)
1470 DataArrayInt *elt(a3[i]);
1473 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1475 PyTuple_SetItem(ret,3,ret3);
1476 DataArrayDouble *ret4(a4);
1479 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1483 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1485 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1486 if(!PyTuple_Check(inp))
1487 throw INTERP_KERNEL::Exception(MSG);
1488 int sz(PyTuple_Size(inp));
1490 throw INTERP_KERNEL::Exception(MSG);
1491 std::vector<double> a0;
1492 std::vector<int> a1;
1493 std::vector<std::string> a2;
1494 std::vector< MCAuto<DataArrayInt> > a3;
1495 MCAuto<DataArrayDouble> a4;
1497 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1499 fillArrayWithPyListDbl3(a0py,tmp,a0);
1500 convertPyToNewIntArr3(a1py,a1);
1501 fillStringVector(a2py,a2);
1503 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1505 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1506 if(!SWIG_IsOK(status))
1507 throw INTERP_KERNEL::Exception(MSG);
1508 a4=reinterpret_cast<DataArrayDouble *>(argp);
1509 if((DataArrayDouble *)a4)
1512 std::vector< DataArrayInt * > a3Tmp;
1513 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1514 std::size_t sz(a3Tmp.size());
1516 for(std::size_t i=0;i<sz;i++)
1520 a3Tmp[i]->incrRef();
1522 self->unserialize(a0,a1,a2,a3,a4);
1526 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1529 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1530 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1533 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1536 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1539 self->setMeshAtLevel(meshDimRelToMax,m1);
1542 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1545 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1547 self->removeMeshAtLevel(meshDimRelToMax);
1550 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1552 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1554 DataArrayDouble *a,*a2;
1555 DataArrayDoubleTuple *aa,*aa2;
1556 std::vector<double> bb,bb2;
1558 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1559 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1560 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1564 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1566 std::vector<const MEDFileUMesh *> meshesCpp;
1567 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1568 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1572 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1574 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1575 return convertVecPairIntToPy(ret);
1578 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1580 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1581 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1582 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1585 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1587 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1588 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1589 return self->extractPart(extractDefCpp);
1592 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1594 std::vector<const MEDCouplingUMesh *> ms;
1595 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1596 self->setMeshes(ms,renum);
1599 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1601 std::vector<const MEDCouplingUMesh *> ms;
1602 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1603 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1606 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1608 std::vector<const MEDCouplingUMesh *> ms;
1609 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1610 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1613 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1615 DataArrayDouble *ret=self->getCoords();
1621 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1623 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1626 return const_cast<PartDefinition *>(ret);
1629 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1631 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1632 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1633 PyObject *ret=PyTuple_New(3);
1634 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1635 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1636 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1640 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1642 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1648 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1650 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1651 std::size_t sz(tmp.size());
1652 PyObject *ret=PyList_New(sz);
1653 for(std::size_t i=0;i<sz;i++)
1657 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1664 class MEDFileStructuredMesh : public MEDFileMesh
1669 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1671 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1679 class MEDFileCMesh : public MEDFileStructuredMesh
1682 static MEDFileCMesh *New();
1683 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1684 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1685 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1686 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1687 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1692 return MEDFileCMesh::New();
1695 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1697 return MEDFileCMesh::New(fileName,mrs);
1700 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1702 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1705 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1707 return MEDFileCMesh::New(db);
1711 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1713 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1716 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1718 const MEDCouplingCMesh *tmp=self->getMesh();
1721 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1726 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1729 static MEDFileCurveLinearMesh *New();
1730 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1731 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1732 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1733 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1736 MEDFileCurveLinearMesh()
1738 return MEDFileCurveLinearMesh::New();
1741 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1743 return MEDFileCurveLinearMesh::New(fileName,mrs);
1746 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1748 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1751 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1753 return MEDFileCurveLinearMesh::New(db);
1757 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1759 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1762 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1764 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1767 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1772 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1775 static MEDFileMeshMultiTS *New();
1776 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1777 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1778 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1779 std::string getName() const throw(INTERP_KERNEL::Exception);
1780 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1781 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1784 MEDFileMeshMultiTS()
1786 return MEDFileMeshMultiTS::New();
1789 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1791 return MEDFileMeshMultiTS::New(fileName);
1794 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1796 return MEDFileMeshMultiTS::New(fileName,mName);
1799 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1801 MEDFileMesh *ret=self->getOneTimeStep();
1809 class MEDFileMeshesIterator
1814 PyObject *next() throw(INTERP_KERNEL::Exception)
1816 MEDFileMesh *ret=self->nextt();
1820 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1824 PyErr_SetString(PyExc_StopIteration,"No more data.");
1831 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1834 static MEDFileMeshes *New();
1835 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1836 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1837 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1838 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1840 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1841 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1842 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1843 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1844 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1845 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1846 void killStructureElements() throw(INTERP_KERNEL::Exception);
1851 return MEDFileMeshes::New();
1854 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1856 return MEDFileMeshes::New(fileName);
1859 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1861 return MEDFileMeshes::New(db);
1865 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1867 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1870 std::string __str__() const throw(INTERP_KERNEL::Exception)
1872 return self->simpleRepr();
1875 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1877 if(PyInt_Check(obj))
1879 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1884 else if(PyString_Check(obj))
1886 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1892 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1895 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1897 self->setMeshAtPos(obj,mesh);
1901 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1903 return self->iterator();
1906 int __len__() const throw(INTERP_KERNEL::Exception)
1908 return self->getNumberOfMeshes();
1911 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1913 MEDFileMesh *ret=self->getMeshAtPos(i);
1918 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1920 MEDFileMesh *ret=self->getMeshWithName(mname);
1928 class MEDFileFieldLoc : public RefCountObject
1931 std::string getName() const;
1932 int getDimension() const;
1933 int getNumberOfGaussPoints() const;
1934 int getNumberOfPointsInCells() const;
1935 const std::vector<double>& getRefCoords() const;
1936 const std::vector<double>& getGaussCoords() const;
1937 const std::vector<double>& getGaussWeights() const;
1938 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1941 std::string __str__() const throw(INTERP_KERNEL::Exception)
1943 return self->repr();
1948 class MEDFileFieldGlobsReal
1951 void resetContent();
1952 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1953 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1954 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1955 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1956 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1957 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1958 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1959 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1960 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1961 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1962 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1963 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1964 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1965 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1966 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1967 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1968 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1969 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1970 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1971 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1972 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1973 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1974 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1975 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1976 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1977 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1978 void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
1981 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1983 const DataArrayInt *ret=self->getProfile(pflName);
1986 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1989 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1991 const DataArrayInt *ret=self->getProfileFromId(pflId);
1994 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1997 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1999 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
2002 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2005 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
2007 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
2010 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2013 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
2015 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
2016 return convertVecPairVecStToPy(ret);
2019 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
2021 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
2022 return convertVecPairVecStToPy(ret);
2025 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2027 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2028 self->changePflsNames(v);
2031 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
2033 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2034 self->changePflsRefsNamesGen(v);
2037 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2039 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2040 self->changePflsNamesInStruct(v);
2043 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2045 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2046 self->changeLocsNames(v);
2049 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
2051 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2052 self->changeLocsRefsNamesGen(v);
2055 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2057 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2058 self->changeLocsNamesInStruct(v);
2061 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
2063 std::ostringstream oss;
2064 self->simpleReprGlobs(oss);
2070 class MEDFileEntities
2075 static MEDFileEntities *BuildFrom(PyObject *entities) throw(INTERP_KERNEL::Exception)
2077 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2078 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2080 std::size_t sz(inp0.size());
2082 for(std::size_t i=0;i<sz;i++)
2083 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2085 return MEDFileEntities::BuildFrom(&inp);
2092 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2095 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2096 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2097 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2098 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
2099 void loadArrays() throw(INTERP_KERNEL::Exception);
2100 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2101 void unloadArrays() throw(INTERP_KERNEL::Exception);
2102 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2103 int getDimension() const throw(INTERP_KERNEL::Exception);
2104 int getIteration() const throw(INTERP_KERNEL::Exception);
2105 int getOrder() const throw(INTERP_KERNEL::Exception);
2106 std::string getName() throw(INTERP_KERNEL::Exception);
2107 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2108 std::string getMeshName() throw(INTERP_KERNEL::Exception);
2109 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2110 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2111 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2112 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2113 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2114 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2115 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2116 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2117 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2118 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2119 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2120 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2121 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2124 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2127 double tmp0=self->getTime(tmp1,tmp2);
2128 PyObject *res = PyList_New(3);
2129 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2130 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2131 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2135 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2137 std::pair<int,int> res=self->getDtIt();
2138 PyObject *elt=PyTuple_New(2);
2139 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2140 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2144 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2146 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2149 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2151 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2154 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2156 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2157 return self->changeMeshNames(modifTab);
2160 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2162 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2163 PyObject *ret2=PyList_New(ret.size());
2164 for(int i=0;i<(int)ret.size();i++)
2165 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2169 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2171 std::vector<int> ret1;
2172 int ret0=self->getNonEmptyLevels(mname,ret1);
2173 PyObject *elt=PyTuple_New(2);
2174 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2175 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2179 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2181 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2182 std::vector< std::vector<TypeOfField> > typesF;
2183 std::vector< std::vector<std::string> > pfls;
2184 std::vector< std::vector<std::string> > locs;
2185 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2187 PyObject *ret2=PyList_New(sz);
2188 for(int i=0;i<sz;i++)
2190 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2191 const std::vector<TypeOfField>& typesFI=typesF[i];
2192 const std::vector<std::string>& pflsI=pfls[i];
2193 const std::vector<std::string>& locsI=locs[i];
2194 PyObject *elt=PyTuple_New(2);
2195 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2196 int sz2=ret[i].size();
2197 PyObject *elt2=PyList_New(sz2);
2198 for(int j=0;j<sz2;j++)
2200 PyObject *elt3=PyTuple_New(4);
2201 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2202 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));
2203 PyTuple_SetItem(elt3,1,elt4);
2204 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2205 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2206 PyList_SetItem(elt2,j,elt3);
2208 PyTuple_SetItem(elt,1,elt2);
2209 PyList_SetItem(ret2,i,elt);
2214 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2216 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2217 std::size_t sz=ret.size();
2218 PyObject *retPy=PyList_New(sz);
2219 for(std::size_t i=0;i<sz;i++)
2220 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2224 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2226 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2227 std::size_t sz=ret.size();
2228 PyObject *retPy=PyList_New(sz);
2229 for(std::size_t i=0;i<sz;i++)
2230 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2234 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2236 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2237 std::size_t sz=ret.size();
2238 PyObject *retPy=PyList_New(sz);
2239 for(std::size_t i=0;i<sz;i++)
2240 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2244 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2246 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2247 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2248 return self->extractPart(extractDefCpp,mm);
2253 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2256 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2257 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2258 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2259 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2260 static MEDFileField1TS *New();
2261 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2262 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2263 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2264 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2265 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2266 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2267 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2269 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2270 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2271 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2272 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2275 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2277 return MEDFileField1TS::New(fileName,loadAll);
2280 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2282 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2285 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2287 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2290 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2292 return MEDFileField1TS::New(db);
2297 return MEDFileField1TS::New();
2301 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2303 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2306 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2308 const DataArrayDouble *arr=0;
2310 arr=field->getArray();
2311 self->copyTinyInfoFrom(field,arr);
2314 std::string __str__() const throw(INTERP_KERNEL::Exception)
2316 return self->simpleRepr();
2319 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2321 DataArrayInt *ret1=0;
2322 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2323 PyObject *ret=PyTuple_New(2);
2324 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2325 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2329 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2331 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2332 std::vector< std::vector<TypeOfField> > typesF;
2333 std::vector< std::vector<std::string> > pfls;
2334 std::vector< std::vector<std::string> > locs;
2335 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2337 PyObject *ret2=PyList_New(sz);
2338 for(int i=0;i<sz;i++)
2340 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2341 const std::vector<TypeOfField>& typesFI=typesF[i];
2342 const std::vector<std::string>& pflsI=pfls[i];
2343 const std::vector<std::string>& locsI=locs[i];
2344 PyObject *elt=PyTuple_New(2);
2345 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2346 int sz2=ret[i].size();
2347 PyObject *elt2=PyList_New(sz2);
2348 for(int j=0;j<sz2;j++)
2350 PyObject *elt3=PyTuple_New(4);
2351 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2352 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2353 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2354 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2355 PyList_SetItem(elt2,j,elt3);
2357 PyTuple_SetItem(elt,1,elt2);
2358 PyList_SetItem(ret2,i,elt);
2363 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2365 DataArrayDouble *ret=self->getUndergroundDataArray();
2371 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2373 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2374 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2377 PyObject *ret=PyTuple_New(2);
2378 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2379 std::size_t sz=elt1Cpp.size();
2380 PyObject *elt=PyList_New(sz);
2381 for(std::size_t i=0;i<sz;i++)
2383 PyObject *elt1=PyTuple_New(2);
2384 PyObject *elt2=PyTuple_New(2);
2385 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2386 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2387 PyObject *elt3=PyTuple_New(2);
2388 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2389 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2390 PyTuple_SetItem(elt1,0,elt2);
2391 PyTuple_SetItem(elt1,1,elt3);
2392 PyList_SetItem(elt,i,elt1);
2394 PyTuple_SetItem(ret,1,elt);
2400 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2403 static MEDFileIntField1TS *New();
2404 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2405 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2406 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2407 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2408 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2410 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2411 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2412 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2413 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2414 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2415 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2416 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2417 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2420 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2422 return MEDFileIntField1TS::New();
2425 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2427 return MEDFileIntField1TS::New(fileName,loadAll);
2430 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2432 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2435 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2437 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2440 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2442 return MEDFileIntField1TS::New(db);
2446 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2448 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2451 std::string __str__() const throw(INTERP_KERNEL::Exception)
2453 return self->simpleRepr();
2456 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2458 DataArrayInt *ret1=0;
2459 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2460 PyObject *ret=PyTuple_New(2);
2461 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2462 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2466 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2468 DataArrayInt *ret=self->getUndergroundDataArray();
2476 class MEDFileAnyTypeFieldMultiTSIterator
2481 PyObject *next() throw(INTERP_KERNEL::Exception)
2483 MEDFileAnyTypeField1TS *ret=self->nextt();
2485 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2488 PyErr_SetString(PyExc_StopIteration,"No more data.");
2495 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2498 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2499 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2500 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2501 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2502 std::string getName() const throw(INTERP_KERNEL::Exception);
2503 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2504 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2505 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2506 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2507 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2508 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2509 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2510 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2511 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2512 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2513 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2514 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2515 void loadArrays() throw(INTERP_KERNEL::Exception);
2516 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2517 void unloadArrays() throw(INTERP_KERNEL::Exception);
2518 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2520 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2521 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2522 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2523 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2524 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2525 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2528 int __len__() const throw(INTERP_KERNEL::Exception)
2530 return self->getNumberOfTS();
2533 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2535 if(elt0 && PyInt_Check(elt0))
2537 int pos=PyInt_AS_LONG(elt0);
2540 else if(elt0 && PyTuple_Check(elt0))
2542 if(PyTuple_Size(elt0)==2)
2544 PyObject *o0=PyTuple_GetItem(elt0,0);
2545 PyObject *o1=PyTuple_GetItem(elt0,1);
2546 if(PyInt_Check(o0) && PyInt_Check(o1))
2548 int iter=PyInt_AS_LONG(o0);
2549 int order=PyInt_AS_LONG(o1);
2550 return self->getPosOfTimeStep(iter,order);
2553 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 !");
2556 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 !");
2558 else if(elt0 && PyFloat_Check(elt0))
2560 double val=PyFloat_AS_DOUBLE(elt0);
2561 return self->getPosGivenTime(val);
2564 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2567 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2569 std::vector< std::pair<int,int> > res(self->getIterations());
2570 return convertVecPairIntToPy(res);
2573 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2575 std::vector<double> ret1;
2576 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2577 std::size_t sz=ret.size();
2578 PyObject *ret2=PyList_New(sz);
2579 for(std::size_t i=0;i<sz;i++)
2581 PyObject *elt=PyTuple_New(3);
2582 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2583 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2584 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2585 PyList_SetItem(ret2,i,elt);
2590 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2592 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2593 PyObject *ret2=PyList_New(ret.size());
2594 for(int i=0;i<(int)ret.size();i++)
2596 const std::vector<TypeOfField>& rett=ret[i];
2597 PyObject *ret3=PyList_New(rett.size());
2598 for(int j=0;j<(int)rett.size();j++)
2599 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2600 PyList_SetItem(ret2,i,ret3);
2605 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2607 std::vector<int> ret1;
2608 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2609 PyObject *elt=PyTuple_New(2);
2610 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2611 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2615 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2617 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2618 std::vector< std::vector<TypeOfField> > typesF;
2619 std::vector< std::vector<std::string> > pfls;
2620 std::vector< std::vector<std::string> > locs;
2621 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2623 PyObject *ret2=PyList_New(sz);
2624 for(int i=0;i<sz;i++)
2626 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2627 const std::vector<TypeOfField>& typesFI=typesF[i];
2628 const std::vector<std::string>& pflsI=pfls[i];
2629 const std::vector<std::string>& locsI=locs[i];
2630 PyObject *elt=PyTuple_New(2);
2631 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2632 int sz2=ret[i].size();
2633 PyObject *elt2=PyList_New(sz2);
2634 for(int j=0;j<sz2;j++)
2636 PyObject *elt3=PyTuple_New(4);
2637 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2638 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));
2639 PyTuple_SetItem(elt3,1,elt4);
2640 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2641 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2642 PyList_SetItem(elt2,j,elt3);
2644 PyTuple_SetItem(elt,1,elt2);
2645 PyList_SetItem(ret2,i,elt);
2650 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2652 if(PyList_Check(elts))
2654 int sz=PyList_Size(elts);
2655 std::vector<int> ret(sz);
2656 for(int i=0;i<sz;i++)
2658 PyObject *elt=PyList_GetItem(elts,i);
2659 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2665 std::vector<int> ret(1);
2666 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2671 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2673 if(PySlice_Check(elts))
2675 Py_ssize_t strt=2,stp=2,step=2;
2676 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2677 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2678 self->eraseTimeStepIds2(strt,stp,step);
2682 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2683 if(!idsToRemove.empty())
2684 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2688 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2692 std::vector<int> pos2;
2693 DataArrayInt *pos3=0;
2694 DataArrayIntTuple *pos4=0;
2695 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2700 self->eraseTimeStepIds(&pos1,&pos1+1);
2707 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2712 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2716 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2720 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2722 return self->iterator();
2725 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2727 if(elt0 && PyList_Check(elt0))
2729 int sz=PyList_Size(elt0);
2730 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2731 int *pt=da->getPointer();
2732 for(int i=0;i<sz;i++,pt++)
2734 PyObject *elt1=PyList_GetItem(elt0,i);
2735 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2737 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2739 else if(elt0 && PySlice_Check(elt0))
2741 Py_ssize_t strt=2,stp=2,step=2;
2742 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2743 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2744 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2747 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2750 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2752 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2753 return self->changeMeshNames(modifTab);
2756 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2758 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2759 std::size_t sz=ret.size();
2760 PyObject *retPy=PyList_New(sz);
2761 for(std::size_t i=0;i<sz;i++)
2762 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2766 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2768 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2769 std::size_t sz=ret.size();
2770 PyObject *retPy=PyList_New(sz);
2771 for(std::size_t i=0;i<sz;i++)
2772 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2776 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2778 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2779 std::size_t sz=ret.size();
2780 PyObject *retPy=PyList_New(sz);
2781 for(std::size_t i=0;i<sz;i++)
2782 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2786 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2789 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2790 if(SWIG_IsOK(status))
2792 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2796 std::vector<MEDFileAnyTypeField1TS *> tmp;
2797 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2798 self->pushBackTimeSteps(tmp);
2802 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2804 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2805 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2806 return self->extractPart(extractDefCpp,mm);
2809 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2811 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2812 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2813 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2814 std::size_t sz=ret.size();
2815 PyObject *retPy=PyList_New(sz);
2816 for(std::size_t i=0;i<sz;i++)
2818 std::size_t sz2=ret[i].size();
2819 PyObject *ret1Py=PyList_New(sz2);
2820 for(std::size_t j=0;j<sz2;j++)
2822 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2825 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2827 PyList_SetItem(retPy,i,ret1Py);
2832 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2834 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2835 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2836 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2837 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2838 if(ret2.size()!=ret.size())
2840 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2841 throw INTERP_KERNEL::Exception(oss.str().c_str());
2843 std::size_t sz=ret.size();
2844 PyObject *retPy=PyList_New(sz);
2845 for(std::size_t i=0;i<sz;i++)
2847 std::size_t sz2=ret[i].size();
2848 PyObject *ret0Py=PyTuple_New(2);
2849 PyObject *ret1Py=PyList_New(sz2);
2850 for(std::size_t j=0;j<sz2;j++)
2852 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2855 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2857 PyTuple_SetItem(ret0Py,0,ret1Py);
2858 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2859 PyList_SetItem(retPy,i,ret0Py);
2866 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2869 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2870 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2871 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2872 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2874 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2875 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2876 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2877 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2878 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2879 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2881 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2882 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2883 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2886 MEDFileFieldMultiTS()
2888 return MEDFileFieldMultiTS::New();
2891 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2893 return MEDFileFieldMultiTS::New(fileName,loadAll);
2896 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2898 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2901 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2903 return MEDFileFieldMultiTS::New(db);
2907 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2909 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2912 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2914 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2915 std::size_t sz(tmp.size());
2916 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2917 for(std::size_t i=0;i<sz;i++)
2919 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2920 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2922 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2925 std::string __str__() const throw(INTERP_KERNEL::Exception)
2927 return self->simpleRepr();
2930 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2932 DataArrayInt *ret1=0;
2933 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2934 PyObject *ret=PyTuple_New(2);
2935 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2936 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2940 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2942 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2943 std::vector< std::vector<TypeOfField> > typesF;
2944 std::vector< std::vector<std::string> > pfls;
2945 std::vector< std::vector<std::string> > locs;
2946 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2948 PyObject *ret2=PyList_New(sz);
2949 for(int i=0;i<sz;i++)
2951 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2952 const std::vector<TypeOfField>& typesFI=typesF[i];
2953 const std::vector<std::string>& pflsI=pfls[i];
2954 const std::vector<std::string>& locsI=locs[i];
2955 PyObject *elt=PyTuple_New(2);
2956 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2957 int sz2=ret[i].size();
2958 PyObject *elt2=PyList_New(sz2);
2959 for(int j=0;j<sz2;j++)
2961 PyObject *elt3=PyTuple_New(4);
2962 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2963 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2964 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2965 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2966 PyList_SetItem(elt2,j,elt3);
2968 PyTuple_SetItem(elt,1,elt2);
2969 PyList_SetItem(ret2,i,elt);
2973 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2975 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2981 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2983 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2984 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2987 PyObject *ret=PyTuple_New(2);
2988 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2989 std::size_t sz=elt1Cpp.size();
2990 PyObject *elt=PyList_New(sz);
2991 for(std::size_t i=0;i<sz;i++)
2993 PyObject *elt1=PyTuple_New(2);
2994 PyObject *elt2=PyTuple_New(2);
2995 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2996 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2997 PyObject *elt3=PyTuple_New(2);
2998 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2999 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
3000 PyTuple_SetItem(elt1,0,elt2);
3001 PyTuple_SetItem(elt1,1,elt3);
3002 PyList_SetItem(elt,i,elt1);
3004 PyTuple_SetItem(ret,1,elt);
3010 class MEDFileFieldsIterator
3015 PyObject *next() throw(INTERP_KERNEL::Exception)
3017 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3019 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3022 PyErr_SetString(PyExc_StopIteration,"No more data.");
3029 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3032 static MEDFileIntFieldMultiTS *New();
3033 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3034 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3035 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3037 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
3038 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
3039 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
3040 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
3041 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3042 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3043 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3044 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3045 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3048 MEDFileIntFieldMultiTS()
3050 return MEDFileIntFieldMultiTS::New();
3053 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3055 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
3058 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3060 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
3063 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3065 return MEDFileIntFieldMultiTS::New(db);
3069 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3071 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
3074 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3076 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3077 std::size_t sz(tmp.size());
3078 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3079 for(std::size_t i=0;i<sz;i++)
3081 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3082 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3084 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3087 std::string __str__() const throw(INTERP_KERNEL::Exception)
3089 return self->simpleRepr();
3092 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3094 DataArrayInt *ret1=0;
3095 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3096 PyObject *ret=PyTuple_New(2);
3097 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3098 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3102 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3104 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3112 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3115 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3116 std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3119 MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3121 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3122 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3130 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3133 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3135 MEDFileStructureElements();
3138 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3141 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3142 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3143 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3144 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
3145 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3146 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3147 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3148 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3149 void loadArrays() throw(INTERP_KERNEL::Exception);
3150 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3151 void unloadArrays() throw(INTERP_KERNEL::Exception);
3152 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3153 int getNumberOfFields() const;
3154 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3155 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3157 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3158 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3159 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3160 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3161 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3162 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3163 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3164 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3165 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3166 void killStructureElements() throw(INTERP_KERNEL::Exception);
3167 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3168 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3169 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3170 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3171 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3176 return MEDFileFields::New();
3179 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3181 return MEDFileFields::New(fileName,loadAll);
3184 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3186 return MEDFileFields::New(db);
3189 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
3191 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3195 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3197 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3200 std::string __str__() const throw(INTERP_KERNEL::Exception)
3202 return self->simpleRepr();
3205 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3207 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3211 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3213 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3217 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3219 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3220 std::size_t sz(tmp.size());
3221 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3222 for(std::size_t i=0;i<sz;i++)
3224 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3225 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3227 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3230 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3232 std::vector< std::pair<std::string,std::string> > ps;
3233 self->getMeshSENames(ps);
3234 return convertVectPairStToPy(ps);
3237 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3240 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3241 PyObject *ret=PyTuple_New(2);
3242 PyObject *ret_0=PyList_New(ret0.size());
3244 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3246 PyObject *elt=PyTuple_New(2);
3247 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3248 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3249 PyList_SetItem(ret_0,rk,elt);
3251 PyTuple_SetItem(ret,0,ret_0);
3252 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3253 PyTuple_SetItem(ret,1,ret_1);
3257 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3259 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3260 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3263 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3265 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3266 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3269 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3271 if(obj && PyList_Check(obj))
3273 int sz=PyList_Size(obj);
3274 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3275 int *pt=da->getPointer();
3276 for(int i=0;i<sz;i++,pt++)
3278 PyObject *elt1=PyList_GetItem(obj,i);
3279 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3281 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3284 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3287 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3289 self->setFieldAtPos(obj,field);
3293 int __len__() const throw(INTERP_KERNEL::Exception)
3295 return self->getNumberOfFields();
3298 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3300 return self->iterator();
3303 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3305 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3306 return self->changeMeshNames(modifTab);
3309 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3311 if(elt0 && PyInt_Check(elt0))
3313 return PyInt_AS_LONG(elt0);
3315 else if(elt0 && PyString_Check(elt0))
3316 return self->getPosFromFieldName(PyString_AsString(elt0));
3318 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3321 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3323 if(PyList_Check(elts))
3325 int sz=PyList_Size(elts);
3326 std::vector<int> ret(sz);
3327 for(int i=0;i<sz;i++)
3329 PyObject *elt=PyList_GetItem(elts,i);
3330 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3336 std::vector<int> ret(1);
3337 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3342 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3344 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3345 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3346 self->pushFields(tmp);
3349 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3351 if(elts && PySlice_Check(elts))
3353 Py_ssize_t strt=2,stp=2,step=2;
3354 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3355 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3356 self->destroyFieldsAtPos2(strt,stp,step);
3360 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3361 if(!idsToRemove.empty())
3362 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3366 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3368 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3369 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3370 return self->extractPart(extractDefCpp,mm);
3375 class MEDFileParameter1TS : public RefCountObject
3378 void setIteration(int it);
3379 int getIteration() const;
3380 void setOrder(int order);
3381 int getOrder() const;
3382 void setTimeValue(double time);
3383 void setTime(int dt, int it, double time);
3384 double getTime(int& dt, int& it);
3385 double getTimeValue() const;
3388 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3391 void setValue(double val) throw(INTERP_KERNEL::Exception);
3392 double getValue() const throw(INTERP_KERNEL::Exception);
3393 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3396 std::string __str__() const throw(INTERP_KERNEL::Exception)
3398 return self->simpleRepr();
3403 class MEDFileParameterTinyInfo : public MEDFileWritable
3406 void setDescription(const std::string& name);
3407 std::string getDescription() const;
3408 void setTimeUnit(const std::string& unit);
3409 std::string getTimeUnit() const;
3412 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3415 static MEDFileParameterDouble1TS *New();
3416 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3417 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3418 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3419 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3420 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3421 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3422 std::string getName() const throw(INTERP_KERNEL::Exception);
3423 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3426 MEDFileParameterDouble1TS()
3428 return MEDFileParameterDouble1TS::New();
3431 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3433 return MEDFileParameterDouble1TS::New(fileName);
3436 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3438 return MEDFileParameterDouble1TS::New(fileName,paramName);
3441 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3443 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3446 std::string __str__() const throw(INTERP_KERNEL::Exception)
3448 return self->simpleRepr();
3451 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3454 bool ret0=self->isEqual(other,eps,what);
3455 PyObject *res=PyList_New(2);
3456 PyObject *ret0Py=ret0?Py_True:Py_False;
3458 PyList_SetItem(res,0,ret0Py);
3459 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3465 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3468 static MEDFileParameterMultiTS *New();
3469 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3470 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3471 std::string getName() const;
3472 void setName(const std::string& name);
3473 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3474 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3475 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3476 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3477 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3478 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3479 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3480 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3483 MEDFileParameterMultiTS()
3485 return MEDFileParameterMultiTS::New();
3488 MEDFileParameterMultiTS(const std::string& fileName)
3490 return MEDFileParameterMultiTS::New(fileName);
3493 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3495 return MEDFileParameterMultiTS::New(fileName,paramName);
3498 std::string __str__() const throw(INTERP_KERNEL::Exception)
3500 return self->simpleRepr();
3503 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3506 bool ret0=self->isEqual(other,eps,what);
3507 PyObject *res=PyList_New(2);
3508 PyObject *ret0Py=ret0?Py_True:Py_False;
3510 PyList_SetItem(res,0,ret0Py);
3511 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3515 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3519 std::vector<int> pos2;
3520 DataArrayInt *pos3=0;
3521 DataArrayIntTuple *pos4=0;
3522 convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3527 self->eraseTimeStepIds(&pos1,&pos1+1);
3534 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3539 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3543 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3547 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3549 if(elt0 && PyInt_Check(elt0))
3551 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3554 else if(elt0 && PyTuple_Check(elt0))
3556 if(PyTuple_Size(elt0)==2)
3558 PyObject *o0=PyTuple_GetItem(elt0,0);
3559 PyObject *o1=PyTuple_GetItem(elt0,1);
3560 if(PyInt_Check(o0) && PyInt_Check(o1))
3562 int iter=PyInt_AS_LONG(o0);
3563 int order=PyInt_AS_LONG(o1);
3564 return self->getPosOfTimeStep(iter,order);
3567 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 !");
3570 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 !");
3572 else if(elt0 && PyFloat_Check(elt0))
3574 double val=PyFloat_AS_DOUBLE(elt0);
3575 return self->getPosGivenTime(val);
3578 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3581 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3583 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3589 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3591 if(PyList_Check(elts))
3593 int sz=PyList_Size(elts);
3594 std::vector<int> ret(sz);
3595 for(int i=0;i<sz;i++)
3597 PyObject *elt=PyList_GetItem(elts,i);
3598 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3604 std::vector<int> ret(1);
3605 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3610 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3612 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3613 if(!idsToRemove.empty())
3614 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3617 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3619 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3625 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3627 std::vector< std::pair<int,int> > res=self->getIterations();
3628 PyObject *ret=PyList_New(res.size());
3630 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3632 PyObject *elt=PyTuple_New(2);
3633 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3634 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3635 PyList_SetItem(ret,rk,elt);
3640 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3642 std::vector<double> res2;
3643 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3644 PyObject *ret=PyList_New(res.size());
3646 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3648 PyObject *elt=PyTuple_New(3);
3649 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3650 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3651 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3652 PyList_SetItem(ret,rk,elt);
3659 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3662 static MEDFileParameters *New();
3663 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3664 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3665 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3666 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3667 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3668 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3669 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3670 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3671 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3672 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3673 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3678 return MEDFileParameters::New();
3681 MEDFileParameters(const std::string& fileName)
3683 return MEDFileParameters::New(fileName);
3686 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3688 return MEDFileParameters::New(db);
3692 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3694 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3697 std::string __str__() const throw(INTERP_KERNEL::Exception)
3699 return self->simpleRepr();
3702 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3704 if(PyInt_Check(obj))
3706 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3711 else if(PyString_Check(obj))
3713 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3719 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3722 int __len__() const throw(INTERP_KERNEL::Exception)
3724 return self->getNumberOfParams();
3727 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3729 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3735 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3737 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3743 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3746 bool ret0=self->isEqual(other,eps,what);
3747 PyObject *res=PyList_New(2);
3748 PyObject *ret0Py=ret0?Py_True:Py_False;
3750 PyList_SetItem(res,0,ret0Py);
3751 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3757 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3760 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3761 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3762 static MEDFileData *New();
3763 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3764 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3765 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3766 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3767 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3768 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3769 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3771 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3772 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3773 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3774 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3775 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3779 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3781 return MEDFileData::New(fileName);
3784 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3786 return MEDFileData::New(db);
3791 return MEDFileData::New();
3794 std::string __str__() const throw(INTERP_KERNEL::Exception)
3796 return self->simpleRepr();
3799 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3801 MEDFileMeshes *ret=self->getMeshes();
3807 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3809 MEDFileParameters *ret=self->getParams();
3815 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3817 MEDFileFields *ret=self->getFields();
3823 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3825 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3826 return self->changeMeshNames(modifTab);
3829 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3831 std::vector<const MEDFileData *> mfdsCpp;
3832 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3833 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3838 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3840 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3845 class SauvReader : public RefCountObject
3848 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3849 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3852 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3854 return SauvReader::New(fileName);
3859 class SauvWriter : public RefCountObject
3862 static SauvWriter * New();
3863 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3864 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3865 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3866 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3869 SauvWriter() throw(INTERP_KERNEL::Exception)
3871 return SauvWriter::New();
3878 class MEDFileMeshStruct;
3880 class MEDFileField1TSStructItem
3883 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3886 class MEDFileMeshStruct : public RefCountObject
3889 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3891 ~MEDFileMeshStruct();
3894 class MEDMeshMultiLev : public RefCountObject
3897 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3898 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3899 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3905 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3907 DataArrayInt *famIds(0);
3908 bool isWithoutCopy(false);
3909 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3910 PyObject *ret=PyTuple_New(2);
3911 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3913 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3914 PyTuple_SetItem(ret,1,ret1Py);
3918 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3920 DataArrayInt *numIds(0);
3921 bool isWithoutCopy(false);
3922 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3923 PyObject *ret=PyTuple_New(2);
3924 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3926 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3927 PyTuple_SetItem(ret,1,ret1Py);
3931 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3933 DataArrayInt *famIds(0);
3934 bool isWithoutCopy(false);
3935 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3936 PyObject *ret=PyTuple_New(2);
3937 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3939 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3940 PyTuple_SetItem(ret,1,ret1Py);
3944 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3946 DataArrayInt *numIds(0);
3947 bool isWithoutCopy(false);
3948 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3949 PyObject *ret=PyTuple_New(2);
3950 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3952 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3953 PyTuple_SetItem(ret,1,ret1Py);
3957 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3959 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3960 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3961 PyObject *res(PyList_New(result.size()));
3962 for(int i=0;iL!=result.end(); i++, iL++)
3963 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3969 class MEDUMeshMultiLev : public MEDMeshMultiLev
3972 ~MEDUMeshMultiLev();
3976 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3978 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3979 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3980 PyObject *ret0Py=ncc?Py_True:Py_False;
3982 PyObject *ret=PyTuple_New(7);
3983 PyTuple_SetItem(ret,0,ret0Py);
3984 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3985 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3986 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3987 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3988 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3989 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3995 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3998 ~MEDStructuredMeshMultiLev();
4001 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4004 ~MEDCMeshMultiLev();
4008 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4011 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4012 std::size_t sz(objs.size());
4013 PyObject *ret(PyTuple_New(2));
4014 PyObject *ret0=PyList_New(sz);
4015 for(std::size_t i=0;i<sz;i++)
4016 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4017 PyTuple_SetItem(ret,0,ret0);
4018 PyObject *ret1Py(isInternal?Py_True:Py_False);
4020 PyTuple_SetItem(ret,1,ret1Py);
4026 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4029 ~MEDCurveLinearMeshMultiLev();
4033 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4035 DataArrayDouble *ret0(0);
4036 std::vector<int> ret1;
4038 self->buildVTUArrays(ret0,ret1,ret2);
4039 std::size_t sz(ret1.size());
4040 PyObject *ret=PyTuple_New(3);
4041 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4042 PyObject *ret1Py=PyList_New(sz);
4043 for(std::size_t i=0;i<sz;i++)
4044 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
4045 PyTuple_SetItem(ret,1,ret1Py);
4046 PyObject *ret2Py(ret2?Py_True:Py_False);
4048 PyTuple_SetItem(ret,2,ret2Py);
4054 class MEDFileFastCellSupportComparator : public RefCountObject
4057 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
4058 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4059 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4060 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
4062 ~MEDFileFastCellSupportComparator();
4066 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
4068 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4069 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4070 PyObject *res(PyList_New(result.size()));
4071 for(int i=0;iL!=result.end(); i++, iL++)
4072 PyList_SetItem(res,i,PyInt_FromLong(*iL));