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::getAllFamiliesIdsReferenced;
103 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
104 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
105 %newobject MEDCoupling::MEDFileMesh::cartesianize;
106 %newobject MEDCoupling::MEDFileData::getJoints;
107 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
108 %newobject MEDCoupling::MEDFileUMesh::New;
109 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
110 %newobject MEDCoupling::MEDFileUMesh::getCoords;
111 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
112 %newobject MEDCoupling::MEDFileUMesh::getGroup;
113 %newobject MEDCoupling::MEDFileUMesh::getGroups;
114 %newobject MEDCoupling::MEDFileUMesh::getFamily;
115 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
116 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
120 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
121 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
123 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
124 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
125 %newobject MEDCoupling::MEDFileUMesh::extractPart;
126 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
127 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
128 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
129 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
130 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
131 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
132 %newobject MEDCoupling::MEDFileCMesh::New;
133 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
134 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
136 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
137 %newobject MEDCoupling::MEDFileMeshes::New;
138 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
139 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
140 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
141 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
142 %newobject MEDCoupling::MEDFileMeshes::__iter__;
144 %newobject MEDCoupling::MEDFileMeshSupports::New;
145 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
147 %newobject MEDCoupling::MEDFileStructureElements::New;
149 %newobject MEDCoupling::MEDFileFields::New;
150 %newobject MEDCoupling::MEDFileFields::NewAdv;
151 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
152 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
153 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
154 %newobject MEDCoupling::MEDFileFields::deepCopy;
155 %newobject MEDCoupling::MEDFileFields::shallowCpy;
156 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
157 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
158 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
159 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
160 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
161 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
162 %newobject MEDCoupling::MEDFileFields::__iter__;
163 %newobject MEDCoupling::MEDFileFields::extractPart;
165 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
166 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
167 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
168 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
169 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
170 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
173 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
174 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
175 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
176 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
177 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
178 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
179 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
182 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
183 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
184 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
185 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
186 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
187 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
188 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
189 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
190 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
191 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
192 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
194 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
195 %newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
196 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
197 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
198 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
199 %newobject MEDCoupling::MEDFileField1TS::New;
200 %newobject MEDCoupling::MEDFileField1TS::field;
201 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
202 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
203 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
204 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
205 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
206 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
208 %newobject MEDCoupling::MEDFileIntField1TS::New;
209 %newobject MEDCoupling::MEDFileIntField1TS::field;
210 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
211 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
212 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
213 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
214 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
215 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
217 %newobject MEDCoupling::MEDFileData::New;
218 %newobject MEDCoupling::MEDFileData::deepCopy;
219 %newobject MEDCoupling::MEDFileData::getMeshes;
220 %newobject MEDCoupling::MEDFileData::getFields;
221 %newobject MEDCoupling::MEDFileData::getParams;
222 %newobject MEDCoupling::MEDFileData::Aggregate;
224 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
226 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
227 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
228 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
229 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
230 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
231 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
232 %newobject MEDCoupling::MEDFileParameters::New;
233 %newobject MEDCoupling::MEDFileParameters::deepCopy;
234 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
235 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
236 %newobject MEDCoupling::MEDFileParameters::__getitem__;
238 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
239 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
240 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
241 %newobject MEDCoupling::MEDFileJointOneStep::New;
242 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
243 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
244 %newobject MEDCoupling::MEDFileJoint::New;
245 %newobject MEDCoupling::MEDFileJoint::deepCopy;
246 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
247 %newobject MEDCoupling::MEDFileJoints::New;
248 %newobject MEDCoupling::MEDFileJoints::deepCopy;
249 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
250 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
251 %newobject MEDCoupling::MEDFileJoints::__getitem__;
252 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
253 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
254 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
255 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
256 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
257 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
258 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
259 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
260 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
262 %newobject MEDCoupling::SauvWriter::New;
263 %newobject MEDCoupling::SauvReader::New;
264 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
266 %newobject MEDCoupling::MEDFileMeshStruct::New;
267 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
268 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
269 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
270 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
271 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
273 %feature("unref") MEDFileMesh "$this->decrRef();"
274 %feature("unref") MEDFileUMesh "$this->decrRef();"
275 %feature("unref") MEDFileCMesh "$this->decrRef();"
276 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
277 %feature("unref") MEDFileMeshes "$this->decrRef();"
278 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
279 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
280 %feature("unref") MEDFileField1TS "$this->decrRef();"
281 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
282 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
283 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
284 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
285 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
286 %feature("unref") MEDFileStructureElements "$this->decrRef();"
287 %feature("unref") MEDFileFields "$this->decrRef();"
288 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
289 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
290 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
291 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
292 %feature("unref") MEDFileParameters "$this->decrRef();"
293 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
294 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
295 %feature("unref") MEDFileJoint "$this->decrRef();"
296 %feature("unref") MEDFileJoints "$this->decrRef();"
297 %feature("unref") MEDFileEquivalences "$this->decrRef();"
298 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
299 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
300 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
301 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
302 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
303 %feature("unref") MEDFileData "$this->decrRef();"
304 %feature("unref") SauvReader "$this->decrRef();"
305 %feature("unref") SauvWriter "$this->decrRef();"
306 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
307 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
308 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
309 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
310 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
311 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
313 namespace MEDCoupling
316 std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
317 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
318 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
319 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
320 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
321 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
322 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
323 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
324 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
325 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
326 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
327 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
328 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
329 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
330 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
331 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
332 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
333 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
334 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
335 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
336 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
337 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
338 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
339 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
340 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);
341 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);
342 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);
343 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);
344 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
345 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
346 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
347 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
348 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
349 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
352 %rename (MEDFileVersion) MEDFileVersionSwig;
353 %rename (GetFieldIterations) GetFieldIterationsSwig;
354 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
355 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
356 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
357 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
358 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
359 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
360 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
361 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
362 %rename (WriteUMeshes) WriteUMeshesSwig;
363 %rename (GetTypesOfField) GetTypesOfFieldSwig;
364 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
365 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
366 %rename (ReadField) ReadFieldSwig;
370 PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
372 int major,minor,release;
373 MEDCoupling::MEDFileVersion(major,minor,release);
374 PyObject *ret(PyTuple_New(3));
375 PyTuple_SetItem(ret,0,SWIG_From_int(major));
376 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
377 PyTuple_SetItem(ret,2,SWIG_From_int(release));
381 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName) throw(INTERP_KERNEL::Exception)
383 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName));
387 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
389 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName));
393 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
395 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
399 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)
401 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
405 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
407 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
408 PyObject *ret=PyList_New(res.size());
410 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
412 PyObject *elt=PyTuple_New(2);
413 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
414 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
415 PyList_SetItem(ret,rk,elt);
420 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
422 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
423 PyObject *ret=PyList_New(res.size());
425 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
427 PyObject *elt=PyTuple_New(3);
428 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
429 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
430 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
431 PyList_SetItem(ret,rk,elt);
436 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
438 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
439 PyObject *ret=PyList_New(res.size());
441 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
443 PyObject *elt=PyTuple_New(2);
444 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
445 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
446 PyList_SetItem(ret,rk,elt);
451 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
453 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
454 PyObject *ret=PyList_New(res.size());
456 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
458 PyObject *elt=PyTuple_New(2);
459 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
460 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
461 PyList_SetItem(ret,rk,elt);
466 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
468 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
469 PyObject *ret=PyList_New(res.size());
471 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
473 PyObject *elt=PyTuple_New(2);
474 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
475 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
476 PyList_SetItem(ret,rk,elt);
481 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
483 int meshDim,spaceDim,numberOfNodes;
484 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
485 PyObject *ret=PyTuple_New(4);
486 PyObject *elt0=PyList_New(res.size());
488 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
490 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
492 PyObject *elt1=PyList_New(obj2.size());
493 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
495 PyObject *elt2=PyTuple_New(2);
496 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
497 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
498 PyList_SetItem(elt1,j,elt2);
500 PyList_SetItem(elt0,i,elt1);
502 PyTuple_SetItem(ret,0,elt0);
503 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
504 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
505 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
509 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
510 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
512 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
513 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
514 return convertFieldDoubleVecToPy(res);
517 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
519 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
520 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
521 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
524 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
526 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
527 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
528 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
531 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
533 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
534 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
535 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
538 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
540 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
542 PyObject *ret=PyList_New(size);
543 for(int i=0;i<size;i++)
544 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
548 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
550 std::vector<std::string> grps;
551 converPyListToVecString(li,grps);
552 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
555 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
557 std::vector<std::string> fams;
558 converPyListToVecString(li,fams);
559 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
563 namespace MEDCoupling
565 class MEDFileWritable
568 void copyOptionsFrom(const MEDFileWritable& other) const;
569 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
570 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
571 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
572 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
575 class MEDFileWritableStandAlone : public MEDFileWritable
578 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
579 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
582 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
584 MCAuto<DataArrayByte> ret(self->serialize());
588 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
590 PyObject *ret(PyList_New(0));
594 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
598 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
601 PyObject *ret(PyTuple_New(1));
602 PyObject *ret0(PyDict_New());
603 DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
604 PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
605 {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
606 PyObject *tmp1(PyInt_FromLong(0));
607 PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
608 PyTuple_SetItem(ret,0,ret0);
612 throw INTERP_KERNEL::Exception("PyWrap of MEDFileData.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
618 class MEDFileMeshReadSelector
621 MEDFileMeshReadSelector();
622 MEDFileMeshReadSelector(unsigned int code);
623 unsigned int getCode() const;
624 void setCode(unsigned int newCode);
625 bool isCellFamilyFieldReading() const;
626 bool isNodeFamilyFieldReading() const;
627 bool isCellNameFieldReading() const;
628 bool isNodeNameFieldReading() const;
629 bool isCellNumFieldReading() const;
630 bool isNodeNumFieldReading() const;
631 bool isGlobalNodeNumFieldReading() const;
632 void setCellFamilyFieldReading(bool b);
633 void setNodeFamilyFieldReading(bool b);
634 void setCellNameFieldReading(bool b);
635 void setNodeNameFieldReading(bool b);
636 void setCellNumFieldReading(bool b);
637 void setNodeNumFieldReading(bool b);
638 void setGlobalNodeNumFieldReading(bool b);
641 std::string __str__() const throw(INTERP_KERNEL::Exception)
643 std::ostringstream oss;
648 std::string __repr__() const throw(INTERP_KERNEL::Exception)
650 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
656 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
659 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
660 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
661 throw(INTERP_KERNEL::Exception);
662 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
663 INTERP_KERNEL::NormalizedCellType loc_geo_type,
664 INTERP_KERNEL::NormalizedCellType rem_geo_type)
665 throw(INTERP_KERNEL::Exception);
666 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
667 MEDFileJointCorrespondence *deepCopy() const;
668 MEDFileJointCorrespondence *shallowCpy() const;
669 void setIsNodal(bool isNodal);
670 bool getIsNodal() const;
671 bool isEqual(const MEDFileJointCorrespondence *other) const;
672 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
673 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
674 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
675 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
676 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
677 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
678 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);
679 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
682 MEDFileJointCorrespondence()
684 return MEDFileJointCorrespondence::New();
686 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
688 return MEDFileJointCorrespondence::New(correspondence);
690 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
691 INTERP_KERNEL::NormalizedCellType loc_geo_type,
692 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
694 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
697 std::string __str__() const throw(INTERP_KERNEL::Exception)
699 return self->simpleRepr();
704 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
707 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
708 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
709 MEDFileJointOneStep *deepCopy() const;
710 MEDFileJointOneStep *shallowCpy() const;
711 bool isEqual(const MEDFileJointOneStep *other) const;
712 void setOrder(int order);
713 int getOrder() const;
714 void setIteration(int it);
715 int getIteration() const;
716 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
717 int getNumberOfCorrespondences() const;
718 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
719 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
720 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
723 MEDFileJointOneStep()
725 return MEDFileJointOneStep::New();
728 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
730 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
733 std::string __str__() const throw(INTERP_KERNEL::Exception)
735 return self->simpleRepr();
740 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
743 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
744 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
745 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
746 MEDFileJoint *deepCopy() const;
747 MEDFileJoint *shallowCpy() const;
748 bool isEqual(const MEDFileJoint *other) const;
749 void setLocalMeshName(const std::string& name);
750 std::string getLocalMeshName() const;
751 void setRemoteMeshName(const std::string& name);
752 std::string getRemoteMeshName() const;
753 void setDescription(const std::string& name);
754 std::string getDescription() const;
755 void setJointName(const std::string& name);
756 std::string getJointName() const;
757 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
758 void setDomainNumber(const int& number);
759 int getDomainNumber() const;
760 void pushStep(MEDFileJointOneStep* step);
761 int getNumberOfSteps() const;
762 MEDFileJointOneStep *getStepAtPos(int i) const;
763 std::string simpleRepr() const;
768 return MEDFileJoint::New();
771 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
773 return MEDFileJoint::New(fileName,mName,num);
776 std::string __str__() const throw(INTERP_KERNEL::Exception)
778 return self->simpleRepr();
783 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
786 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
787 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
788 MEDFileJoints *deepCopy() const;
789 std::string simpleRepr() const;
790 std::string getMeshName() const;
791 int getNumberOfJoints() const;
792 std::vector<std::string> getJointsNames() const;
793 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
794 void resize(int newSize) throw(INTERP_KERNEL::Exception);
795 void pushJoint(MEDFileJoint *joint);
796 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
797 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
802 return MEDFileJoints::New();
805 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
807 return MEDFileJoints::New(fileName,meshName);
810 std::string __str__() const throw(INTERP_KERNEL::Exception)
812 return self->simpleRepr();
815 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
819 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
824 else if(PyString_Check(obj))
826 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
832 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
835 int __len__() const throw(INTERP_KERNEL::Exception)
837 return self->getNumberOfJoints();
840 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
842 MEDFileJoint *ret=self->getJointAtPos(i);
848 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
850 MEDFileJoint *ret=self->getJointWithName(paramName);
858 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
861 MEDFileEquivalenceBase();
864 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
867 MEDFileEquivalenceData();
869 void setArray(DataArrayInt *data);
872 DataArrayInt *getArray()
874 DataArrayInt *ret(self->getArray());
875 if(ret) ret->incrRef();
881 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
884 MEDFileEquivalenceNode();
887 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
890 MEDFileEquivalenceCell();
893 std::size_t size() const;
894 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
895 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
898 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
900 DataArrayInt *ret(self->getArray(type));
901 if(ret) ret->incrRef();
905 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
907 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
908 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
909 PyObject *res=PyList_New(result.size());
910 for(int i=0;iL!=result.end(); i++, iL++)
911 PyList_SetItem(res,i,PyInt_FromLong(*iL));
917 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
920 MEDFileEquivalencePair();
922 std::string getName() const;
923 void setName(const std::string& name);
924 std::string getDescription() const;
925 void setDescription(const std::string& descr);
926 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
929 MEDFileEquivalenceCell *initCell()
931 MEDFileEquivalenceCell *ret(self->initCell());
932 if(ret) ret->incrRef();
936 MEDFileEquivalenceNode *initNode()
938 MEDFileEquivalenceNode *ret(self->initNode());
939 if(ret) ret->incrRef();
943 MEDFileEquivalenceCell *getCell()
945 MEDFileEquivalenceCell *ret(self->getCell());
946 if(ret) ret->incrRef();
950 MEDFileEquivalenceNode *getNode()
952 MEDFileEquivalenceNode *ret(self->getNode());
953 if(ret) ret->incrRef();
959 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
962 MEDFileEquivalences();
965 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
966 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
967 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
971 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
973 MEDFileEquivalencePair *ret(self->getEquivalence(i));
974 if(ret) ret->incrRef();
977 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
979 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
980 if(ret) ret->incrRef();
984 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
986 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
987 if(ret) ret->incrRef();
993 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
996 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
997 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
998 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
999 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
1000 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
1001 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
1002 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
1003 void setName(const std::string& name);
1004 std::string getName();
1005 std::string getUnivName() const;
1006 bool getUnivNameWrStatus() const;
1007 void setUnivNameWrStatus(bool newStatus);
1008 void setDescription(const std::string& name);
1009 std::string getDescription() const;
1010 void setOrder(int order);
1011 int getOrder() const;
1012 void setIteration(int it);
1014 void setTimeValue(double time);
1015 void setTime(int dt, int it, double time);
1016 double getTimeValue() const;
1017 void setTimeUnit(const std::string& unit);
1018 std::string getTimeUnit() const;
1019 void setAxisType(MEDCouplingAxisType at);
1020 MEDCouplingAxisType getAxisType() const;
1021 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
1022 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1023 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
1024 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1025 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
1026 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
1027 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1028 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1029 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1030 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
1031 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
1032 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
1033 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1034 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1036 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
1037 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
1038 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1039 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1040 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1041 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1042 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1043 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1044 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1045 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1046 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1047 void clearFamMap() throw(INTERP_KERNEL::Exception);
1048 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1049 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1050 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1051 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1052 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1053 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1054 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1055 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1056 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1057 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1058 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1059 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1060 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1061 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1062 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1063 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1064 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1065 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1066 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1067 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1068 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1069 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1070 static std::string GetMagicFamilyStr();
1071 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1072 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1073 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1074 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1075 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1076 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1077 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1078 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1079 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1080 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1081 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1082 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1083 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1084 void setFamilyInfo(const std::map<std::string,int>& info);
1085 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1086 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1087 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1088 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1089 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1090 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1091 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1092 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1093 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1094 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1095 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1096 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1097 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1098 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1099 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1100 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1101 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1102 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1103 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1104 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1105 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1107 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1108 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1109 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1110 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1111 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr) throw(INTERP_KERNEL::Exception);
1112 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1113 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1114 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1115 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1116 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1117 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1118 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1119 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1120 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1121 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1122 int getNumberOfJoints();
1123 MEDFileJoints *getJoints();
1124 void setJoints( MEDFileJoints* joints );
1125 void initializeEquivalences();
1126 void killEquivalences();
1127 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1128 void killStructureElements() throw(INTERP_KERNEL::Exception);
1131 std::string __str__() const throw(INTERP_KERNEL::Exception)
1133 return self->simpleRepr();
1136 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1138 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1141 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1144 double tmp0=self->getTime(tmp1,tmp2);
1145 PyObject *res = PyList_New(3);
1146 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1147 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1148 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1152 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1155 bool ret0=self->isEqual(other,eps,what);
1156 PyObject *res=PyList_New(2);
1157 PyObject *ret0Py=ret0?Py_True:Py_False;
1159 PyList_SetItem(res,0,ret0Py);
1160 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1164 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1166 std::vector<const DataArrayInt *> grps;
1167 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1168 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1171 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1174 bool ret0=self->areFamsEqual(other,what);
1175 PyObject *res=PyList_New(2);
1176 PyObject *ret0Py=ret0?Py_True:Py_False;
1178 PyList_SetItem(res,0,ret0Py);
1179 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1183 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1186 bool ret0=self->areGrpsEqual(other,what);
1187 PyObject *res=PyList_New(2);
1188 PyObject *ret0Py=ret0?Py_True:Py_False;
1190 PyList_SetItem(res,0,ret0Py);
1191 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1195 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1197 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1198 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1199 PyObject *res=PyList_New(result.size());
1200 for(int i=0;iL!=result.end(); i++, iL++)
1201 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1205 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1207 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1208 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1209 PyObject *res=PyList_New(result.size());
1210 for(int i=0;iL!=result.end(); i++, iL++)
1211 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1215 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1217 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1220 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1223 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1225 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1228 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1231 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1233 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1236 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1239 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1241 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1244 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1247 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1249 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1252 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1255 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1258 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1259 PyObject *ret=PyTuple_New(2);
1260 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1261 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1265 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1267 DataArrayInt *ret3=0;
1268 std::vector<int> ret1,ret2;
1269 bool ret0=self->unPolyze(ret1,ret2,ret3);
1270 PyObject *ret=PyTuple_New(4);
1271 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1273 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1274 for(int j=0;j<(int)ret1.size()/3;j++)
1276 PyObject *retLev2=PyList_New(3);
1277 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1278 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1279 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1280 PyList_SetItem(retLev1_0,j,retLev2);
1282 PyTuple_SetItem(ret,1,retLev1_0);
1284 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1285 for(int j=0;j<(int)ret2.size()/3;j++)
1287 PyObject *retLev2=PyList_New(3);
1288 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1289 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1290 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1291 PyList_SetItem(retLev1_1,j,retLev2);
1293 PyTuple_SetItem(ret,2,retLev1_1);
1295 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1299 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1301 MEDFileEquivalences *ret(self->getEquivalences());
1302 if(ret) ret->incrRef();
1308 class MEDFileUMesh : public MEDFileMesh
1311 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1312 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1313 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1314 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1315 static MEDFileUMesh *New();
1316 static const char *GetSpeStr4ExtMesh();
1318 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1319 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1320 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1321 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1322 void clearNodeAndCellNumbers();
1324 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1325 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1326 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1327 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1328 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1329 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1330 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1331 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1332 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1333 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1335 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1336 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1337 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1338 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1339 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1340 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1341 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1342 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1343 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1344 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1345 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1346 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1347 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1348 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1349 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1352 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1354 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1357 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1359 return MEDFileUMesh::New(fileName,mrs);
1362 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1364 return MEDFileUMesh::New(mem);
1367 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1369 return MEDFileUMesh::New(db);
1374 return MEDFileUMesh::New();
1378 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1380 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1383 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)
1385 std::vector<int> typesCpp1;
1386 convertPyToNewIntArr3(types,typesCpp1);
1387 std::size_t sz(typesCpp1.size());
1388 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1389 for(std::size_t ii=0;ii<sz;ii++)
1390 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1391 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1394 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1395 {// put an empty dict in input to say to __new__ to call __init__...
1396 PyObject *ret(PyTuple_New(1));
1397 PyObject *ret0(PyDict_New());
1398 PyTuple_SetItem(ret,0,ret0);
1402 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1404 std::vector<double> a0;
1405 std::vector<int> a1;
1406 std::vector<std::string> a2;
1407 std::vector< MCAuto<DataArrayInt> > a3;
1408 MCAuto<DataArrayDouble> a4;
1409 self->serialize(a0,a1,a2,a3,a4);
1410 PyObject *ret(PyTuple_New(5));
1411 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1412 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1414 PyObject *ret2(PyList_New(sz));
1415 for(int i=0;i<sz;i++)
1416 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1417 PyTuple_SetItem(ret,2,ret2);
1419 PyObject *ret3(PyList_New(sz));
1420 for(int i=0;i<sz;i++)
1422 DataArrayInt *elt(a3[i]);
1425 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1427 PyTuple_SetItem(ret,3,ret3);
1428 DataArrayDouble *ret4(a4);
1431 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1435 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1437 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1438 if(!PyTuple_Check(inp))
1439 throw INTERP_KERNEL::Exception(MSG);
1440 int sz(PyTuple_Size(inp));
1442 throw INTERP_KERNEL::Exception(MSG);
1443 std::vector<double> a0;
1444 std::vector<int> a1;
1445 std::vector<std::string> a2;
1446 std::vector< MCAuto<DataArrayInt> > a3;
1447 MCAuto<DataArrayDouble> a4;
1449 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1451 fillArrayWithPyListDbl3(a0py,tmp,a0);
1452 convertPyToNewIntArr3(a1py,a1);
1453 fillStringVector(a2py,a2);
1455 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1457 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1458 if(!SWIG_IsOK(status))
1459 throw INTERP_KERNEL::Exception(MSG);
1460 a4=reinterpret_cast<DataArrayDouble *>(argp);
1461 if((DataArrayDouble *)a4)
1464 std::vector< DataArrayInt * > a3Tmp;
1465 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1466 std::size_t sz(a3Tmp.size());
1468 for(std::size_t i=0;i<sz;i++)
1472 a3Tmp[i]->incrRef();
1474 self->unserialize(a0,a1,a2,a3,a4);
1478 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1481 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1482 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1485 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1488 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1491 self->setMeshAtLevel(meshDimRelToMax,m1);
1494 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1497 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1499 self->removeMeshAtLevel(meshDimRelToMax);
1502 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1504 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1506 DataArrayDouble *a,*a2;
1507 DataArrayDoubleTuple *aa,*aa2;
1508 std::vector<double> bb,bb2;
1510 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1511 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1512 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1516 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1518 std::vector<const MEDFileUMesh *> meshesCpp;
1519 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1520 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1524 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1526 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1527 return convertVecPairIntToPy(ret);
1530 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1532 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1533 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1534 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1537 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1539 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1540 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1541 return self->extractPart(extractDefCpp);
1544 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1546 std::vector<const MEDCouplingUMesh *> ms;
1547 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1548 self->setMeshes(ms,renum);
1551 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1553 std::vector<const MEDCouplingUMesh *> ms;
1554 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1555 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1558 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1560 std::vector<const MEDCouplingUMesh *> ms;
1561 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1562 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1565 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1567 DataArrayDouble *ret=self->getCoords();
1573 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1575 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1578 return const_cast<PartDefinition *>(ret);
1581 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1583 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1584 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1585 PyObject *ret=PyTuple_New(3);
1586 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1587 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1588 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1592 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1594 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1600 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1602 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1603 std::size_t sz(tmp.size());
1604 PyObject *ret=PyList_New(sz);
1605 for(std::size_t i=0;i<sz;i++)
1609 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1616 class MEDFileStructuredMesh : public MEDFileMesh
1621 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1623 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1631 class MEDFileCMesh : public MEDFileStructuredMesh
1634 static MEDFileCMesh *New();
1635 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1636 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1637 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1638 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1639 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1644 return MEDFileCMesh::New();
1647 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1649 return MEDFileCMesh::New(fileName,mrs);
1652 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1654 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1657 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1659 return MEDFileCMesh::New(db);
1663 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1665 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1668 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1670 const MEDCouplingCMesh *tmp=self->getMesh();
1673 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1678 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1681 static MEDFileCurveLinearMesh *New();
1682 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1683 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1684 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1685 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1688 MEDFileCurveLinearMesh()
1690 return MEDFileCurveLinearMesh::New();
1693 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1695 return MEDFileCurveLinearMesh::New(fileName,mrs);
1698 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1700 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1703 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1705 return MEDFileCurveLinearMesh::New(db);
1709 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1711 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1714 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1716 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1719 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1724 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1727 static MEDFileMeshMultiTS *New();
1728 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1729 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1730 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1731 std::string getName() const throw(INTERP_KERNEL::Exception);
1732 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1733 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1736 MEDFileMeshMultiTS()
1738 return MEDFileMeshMultiTS::New();
1741 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1743 return MEDFileMeshMultiTS::New(fileName);
1746 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1748 return MEDFileMeshMultiTS::New(fileName,mName);
1751 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1753 MEDFileMesh *ret=self->getOneTimeStep();
1761 class MEDFileMeshesIterator
1766 PyObject *next() throw(INTERP_KERNEL::Exception)
1768 MEDFileMesh *ret=self->nextt();
1772 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1776 PyErr_SetString(PyExc_StopIteration,"No more data.");
1783 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1786 static MEDFileMeshes *New();
1787 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1788 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1789 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1790 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1792 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1793 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1794 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1795 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1796 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1797 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1798 void killStructureElements() throw(INTERP_KERNEL::Exception);
1803 return MEDFileMeshes::New();
1806 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1808 return MEDFileMeshes::New(fileName);
1811 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1813 return MEDFileMeshes::New(db);
1817 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1819 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1822 std::string __str__() const throw(INTERP_KERNEL::Exception)
1824 return self->simpleRepr();
1827 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1829 if(PyInt_Check(obj))
1831 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1836 else if(PyString_Check(obj))
1838 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1844 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1847 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1849 self->setMeshAtPos(obj,mesh);
1853 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1855 return self->iterator();
1858 int __len__() const throw(INTERP_KERNEL::Exception)
1860 return self->getNumberOfMeshes();
1863 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1865 MEDFileMesh *ret=self->getMeshAtPos(i);
1870 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1872 MEDFileMesh *ret=self->getMeshWithName(mname);
1880 class MEDFileFieldLoc : public RefCountObject
1883 std::string getName() const;
1884 int getDimension() const;
1885 int getNumberOfGaussPoints() const;
1886 int getNumberOfPointsInCells() const;
1887 const std::vector<double>& getRefCoords() const;
1888 const std::vector<double>& getGaussCoords() const;
1889 const std::vector<double>& getGaussWeights() const;
1890 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1893 std::string __str__() const throw(INTERP_KERNEL::Exception)
1895 return self->repr();
1900 class MEDFileFieldGlobsReal
1903 void resetContent();
1904 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1905 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1906 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1907 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1908 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1909 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1910 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1911 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1912 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1913 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1914 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1915 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1916 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1917 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1918 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1919 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1920 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1921 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1922 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1923 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1924 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1925 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1926 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1927 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1928 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1929 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1930 void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
1933 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1935 const DataArrayInt *ret=self->getProfile(pflName);
1938 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1941 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1943 const DataArrayInt *ret=self->getProfileFromId(pflId);
1946 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1949 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1951 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1954 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1957 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1959 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1962 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1965 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1967 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1968 return convertVecPairVecStToPy(ret);
1971 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1973 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1974 return convertVecPairVecStToPy(ret);
1977 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1979 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1980 self->changePflsNames(v);
1983 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1985 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1986 self->changePflsRefsNamesGen(v);
1989 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1991 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1992 self->changePflsNamesInStruct(v);
1995 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1997 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1998 self->changeLocsNames(v);
2001 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
2003 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2004 self->changeLocsRefsNamesGen(v);
2007 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2009 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2010 self->changeLocsNamesInStruct(v);
2013 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
2015 std::ostringstream oss;
2016 self->simpleReprGlobs(oss);
2022 class MEDFileEntities
2027 static MEDFileEntities *BuildFrom(PyObject *entities) throw(INTERP_KERNEL::Exception)
2029 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2030 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2032 std::size_t sz(inp0.size());
2034 for(std::size_t i=0;i<sz;i++)
2035 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2037 return MEDFileEntities::BuildFrom(&inp);
2044 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2047 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2048 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2049 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2050 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
2051 void loadArrays() throw(INTERP_KERNEL::Exception);
2052 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2053 void unloadArrays() throw(INTERP_KERNEL::Exception);
2054 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2055 int getDimension() const throw(INTERP_KERNEL::Exception);
2056 int getIteration() const throw(INTERP_KERNEL::Exception);
2057 int getOrder() const throw(INTERP_KERNEL::Exception);
2058 std::string getName() throw(INTERP_KERNEL::Exception);
2059 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2060 std::string getMeshName() throw(INTERP_KERNEL::Exception);
2061 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2062 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2063 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2064 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2065 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2066 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2067 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2068 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2069 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2070 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2071 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2072 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2073 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2076 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2079 double tmp0=self->getTime(tmp1,tmp2);
2080 PyObject *res = PyList_New(3);
2081 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2082 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2083 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2087 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2089 std::pair<int,int> res=self->getDtIt();
2090 PyObject *elt=PyTuple_New(2);
2091 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2092 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2096 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2098 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2101 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2103 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2106 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2108 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2109 return self->changeMeshNames(modifTab);
2112 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2114 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2115 PyObject *ret2=PyList_New(ret.size());
2116 for(int i=0;i<(int)ret.size();i++)
2117 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2121 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2123 std::vector<int> ret1;
2124 int ret0=self->getNonEmptyLevels(mname,ret1);
2125 PyObject *elt=PyTuple_New(2);
2126 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2127 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2131 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2133 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2134 std::vector< std::vector<TypeOfField> > typesF;
2135 std::vector< std::vector<std::string> > pfls;
2136 std::vector< std::vector<std::string> > locs;
2137 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2139 PyObject *ret2=PyList_New(sz);
2140 for(int i=0;i<sz;i++)
2142 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2143 const std::vector<TypeOfField>& typesFI=typesF[i];
2144 const std::vector<std::string>& pflsI=pfls[i];
2145 const std::vector<std::string>& locsI=locs[i];
2146 PyObject *elt=PyTuple_New(2);
2147 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2148 int sz2=ret[i].size();
2149 PyObject *elt2=PyList_New(sz2);
2150 for(int j=0;j<sz2;j++)
2152 PyObject *elt3=PyTuple_New(4);
2153 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2154 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));
2155 PyTuple_SetItem(elt3,1,elt4);
2156 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2157 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2158 PyList_SetItem(elt2,j,elt3);
2160 PyTuple_SetItem(elt,1,elt2);
2161 PyList_SetItem(ret2,i,elt);
2166 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2168 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2169 std::size_t sz=ret.size();
2170 PyObject *retPy=PyList_New(sz);
2171 for(std::size_t i=0;i<sz;i++)
2172 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2176 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2178 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2179 std::size_t sz=ret.size();
2180 PyObject *retPy=PyList_New(sz);
2181 for(std::size_t i=0;i<sz;i++)
2182 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2186 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2188 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2189 std::size_t sz=ret.size();
2190 PyObject *retPy=PyList_New(sz);
2191 for(std::size_t i=0;i<sz;i++)
2192 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2196 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2198 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2199 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2200 return self->extractPart(extractDefCpp,mm);
2205 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2208 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2209 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2210 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2211 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2212 static MEDFileField1TS *New();
2213 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2214 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2215 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2216 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2217 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2218 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2219 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2221 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2222 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2223 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2224 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2227 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2229 return MEDFileField1TS::New(fileName,loadAll);
2232 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2234 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2237 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2239 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2242 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2244 return MEDFileField1TS::New(db);
2249 return MEDFileField1TS::New();
2253 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2255 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2258 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2260 const DataArrayDouble *arr=0;
2262 arr=field->getArray();
2263 self->copyTinyInfoFrom(field,arr);
2266 std::string __str__() const throw(INTERP_KERNEL::Exception)
2268 return self->simpleRepr();
2271 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2273 DataArrayInt *ret1=0;
2274 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2275 PyObject *ret=PyTuple_New(2);
2276 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2277 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2281 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2283 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2284 std::vector< std::vector<TypeOfField> > typesF;
2285 std::vector< std::vector<std::string> > pfls;
2286 std::vector< std::vector<std::string> > locs;
2287 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2289 PyObject *ret2=PyList_New(sz);
2290 for(int i=0;i<sz;i++)
2292 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2293 const std::vector<TypeOfField>& typesFI=typesF[i];
2294 const std::vector<std::string>& pflsI=pfls[i];
2295 const std::vector<std::string>& locsI=locs[i];
2296 PyObject *elt=PyTuple_New(2);
2297 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2298 int sz2=ret[i].size();
2299 PyObject *elt2=PyList_New(sz2);
2300 for(int j=0;j<sz2;j++)
2302 PyObject *elt3=PyTuple_New(4);
2303 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2304 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2305 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2306 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2307 PyList_SetItem(elt2,j,elt3);
2309 PyTuple_SetItem(elt,1,elt2);
2310 PyList_SetItem(ret2,i,elt);
2315 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2317 DataArrayDouble *ret=self->getUndergroundDataArray();
2323 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2325 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2326 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2329 PyObject *ret=PyTuple_New(2);
2330 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2331 std::size_t sz=elt1Cpp.size();
2332 PyObject *elt=PyList_New(sz);
2333 for(std::size_t i=0;i<sz;i++)
2335 PyObject *elt1=PyTuple_New(2);
2336 PyObject *elt2=PyTuple_New(2);
2337 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2338 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2339 PyObject *elt3=PyTuple_New(2);
2340 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2341 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2342 PyTuple_SetItem(elt1,0,elt2);
2343 PyTuple_SetItem(elt1,1,elt3);
2344 PyList_SetItem(elt,i,elt1);
2346 PyTuple_SetItem(ret,1,elt);
2352 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2355 static MEDFileIntField1TS *New();
2356 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2357 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2358 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2359 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2360 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2362 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2363 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2364 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2365 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2366 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2367 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2368 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2369 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2372 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2374 return MEDFileIntField1TS::New();
2377 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2379 return MEDFileIntField1TS::New(fileName,loadAll);
2382 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2384 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2387 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2389 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2392 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2394 return MEDFileIntField1TS::New(db);
2398 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2400 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2403 std::string __str__() const throw(INTERP_KERNEL::Exception)
2405 return self->simpleRepr();
2408 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2410 DataArrayInt *ret1=0;
2411 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2412 PyObject *ret=PyTuple_New(2);
2413 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2414 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2418 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2420 DataArrayInt *ret=self->getUndergroundDataArray();
2428 class MEDFileAnyTypeFieldMultiTSIterator
2433 PyObject *next() throw(INTERP_KERNEL::Exception)
2435 MEDFileAnyTypeField1TS *ret=self->nextt();
2437 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2440 PyErr_SetString(PyExc_StopIteration,"No more data.");
2447 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2450 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2451 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2452 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2453 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2454 std::string getName() const throw(INTERP_KERNEL::Exception);
2455 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2456 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2457 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2458 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2459 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2460 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2461 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2462 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2463 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2464 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2465 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2466 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2467 void loadArrays() throw(INTERP_KERNEL::Exception);
2468 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2469 void unloadArrays() throw(INTERP_KERNEL::Exception);
2470 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2472 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2473 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2474 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2475 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2476 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2477 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2480 int __len__() const throw(INTERP_KERNEL::Exception)
2482 return self->getNumberOfTS();
2485 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2487 if(elt0 && PyInt_Check(elt0))
2489 int pos=PyInt_AS_LONG(elt0);
2492 else if(elt0 && PyTuple_Check(elt0))
2494 if(PyTuple_Size(elt0)==2)
2496 PyObject *o0=PyTuple_GetItem(elt0,0);
2497 PyObject *o1=PyTuple_GetItem(elt0,1);
2498 if(PyInt_Check(o0) && PyInt_Check(o1))
2500 int iter=PyInt_AS_LONG(o0);
2501 int order=PyInt_AS_LONG(o1);
2502 return self->getPosOfTimeStep(iter,order);
2505 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 !");
2508 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 !");
2510 else if(elt0 && PyFloat_Check(elt0))
2512 double val=PyFloat_AS_DOUBLE(elt0);
2513 return self->getPosGivenTime(val);
2516 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2519 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2521 std::vector< std::pair<int,int> > res(self->getIterations());
2522 return convertVecPairIntToPy(res);
2525 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2527 std::vector<double> ret1;
2528 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2529 std::size_t sz=ret.size();
2530 PyObject *ret2=PyList_New(sz);
2531 for(std::size_t i=0;i<sz;i++)
2533 PyObject *elt=PyTuple_New(3);
2534 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2535 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2536 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2537 PyList_SetItem(ret2,i,elt);
2542 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2544 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2545 PyObject *ret2=PyList_New(ret.size());
2546 for(int i=0;i<(int)ret.size();i++)
2548 const std::vector<TypeOfField>& rett=ret[i];
2549 PyObject *ret3=PyList_New(rett.size());
2550 for(int j=0;j<(int)rett.size();j++)
2551 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2552 PyList_SetItem(ret2,i,ret3);
2557 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2559 std::vector<int> ret1;
2560 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2561 PyObject *elt=PyTuple_New(2);
2562 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2563 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2567 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2569 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2570 std::vector< std::vector<TypeOfField> > typesF;
2571 std::vector< std::vector<std::string> > pfls;
2572 std::vector< std::vector<std::string> > locs;
2573 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2575 PyObject *ret2=PyList_New(sz);
2576 for(int i=0;i<sz;i++)
2578 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2579 const std::vector<TypeOfField>& typesFI=typesF[i];
2580 const std::vector<std::string>& pflsI=pfls[i];
2581 const std::vector<std::string>& locsI=locs[i];
2582 PyObject *elt=PyTuple_New(2);
2583 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2584 int sz2=ret[i].size();
2585 PyObject *elt2=PyList_New(sz2);
2586 for(int j=0;j<sz2;j++)
2588 PyObject *elt3=PyTuple_New(4);
2589 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2590 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));
2591 PyTuple_SetItem(elt3,1,elt4);
2592 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2593 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2594 PyList_SetItem(elt2,j,elt3);
2596 PyTuple_SetItem(elt,1,elt2);
2597 PyList_SetItem(ret2,i,elt);
2602 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2604 if(PyList_Check(elts))
2606 int sz=PyList_Size(elts);
2607 std::vector<int> ret(sz);
2608 for(int i=0;i<sz;i++)
2610 PyObject *elt=PyList_GetItem(elts,i);
2611 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2617 std::vector<int> ret(1);
2618 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2623 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2625 if(PySlice_Check(elts))
2627 Py_ssize_t strt=2,stp=2,step=2;
2628 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2629 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2630 self->eraseTimeStepIds2(strt,stp,step);
2634 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2635 if(!idsToRemove.empty())
2636 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2640 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2644 std::vector<int> pos2;
2645 DataArrayInt *pos3=0;
2646 DataArrayIntTuple *pos4=0;
2647 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2652 self->eraseTimeStepIds(&pos1,&pos1+1);
2659 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2664 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2668 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2672 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2674 return self->iterator();
2677 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2679 if(elt0 && PyList_Check(elt0))
2681 int sz=PyList_Size(elt0);
2682 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2683 int *pt=da->getPointer();
2684 for(int i=0;i<sz;i++,pt++)
2686 PyObject *elt1=PyList_GetItem(elt0,i);
2687 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2689 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2691 else if(elt0 && PySlice_Check(elt0))
2693 Py_ssize_t strt=2,stp=2,step=2;
2694 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2695 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2696 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2699 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2702 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2704 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2705 return self->changeMeshNames(modifTab);
2708 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2710 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2711 std::size_t sz=ret.size();
2712 PyObject *retPy=PyList_New(sz);
2713 for(std::size_t i=0;i<sz;i++)
2714 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2718 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2720 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2721 std::size_t sz=ret.size();
2722 PyObject *retPy=PyList_New(sz);
2723 for(std::size_t i=0;i<sz;i++)
2724 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2728 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2730 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2731 std::size_t sz=ret.size();
2732 PyObject *retPy=PyList_New(sz);
2733 for(std::size_t i=0;i<sz;i++)
2734 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2738 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2741 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2742 if(SWIG_IsOK(status))
2744 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2748 std::vector<MEDFileAnyTypeField1TS *> tmp;
2749 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2750 self->pushBackTimeSteps(tmp);
2754 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2756 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2757 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2758 return self->extractPart(extractDefCpp,mm);
2761 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2763 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2764 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2765 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2766 std::size_t sz=ret.size();
2767 PyObject *retPy=PyList_New(sz);
2768 for(std::size_t i=0;i<sz;i++)
2770 std::size_t sz2=ret[i].size();
2771 PyObject *ret1Py=PyList_New(sz2);
2772 for(std::size_t j=0;j<sz2;j++)
2774 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2777 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2779 PyList_SetItem(retPy,i,ret1Py);
2784 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2786 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2787 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2788 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2789 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2790 if(ret2.size()!=ret.size())
2792 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2793 throw INTERP_KERNEL::Exception(oss.str().c_str());
2795 std::size_t sz=ret.size();
2796 PyObject *retPy=PyList_New(sz);
2797 for(std::size_t i=0;i<sz;i++)
2799 std::size_t sz2=ret[i].size();
2800 PyObject *ret0Py=PyTuple_New(2);
2801 PyObject *ret1Py=PyList_New(sz2);
2802 for(std::size_t j=0;j<sz2;j++)
2804 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2807 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2809 PyTuple_SetItem(ret0Py,0,ret1Py);
2810 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2811 PyList_SetItem(retPy,i,ret0Py);
2818 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2821 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2822 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2823 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2824 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2826 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2827 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2828 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2829 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2830 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2831 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2833 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2834 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2835 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2838 MEDFileFieldMultiTS()
2840 return MEDFileFieldMultiTS::New();
2843 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2845 return MEDFileFieldMultiTS::New(fileName,loadAll);
2848 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2850 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2853 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2855 return MEDFileFieldMultiTS::New(db);
2859 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2861 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2864 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2866 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2867 std::size_t sz(tmp.size());
2868 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2869 for(std::size_t i=0;i<sz;i++)
2871 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2872 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2874 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2877 std::string __str__() const throw(INTERP_KERNEL::Exception)
2879 return self->simpleRepr();
2882 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2884 DataArrayInt *ret1=0;
2885 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2886 PyObject *ret=PyTuple_New(2);
2887 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2888 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2892 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2894 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2895 std::vector< std::vector<TypeOfField> > typesF;
2896 std::vector< std::vector<std::string> > pfls;
2897 std::vector< std::vector<std::string> > locs;
2898 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2900 PyObject *ret2=PyList_New(sz);
2901 for(int i=0;i<sz;i++)
2903 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2904 const std::vector<TypeOfField>& typesFI=typesF[i];
2905 const std::vector<std::string>& pflsI=pfls[i];
2906 const std::vector<std::string>& locsI=locs[i];
2907 PyObject *elt=PyTuple_New(2);
2908 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2909 int sz2=ret[i].size();
2910 PyObject *elt2=PyList_New(sz2);
2911 for(int j=0;j<sz2;j++)
2913 PyObject *elt3=PyTuple_New(4);
2914 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2915 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2916 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2917 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2918 PyList_SetItem(elt2,j,elt3);
2920 PyTuple_SetItem(elt,1,elt2);
2921 PyList_SetItem(ret2,i,elt);
2925 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2927 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2933 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2935 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2936 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2939 PyObject *ret=PyTuple_New(2);
2940 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2941 std::size_t sz=elt1Cpp.size();
2942 PyObject *elt=PyList_New(sz);
2943 for(std::size_t i=0;i<sz;i++)
2945 PyObject *elt1=PyTuple_New(2);
2946 PyObject *elt2=PyTuple_New(2);
2947 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2948 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2949 PyObject *elt3=PyTuple_New(2);
2950 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2951 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2952 PyTuple_SetItem(elt1,0,elt2);
2953 PyTuple_SetItem(elt1,1,elt3);
2954 PyList_SetItem(elt,i,elt1);
2956 PyTuple_SetItem(ret,1,elt);
2962 class MEDFileFieldsIterator
2967 PyObject *next() throw(INTERP_KERNEL::Exception)
2969 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2971 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2974 PyErr_SetString(PyExc_StopIteration,"No more data.");
2981 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2984 static MEDFileIntFieldMultiTS *New();
2985 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2986 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2987 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2989 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2990 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2991 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2992 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2993 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2994 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2995 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2996 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2997 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3000 MEDFileIntFieldMultiTS()
3002 return MEDFileIntFieldMultiTS::New();
3005 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3007 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
3010 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3012 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
3015 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3017 return MEDFileIntFieldMultiTS::New(db);
3021 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3023 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
3026 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3028 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3029 std::size_t sz(tmp.size());
3030 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3031 for(std::size_t i=0;i<sz;i++)
3033 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3034 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3036 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3039 std::string __str__() const throw(INTERP_KERNEL::Exception)
3041 return self->simpleRepr();
3044 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3046 DataArrayInt *ret1=0;
3047 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3048 PyObject *ret=PyTuple_New(2);
3049 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3050 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3054 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3056 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3064 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3067 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3068 std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3071 MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3073 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3074 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3082 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3085 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3087 MEDFileStructureElements();
3090 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3093 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3094 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3095 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3096 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
3097 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3098 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3099 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3100 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3101 void loadArrays() throw(INTERP_KERNEL::Exception);
3102 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3103 void unloadArrays() throw(INTERP_KERNEL::Exception);
3104 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3105 int getNumberOfFields() const;
3106 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3107 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3109 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3110 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3111 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3112 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3113 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3114 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3115 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3116 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3117 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3118 void killStructureElements() throw(INTERP_KERNEL::Exception);
3119 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3120 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3121 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3122 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3123 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3128 return MEDFileFields::New();
3131 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3133 return MEDFileFields::New(fileName,loadAll);
3136 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3138 return MEDFileFields::New(db);
3141 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
3143 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3147 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3149 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3152 std::string __str__() const throw(INTERP_KERNEL::Exception)
3154 return self->simpleRepr();
3157 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3159 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3163 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3165 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3169 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3171 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3172 std::size_t sz(tmp.size());
3173 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3174 for(std::size_t i=0;i<sz;i++)
3176 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3177 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3179 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3182 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3184 std::vector< std::pair<std::string,std::string> > ps;
3185 self->getMeshSENames(ps);
3186 return convertVectPairStToPy(ps);
3189 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3192 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3193 PyObject *ret=PyTuple_New(2);
3194 PyObject *ret_0=PyList_New(ret0.size());
3196 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3198 PyObject *elt=PyTuple_New(2);
3199 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3200 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3201 PyList_SetItem(ret_0,rk,elt);
3203 PyTuple_SetItem(ret,0,ret_0);
3204 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3205 PyTuple_SetItem(ret,1,ret_1);
3209 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3211 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3212 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3215 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3217 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3218 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3221 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3223 if(obj && PyList_Check(obj))
3225 int sz=PyList_Size(obj);
3226 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3227 int *pt=da->getPointer();
3228 for(int i=0;i<sz;i++,pt++)
3230 PyObject *elt1=PyList_GetItem(obj,i);
3231 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3233 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3236 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3239 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3241 self->setFieldAtPos(obj,field);
3245 int __len__() const throw(INTERP_KERNEL::Exception)
3247 return self->getNumberOfFields();
3250 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3252 return self->iterator();
3255 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3257 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3258 return self->changeMeshNames(modifTab);
3261 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3263 if(elt0 && PyInt_Check(elt0))
3265 return PyInt_AS_LONG(elt0);
3267 else if(elt0 && PyString_Check(elt0))
3268 return self->getPosFromFieldName(PyString_AsString(elt0));
3270 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3273 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3275 if(PyList_Check(elts))
3277 int sz=PyList_Size(elts);
3278 std::vector<int> ret(sz);
3279 for(int i=0;i<sz;i++)
3281 PyObject *elt=PyList_GetItem(elts,i);
3282 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3288 std::vector<int> ret(1);
3289 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3294 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3296 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3297 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3298 self->pushFields(tmp);
3301 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3303 if(elts && PySlice_Check(elts))
3305 Py_ssize_t strt=2,stp=2,step=2;
3306 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3307 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3308 self->destroyFieldsAtPos2(strt,stp,step);
3312 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3313 if(!idsToRemove.empty())
3314 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3318 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3320 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3321 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3322 return self->extractPart(extractDefCpp,mm);
3327 class MEDFileParameter1TS : public RefCountObject
3330 void setIteration(int it);
3331 int getIteration() const;
3332 void setOrder(int order);
3333 int getOrder() const;
3334 void setTimeValue(double time);
3335 void setTime(int dt, int it, double time);
3336 double getTime(int& dt, int& it);
3337 double getTimeValue() const;
3340 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3343 void setValue(double val) throw(INTERP_KERNEL::Exception);
3344 double getValue() const throw(INTERP_KERNEL::Exception);
3345 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3348 std::string __str__() const throw(INTERP_KERNEL::Exception)
3350 return self->simpleRepr();
3355 class MEDFileParameterTinyInfo : public MEDFileWritable
3358 void setDescription(const std::string& name);
3359 std::string getDescription() const;
3360 void setTimeUnit(const std::string& unit);
3361 std::string getTimeUnit() const;
3364 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3367 static MEDFileParameterDouble1TS *New();
3368 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3369 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3370 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3371 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3372 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3373 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3374 std::string getName() const throw(INTERP_KERNEL::Exception);
3375 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3378 MEDFileParameterDouble1TS()
3380 return MEDFileParameterDouble1TS::New();
3383 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3385 return MEDFileParameterDouble1TS::New(fileName);
3388 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3390 return MEDFileParameterDouble1TS::New(fileName,paramName);
3393 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3395 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3398 std::string __str__() const throw(INTERP_KERNEL::Exception)
3400 return self->simpleRepr();
3403 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3406 bool ret0=self->isEqual(other,eps,what);
3407 PyObject *res=PyList_New(2);
3408 PyObject *ret0Py=ret0?Py_True:Py_False;
3410 PyList_SetItem(res,0,ret0Py);
3411 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3417 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3420 static MEDFileParameterMultiTS *New();
3421 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3422 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3423 std::string getName() const;
3424 void setName(const std::string& name);
3425 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3426 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3427 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3428 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3429 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3430 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3431 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3432 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3435 MEDFileParameterMultiTS()
3437 return MEDFileParameterMultiTS::New();
3440 MEDFileParameterMultiTS(const std::string& fileName)
3442 return MEDFileParameterMultiTS::New(fileName);
3445 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3447 return MEDFileParameterMultiTS::New(fileName,paramName);
3450 std::string __str__() const throw(INTERP_KERNEL::Exception)
3452 return self->simpleRepr();
3455 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3458 bool ret0=self->isEqual(other,eps,what);
3459 PyObject *res=PyList_New(2);
3460 PyObject *ret0Py=ret0?Py_True:Py_False;
3462 PyList_SetItem(res,0,ret0Py);
3463 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3467 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3471 std::vector<int> pos2;
3472 DataArrayInt *pos3=0;
3473 DataArrayIntTuple *pos4=0;
3474 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3479 self->eraseTimeStepIds(&pos1,&pos1+1);
3486 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3491 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3495 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3499 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3501 if(elt0 && PyInt_Check(elt0))
3503 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3506 else if(elt0 && PyTuple_Check(elt0))
3508 if(PyTuple_Size(elt0)==2)
3510 PyObject *o0=PyTuple_GetItem(elt0,0);
3511 PyObject *o1=PyTuple_GetItem(elt0,1);
3512 if(PyInt_Check(o0) && PyInt_Check(o1))
3514 int iter=PyInt_AS_LONG(o0);
3515 int order=PyInt_AS_LONG(o1);
3516 return self->getPosOfTimeStep(iter,order);
3519 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 !");
3522 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 !");
3524 else if(elt0 && PyFloat_Check(elt0))
3526 double val=PyFloat_AS_DOUBLE(elt0);
3527 return self->getPosGivenTime(val);
3530 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3533 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3535 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3541 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3543 if(PyList_Check(elts))
3545 int sz=PyList_Size(elts);
3546 std::vector<int> ret(sz);
3547 for(int i=0;i<sz;i++)
3549 PyObject *elt=PyList_GetItem(elts,i);
3550 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3556 std::vector<int> ret(1);
3557 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3562 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3564 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3565 if(!idsToRemove.empty())
3566 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3569 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3571 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3577 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3579 std::vector< std::pair<int,int> > res=self->getIterations();
3580 PyObject *ret=PyList_New(res.size());
3582 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3584 PyObject *elt=PyTuple_New(2);
3585 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3586 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3587 PyList_SetItem(ret,rk,elt);
3592 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3594 std::vector<double> res2;
3595 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3596 PyObject *ret=PyList_New(res.size());
3598 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3600 PyObject *elt=PyTuple_New(3);
3601 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3602 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3603 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3604 PyList_SetItem(ret,rk,elt);
3611 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3614 static MEDFileParameters *New();
3615 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3616 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3617 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3618 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3619 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3620 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3621 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3622 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3623 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3624 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3625 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3630 return MEDFileParameters::New();
3633 MEDFileParameters(const std::string& fileName)
3635 return MEDFileParameters::New(fileName);
3638 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3640 return MEDFileParameters::New(db);
3644 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3646 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3649 std::string __str__() const throw(INTERP_KERNEL::Exception)
3651 return self->simpleRepr();
3654 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3656 if(PyInt_Check(obj))
3658 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3663 else if(PyString_Check(obj))
3665 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3671 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3674 int __len__() const throw(INTERP_KERNEL::Exception)
3676 return self->getNumberOfParams();
3679 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3681 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3687 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3689 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3695 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3698 bool ret0=self->isEqual(other,eps,what);
3699 PyObject *res=PyList_New(2);
3700 PyObject *ret0Py=ret0?Py_True:Py_False;
3702 PyList_SetItem(res,0,ret0Py);
3703 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3709 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3712 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3713 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3714 static MEDFileData *New();
3715 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3716 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3717 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3718 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3719 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3720 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3721 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3723 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3724 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3725 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3726 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3727 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3731 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3733 return MEDFileData::New(fileName);
3736 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3738 return MEDFileData::New(db);
3743 return MEDFileData::New();
3746 std::string __str__() const throw(INTERP_KERNEL::Exception)
3748 return self->simpleRepr();
3751 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3753 MEDFileMeshes *ret=self->getMeshes();
3759 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3761 MEDFileParameters *ret=self->getParams();
3767 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3769 MEDFileFields *ret=self->getFields();
3775 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3777 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3778 return self->changeMeshNames(modifTab);
3781 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3783 std::vector<const MEDFileData *> mfdsCpp;
3784 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3785 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3790 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3792 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3797 class SauvReader : public RefCountObject
3800 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3801 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3804 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3806 return SauvReader::New(fileName);
3811 class SauvWriter : public RefCountObject
3814 static SauvWriter * New();
3815 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3816 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3817 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3818 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3821 SauvWriter() throw(INTERP_KERNEL::Exception)
3823 return SauvWriter::New();
3830 class MEDFileMeshStruct;
3832 class MEDFileField1TSStructItem
3835 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3838 class MEDFileMeshStruct : public RefCountObject
3841 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3843 ~MEDFileMeshStruct();
3846 class MEDMeshMultiLev : public RefCountObject
3849 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3850 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3851 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3857 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3859 DataArrayInt *famIds(0);
3860 bool isWithoutCopy(false);
3861 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3862 PyObject *ret=PyTuple_New(2);
3863 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3865 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3866 PyTuple_SetItem(ret,1,ret1Py);
3870 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3872 DataArrayInt *numIds(0);
3873 bool isWithoutCopy(false);
3874 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3875 PyObject *ret=PyTuple_New(2);
3876 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3878 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3879 PyTuple_SetItem(ret,1,ret1Py);
3883 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3885 DataArrayInt *famIds(0);
3886 bool isWithoutCopy(false);
3887 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3888 PyObject *ret=PyTuple_New(2);
3889 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3891 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3892 PyTuple_SetItem(ret,1,ret1Py);
3896 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3898 DataArrayInt *numIds(0);
3899 bool isWithoutCopy(false);
3900 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3901 PyObject *ret=PyTuple_New(2);
3902 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3904 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3905 PyTuple_SetItem(ret,1,ret1Py);
3909 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3911 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3912 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3913 PyObject *res(PyList_New(result.size()));
3914 for(int i=0;iL!=result.end(); i++, iL++)
3915 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3921 class MEDUMeshMultiLev : public MEDMeshMultiLev
3924 ~MEDUMeshMultiLev();
3928 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3930 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3931 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3932 PyObject *ret0Py=ncc?Py_True:Py_False;
3934 PyObject *ret=PyTuple_New(7);
3935 PyTuple_SetItem(ret,0,ret0Py);
3936 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3937 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3938 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3939 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3940 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3941 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3947 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3950 ~MEDStructuredMeshMultiLev();
3953 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3956 ~MEDCMeshMultiLev();
3960 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3963 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3964 std::size_t sz(objs.size());
3965 PyObject *ret(PyTuple_New(2));
3966 PyObject *ret0=PyList_New(sz);
3967 for(std::size_t i=0;i<sz;i++)
3968 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3969 PyTuple_SetItem(ret,0,ret0);
3970 PyObject *ret1Py(isInternal?Py_True:Py_False);
3972 PyTuple_SetItem(ret,1,ret1Py);
3978 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3981 ~MEDCurveLinearMeshMultiLev();
3985 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3987 DataArrayDouble *ret0(0);
3988 std::vector<int> ret1;
3990 self->buildVTUArrays(ret0,ret1,ret2);
3991 std::size_t sz(ret1.size());
3992 PyObject *ret=PyTuple_New(3);
3993 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3994 PyObject *ret1Py=PyList_New(sz);
3995 for(std::size_t i=0;i<sz;i++)
3996 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3997 PyTuple_SetItem(ret,1,ret1Py);
3998 PyObject *ret2Py(ret2?Py_True:Py_False);
4000 PyTuple_SetItem(ret,2,ret2Py);
4006 class MEDFileFastCellSupportComparator : public RefCountObject
4009 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
4010 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4011 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4012 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
4014 ~MEDFileFastCellSupportComparator();
4018 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
4020 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4021 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4022 PyObject *res(PyList_New(result.size()));
4023 for(int i=0;iL!=result.end(); i++, iL++)
4024 PyList_SetItem(res,i,PyInt_FromLong(*iL));