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 void setCellFamilyFieldReading(bool b);
632 void setNodeFamilyFieldReading(bool b);
633 void setCellNameFieldReading(bool b);
634 void setNodeNameFieldReading(bool b);
635 void setCellNumFieldReading(bool b);
636 void setNodeNumFieldReading(bool b);
639 std::string __str__() const throw(INTERP_KERNEL::Exception)
641 std::ostringstream oss;
646 std::string __repr__() const throw(INTERP_KERNEL::Exception)
648 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
654 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
657 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
658 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
659 throw(INTERP_KERNEL::Exception);
660 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
661 INTERP_KERNEL::NormalizedCellType loc_geo_type,
662 INTERP_KERNEL::NormalizedCellType rem_geo_type)
663 throw(INTERP_KERNEL::Exception);
664 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
665 MEDFileJointCorrespondence *deepCopy() const;
666 MEDFileJointCorrespondence *shallowCpy() const;
667 void setIsNodal(bool isNodal);
668 bool getIsNodal() const;
669 bool isEqual(const MEDFileJointCorrespondence *other) const;
670 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
671 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
672 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
673 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
674 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
675 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
676 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);
677 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
680 MEDFileJointCorrespondence()
682 return MEDFileJointCorrespondence::New();
684 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
686 return MEDFileJointCorrespondence::New(correspondence);
688 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
689 INTERP_KERNEL::NormalizedCellType loc_geo_type,
690 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
692 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
695 std::string __str__() const throw(INTERP_KERNEL::Exception)
697 return self->simpleRepr();
702 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
705 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
706 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
707 MEDFileJointOneStep *deepCopy() const;
708 MEDFileJointOneStep *shallowCpy() const;
709 bool isEqual(const MEDFileJointOneStep *other) const;
710 void setOrder(int order);
711 int getOrder() const;
712 void setIteration(int it);
713 int getIteration() const;
714 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
715 int getNumberOfCorrespondences() const;
716 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
717 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
718 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
721 MEDFileJointOneStep()
723 return MEDFileJointOneStep::New();
726 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
728 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
731 std::string __str__() const throw(INTERP_KERNEL::Exception)
733 return self->simpleRepr();
738 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
741 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
742 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
743 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
744 MEDFileJoint *deepCopy() const;
745 MEDFileJoint *shallowCpy() const;
746 bool isEqual(const MEDFileJoint *other) const;
747 void setLocalMeshName(const std::string& name);
748 std::string getLocalMeshName() const;
749 void setRemoteMeshName(const std::string& name);
750 std::string getRemoteMeshName() const;
751 void setDescription(const std::string& name);
752 std::string getDescription() const;
753 void setJointName(const std::string& name);
754 std::string getJointName() const;
755 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
756 void setDomainNumber(const int& number);
757 int getDomainNumber() const;
758 void pushStep(MEDFileJointOneStep* step);
759 int getNumberOfSteps() const;
760 MEDFileJointOneStep *getStepAtPos(int i) const;
761 std::string simpleRepr() const;
766 return MEDFileJoint::New();
769 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
771 return MEDFileJoint::New(fileName,mName,num);
774 std::string __str__() const throw(INTERP_KERNEL::Exception)
776 return self->simpleRepr();
781 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
784 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
785 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
786 MEDFileJoints *deepCopy() const;
787 std::string simpleRepr() const;
788 std::string getMeshName() const;
789 int getNumberOfJoints() const;
790 std::vector<std::string> getJointsNames() const;
791 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
792 void resize(int newSize) throw(INTERP_KERNEL::Exception);
793 void pushJoint(MEDFileJoint *joint);
794 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
795 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
800 return MEDFileJoints::New();
803 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
805 return MEDFileJoints::New(fileName,meshName);
808 std::string __str__() const throw(INTERP_KERNEL::Exception)
810 return self->simpleRepr();
813 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
817 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
822 else if(PyString_Check(obj))
824 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
830 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
833 int __len__() const throw(INTERP_KERNEL::Exception)
835 return self->getNumberOfJoints();
838 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
840 MEDFileJoint *ret=self->getJointAtPos(i);
846 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
848 MEDFileJoint *ret=self->getJointWithName(paramName);
856 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
859 MEDFileEquivalenceBase();
862 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
865 MEDFileEquivalenceData();
867 void setArray(DataArrayInt *data);
870 DataArrayInt *getArray()
872 DataArrayInt *ret(self->getArray());
873 if(ret) ret->incrRef();
879 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
882 MEDFileEquivalenceNode();
885 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
888 MEDFileEquivalenceCell();
891 std::size_t size() const;
892 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
893 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
896 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
898 DataArrayInt *ret(self->getArray(type));
899 if(ret) ret->incrRef();
903 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
905 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
906 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
907 PyObject *res=PyList_New(result.size());
908 for(int i=0;iL!=result.end(); i++, iL++)
909 PyList_SetItem(res,i,PyInt_FromLong(*iL));
915 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
918 MEDFileEquivalencePair();
920 std::string getName() const;
921 void setName(const std::string& name);
922 std::string getDescription() const;
923 void setDescription(const std::string& descr);
924 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
927 MEDFileEquivalenceCell *initCell()
929 MEDFileEquivalenceCell *ret(self->initCell());
930 if(ret) ret->incrRef();
934 MEDFileEquivalenceNode *initNode()
936 MEDFileEquivalenceNode *ret(self->initNode());
937 if(ret) ret->incrRef();
941 MEDFileEquivalenceCell *getCell()
943 MEDFileEquivalenceCell *ret(self->getCell());
944 if(ret) ret->incrRef();
948 MEDFileEquivalenceNode *getNode()
950 MEDFileEquivalenceNode *ret(self->getNode());
951 if(ret) ret->incrRef();
957 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
960 MEDFileEquivalences();
963 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
964 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
965 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
969 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
971 MEDFileEquivalencePair *ret(self->getEquivalence(i));
972 if(ret) ret->incrRef();
975 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
977 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
978 if(ret) ret->incrRef();
982 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
984 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
985 if(ret) ret->incrRef();
991 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
994 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
995 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
996 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
997 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
998 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
999 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
1000 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
1001 void setName(const std::string& name);
1002 std::string getName();
1003 std::string getUnivName() const;
1004 bool getUnivNameWrStatus() const;
1005 void setUnivNameWrStatus(bool newStatus);
1006 void setDescription(const std::string& name);
1007 std::string getDescription() const;
1008 void setOrder(int order);
1009 int getOrder() const;
1010 void setIteration(int it);
1012 void setTimeValue(double time);
1013 void setTime(int dt, int it, double time);
1014 double getTimeValue() const;
1015 void setTimeUnit(const std::string& unit);
1016 std::string getTimeUnit() const;
1017 void setAxisType(MEDCouplingAxisType at);
1018 MEDCouplingAxisType getAxisType() const;
1019 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
1020 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1021 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
1022 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1023 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
1024 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
1025 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1026 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1027 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1028 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
1029 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
1030 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
1031 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1032 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1034 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
1035 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
1036 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1037 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1038 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1039 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1040 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1041 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1042 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1043 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1044 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1045 void clearFamMap() throw(INTERP_KERNEL::Exception);
1046 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1047 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1048 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1049 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1050 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1051 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1052 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1053 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1054 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1055 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1056 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1057 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1058 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1059 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1060 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1061 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1062 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1063 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1064 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1065 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1066 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1067 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1068 static std::string GetMagicFamilyStr();
1069 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1070 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1071 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1072 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1073 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1074 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1075 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1076 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1077 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1078 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1079 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1080 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1081 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1082 void setFamilyInfo(const std::map<std::string,int>& info);
1083 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1084 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1085 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1086 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1087 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1088 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1089 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1090 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1091 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1092 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1093 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1094 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1095 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1096 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1097 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1098 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1099 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1100 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1101 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1102 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1103 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1105 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1106 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1107 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1108 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1109 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1110 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1111 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1112 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1113 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1114 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1115 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1116 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1117 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1118 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1119 int getNumberOfJoints();
1120 MEDFileJoints *getJoints();
1121 void setJoints( MEDFileJoints* joints );
1122 void initializeEquivalences();
1123 void killEquivalences();
1124 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1125 void killStructureElements() throw(INTERP_KERNEL::Exception);
1128 std::string __str__() const throw(INTERP_KERNEL::Exception)
1130 return self->simpleRepr();
1133 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1135 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1138 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1141 double tmp0=self->getTime(tmp1,tmp2);
1142 PyObject *res = PyList_New(3);
1143 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1144 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1145 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1149 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1152 bool ret0=self->isEqual(other,eps,what);
1153 PyObject *res=PyList_New(2);
1154 PyObject *ret0Py=ret0?Py_True:Py_False;
1156 PyList_SetItem(res,0,ret0Py);
1157 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1161 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1163 std::vector<const DataArrayInt *> grps;
1164 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1165 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1168 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1171 bool ret0=self->areFamsEqual(other,what);
1172 PyObject *res=PyList_New(2);
1173 PyObject *ret0Py=ret0?Py_True:Py_False;
1175 PyList_SetItem(res,0,ret0Py);
1176 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1180 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1183 bool ret0=self->areGrpsEqual(other,what);
1184 PyObject *res=PyList_New(2);
1185 PyObject *ret0Py=ret0?Py_True:Py_False;
1187 PyList_SetItem(res,0,ret0Py);
1188 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1192 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1194 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1195 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1196 PyObject *res=PyList_New(result.size());
1197 for(int i=0;iL!=result.end(); i++, iL++)
1198 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1202 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1204 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1205 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1206 PyObject *res=PyList_New(result.size());
1207 for(int i=0;iL!=result.end(); i++, iL++)
1208 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1212 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1214 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1217 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1220 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1222 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1225 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1228 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1230 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1233 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1236 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1238 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1241 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1244 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1246 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1249 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1252 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1255 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1256 PyObject *ret=PyTuple_New(2);
1257 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1258 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1262 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1264 DataArrayInt *ret3=0;
1265 std::vector<int> ret1,ret2;
1266 bool ret0=self->unPolyze(ret1,ret2,ret3);
1267 PyObject *ret=PyTuple_New(4);
1268 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1270 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1271 for(int j=0;j<(int)ret1.size()/3;j++)
1273 PyObject *retLev2=PyList_New(3);
1274 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1275 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1276 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1277 PyList_SetItem(retLev1_0,j,retLev2);
1279 PyTuple_SetItem(ret,1,retLev1_0);
1281 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1282 for(int j=0;j<(int)ret2.size()/3;j++)
1284 PyObject *retLev2=PyList_New(3);
1285 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1286 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1287 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1288 PyList_SetItem(retLev1_1,j,retLev2);
1290 PyTuple_SetItem(ret,2,retLev1_1);
1292 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1296 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1298 MEDFileEquivalences *ret(self->getEquivalences());
1299 if(ret) ret->incrRef();
1305 class MEDFileUMesh : public MEDFileMesh
1308 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1309 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1310 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1311 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1312 static MEDFileUMesh *New();
1313 static const char *GetSpeStr4ExtMesh();
1315 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1316 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1317 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1318 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1319 void clearNodeAndCellNumbers();
1321 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1322 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1323 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1324 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1325 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1326 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1327 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1328 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1329 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1330 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1332 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1333 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1334 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1335 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1336 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1337 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1338 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1339 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1340 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1341 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1342 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1343 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1344 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1345 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1346 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1349 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1351 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1354 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1356 return MEDFileUMesh::New(fileName,mrs);
1359 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1361 return MEDFileUMesh::New(mem);
1364 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1366 return MEDFileUMesh::New(db);
1371 return MEDFileUMesh::New();
1375 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1377 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1380 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)
1382 std::vector<int> typesCpp1;
1383 convertPyToNewIntArr3(types,typesCpp1);
1384 std::size_t sz(typesCpp1.size());
1385 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1386 for(std::size_t ii=0;ii<sz;ii++)
1387 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1388 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1391 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1392 {// put an empty dict in input to say to __new__ to call __init__...
1393 PyObject *ret(PyTuple_New(1));
1394 PyObject *ret0(PyDict_New());
1395 PyTuple_SetItem(ret,0,ret0);
1399 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1401 std::vector<double> a0;
1402 std::vector<int> a1;
1403 std::vector<std::string> a2;
1404 std::vector< MCAuto<DataArrayInt> > a3;
1405 MCAuto<DataArrayDouble> a4;
1406 self->serialize(a0,a1,a2,a3,a4);
1407 PyObject *ret(PyTuple_New(5));
1408 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1409 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1411 PyObject *ret2(PyList_New(sz));
1412 for(int i=0;i<sz;i++)
1413 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1414 PyTuple_SetItem(ret,2,ret2);
1416 PyObject *ret3(PyList_New(sz));
1417 for(int i=0;i<sz;i++)
1419 DataArrayInt *elt(a3[i]);
1422 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1424 PyTuple_SetItem(ret,3,ret3);
1425 DataArrayDouble *ret4(a4);
1428 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1432 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1434 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1435 if(!PyTuple_Check(inp))
1436 throw INTERP_KERNEL::Exception(MSG);
1437 int sz(PyTuple_Size(inp));
1439 throw INTERP_KERNEL::Exception(MSG);
1440 std::vector<double> a0;
1441 std::vector<int> a1;
1442 std::vector<std::string> a2;
1443 std::vector< MCAuto<DataArrayInt> > a3;
1444 MCAuto<DataArrayDouble> a4;
1446 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1448 fillArrayWithPyListDbl3(a0py,tmp,a0);
1449 convertPyToNewIntArr3(a1py,a1);
1450 fillStringVector(a2py,a2);
1452 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1454 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1455 if(!SWIG_IsOK(status))
1456 throw INTERP_KERNEL::Exception(MSG);
1457 a4=reinterpret_cast<DataArrayDouble *>(argp);
1458 if((DataArrayDouble *)a4)
1461 std::vector< DataArrayInt * > a3Tmp;
1462 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1463 std::size_t sz(a3Tmp.size());
1465 for(std::size_t i=0;i<sz;i++)
1469 a3Tmp[i]->incrRef();
1471 self->unserialize(a0,a1,a2,a3,a4);
1475 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1478 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1479 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1482 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1485 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1488 self->setMeshAtLevel(meshDimRelToMax,m1);
1491 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1494 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1496 self->removeMeshAtLevel(meshDimRelToMax);
1499 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1501 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1503 DataArrayDouble *a,*a2;
1504 DataArrayDoubleTuple *aa,*aa2;
1505 std::vector<double> bb,bb2;
1507 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1508 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1509 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1513 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1515 std::vector<const MEDFileUMesh *> meshesCpp;
1516 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1517 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1521 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1523 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1524 return convertVecPairIntToPy(ret);
1527 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1529 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1530 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1531 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1534 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1536 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1537 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1538 return self->extractPart(extractDefCpp);
1541 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1543 std::vector<const MEDCouplingUMesh *> ms;
1544 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1545 self->setMeshes(ms,renum);
1548 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1550 std::vector<const MEDCouplingUMesh *> ms;
1551 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1552 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1555 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1557 std::vector<const MEDCouplingUMesh *> ms;
1558 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1559 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1562 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1564 DataArrayDouble *ret=self->getCoords();
1570 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1572 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1575 return const_cast<PartDefinition *>(ret);
1578 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1580 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1581 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1582 PyObject *ret=PyTuple_New(3);
1583 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1584 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1585 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1589 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1591 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1597 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1599 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1600 std::size_t sz(tmp.size());
1601 PyObject *ret=PyList_New(sz);
1602 for(std::size_t i=0;i<sz;i++)
1606 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1613 class MEDFileStructuredMesh : public MEDFileMesh
1618 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1620 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1628 class MEDFileCMesh : public MEDFileStructuredMesh
1631 static MEDFileCMesh *New();
1632 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1633 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1634 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1635 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1636 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1641 return MEDFileCMesh::New();
1644 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1646 return MEDFileCMesh::New(fileName,mrs);
1649 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1651 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1654 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1656 return MEDFileCMesh::New(db);
1660 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1662 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1665 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1667 const MEDCouplingCMesh *tmp=self->getMesh();
1670 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1675 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1678 static MEDFileCurveLinearMesh *New();
1679 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1680 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1681 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1682 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1685 MEDFileCurveLinearMesh()
1687 return MEDFileCurveLinearMesh::New();
1690 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1692 return MEDFileCurveLinearMesh::New(fileName,mrs);
1695 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1697 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1700 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1702 return MEDFileCurveLinearMesh::New(db);
1706 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1708 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1711 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1713 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1716 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1721 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1724 static MEDFileMeshMultiTS *New();
1725 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1726 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1727 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1728 std::string getName() const throw(INTERP_KERNEL::Exception);
1729 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1730 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1733 MEDFileMeshMultiTS()
1735 return MEDFileMeshMultiTS::New();
1738 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1740 return MEDFileMeshMultiTS::New(fileName);
1743 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1745 return MEDFileMeshMultiTS::New(fileName,mName);
1748 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1750 MEDFileMesh *ret=self->getOneTimeStep();
1758 class MEDFileMeshesIterator
1763 PyObject *next() throw(INTERP_KERNEL::Exception)
1765 MEDFileMesh *ret=self->nextt();
1769 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1773 PyErr_SetString(PyExc_StopIteration,"No more data.");
1780 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1783 static MEDFileMeshes *New();
1784 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1785 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1786 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1787 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1789 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1790 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1791 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1792 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1793 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1794 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1795 void killStructureElements() throw(INTERP_KERNEL::Exception);
1800 return MEDFileMeshes::New();
1803 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1805 return MEDFileMeshes::New(fileName);
1808 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1810 return MEDFileMeshes::New(db);
1814 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1816 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1819 std::string __str__() const throw(INTERP_KERNEL::Exception)
1821 return self->simpleRepr();
1824 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1826 if(PyInt_Check(obj))
1828 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1833 else if(PyString_Check(obj))
1835 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1841 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1844 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1846 self->setMeshAtPos(obj,mesh);
1850 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1852 return self->iterator();
1855 int __len__() const throw(INTERP_KERNEL::Exception)
1857 return self->getNumberOfMeshes();
1860 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1862 MEDFileMesh *ret=self->getMeshAtPos(i);
1867 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1869 MEDFileMesh *ret=self->getMeshWithName(mname);
1877 class MEDFileFieldLoc : public RefCountObject
1880 std::string getName() const;
1881 int getDimension() const;
1882 int getNumberOfGaussPoints() const;
1883 int getNumberOfPointsInCells() const;
1884 const std::vector<double>& getRefCoords() const;
1885 const std::vector<double>& getGaussCoords() const;
1886 const std::vector<double>& getGaussWeights() const;
1887 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1890 std::string __str__() const throw(INTERP_KERNEL::Exception)
1892 return self->repr();
1897 class MEDFileFieldGlobsReal
1900 void resetContent();
1901 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1902 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1903 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1904 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1905 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1906 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1907 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1908 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1909 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1910 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1911 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1912 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1913 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1914 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1915 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1916 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1917 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1918 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1919 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1920 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1921 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1922 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1923 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1924 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1925 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1926 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1927 void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
1930 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1932 const DataArrayInt *ret=self->getProfile(pflName);
1935 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1938 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1940 const DataArrayInt *ret=self->getProfileFromId(pflId);
1943 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1946 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1948 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1951 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1954 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1956 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1959 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1962 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1964 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1965 return convertVecPairVecStToPy(ret);
1968 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1970 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1971 return convertVecPairVecStToPy(ret);
1974 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1976 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1977 self->changePflsNames(v);
1980 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1982 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1983 self->changePflsRefsNamesGen(v);
1986 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1988 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1989 self->changePflsNamesInStruct(v);
1992 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1994 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1995 self->changeLocsNames(v);
1998 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
2000 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2001 self->changeLocsRefsNamesGen(v);
2004 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2006 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2007 self->changeLocsNamesInStruct(v);
2010 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
2012 std::ostringstream oss;
2013 self->simpleReprGlobs(oss);
2019 class MEDFileEntities
2024 static MEDFileEntities *BuildFrom(PyObject *entities) throw(INTERP_KERNEL::Exception)
2026 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2027 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2029 std::size_t sz(inp0.size());
2031 for(std::size_t i=0;i<sz;i++)
2032 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2034 return MEDFileEntities::BuildFrom(&inp);
2041 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2044 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2045 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2046 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2047 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
2048 void loadArrays() throw(INTERP_KERNEL::Exception);
2049 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2050 void unloadArrays() throw(INTERP_KERNEL::Exception);
2051 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2052 int getDimension() const throw(INTERP_KERNEL::Exception);
2053 int getIteration() const throw(INTERP_KERNEL::Exception);
2054 int getOrder() const throw(INTERP_KERNEL::Exception);
2055 std::string getName() throw(INTERP_KERNEL::Exception);
2056 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2057 std::string getMeshName() throw(INTERP_KERNEL::Exception);
2058 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2059 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2060 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2061 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2062 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2063 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2064 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2065 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2066 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2067 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2068 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2069 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2070 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2073 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2076 double tmp0=self->getTime(tmp1,tmp2);
2077 PyObject *res = PyList_New(3);
2078 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2079 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2080 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2084 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2086 std::pair<int,int> res=self->getDtIt();
2087 PyObject *elt=PyTuple_New(2);
2088 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2089 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2093 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2095 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2098 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2100 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2103 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2105 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2106 return self->changeMeshNames(modifTab);
2109 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2111 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2112 PyObject *ret2=PyList_New(ret.size());
2113 for(int i=0;i<(int)ret.size();i++)
2114 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2118 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2120 std::vector<int> ret1;
2121 int ret0=self->getNonEmptyLevels(mname,ret1);
2122 PyObject *elt=PyTuple_New(2);
2123 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2124 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2128 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2130 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2131 std::vector< std::vector<TypeOfField> > typesF;
2132 std::vector< std::vector<std::string> > pfls;
2133 std::vector< std::vector<std::string> > locs;
2134 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2136 PyObject *ret2=PyList_New(sz);
2137 for(int i=0;i<sz;i++)
2139 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2140 const std::vector<TypeOfField>& typesFI=typesF[i];
2141 const std::vector<std::string>& pflsI=pfls[i];
2142 const std::vector<std::string>& locsI=locs[i];
2143 PyObject *elt=PyTuple_New(2);
2144 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2145 int sz2=ret[i].size();
2146 PyObject *elt2=PyList_New(sz2);
2147 for(int j=0;j<sz2;j++)
2149 PyObject *elt3=PyTuple_New(4);
2150 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2151 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));
2152 PyTuple_SetItem(elt3,1,elt4);
2153 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2154 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2155 PyList_SetItem(elt2,j,elt3);
2157 PyTuple_SetItem(elt,1,elt2);
2158 PyList_SetItem(ret2,i,elt);
2163 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2165 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2166 std::size_t sz=ret.size();
2167 PyObject *retPy=PyList_New(sz);
2168 for(std::size_t i=0;i<sz;i++)
2169 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2173 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2175 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2176 std::size_t sz=ret.size();
2177 PyObject *retPy=PyList_New(sz);
2178 for(std::size_t i=0;i<sz;i++)
2179 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2183 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2185 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2186 std::size_t sz=ret.size();
2187 PyObject *retPy=PyList_New(sz);
2188 for(std::size_t i=0;i<sz;i++)
2189 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2193 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2195 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2196 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2197 return self->extractPart(extractDefCpp,mm);
2202 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2205 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2206 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2207 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2208 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2209 static MEDFileField1TS *New();
2210 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2211 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2212 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2213 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2214 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2215 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2216 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2218 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2219 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2220 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2221 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2224 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2226 return MEDFileField1TS::New(fileName,loadAll);
2229 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2231 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2234 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2236 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2239 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2241 return MEDFileField1TS::New(db);
2246 return MEDFileField1TS::New();
2250 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2252 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2255 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2257 const DataArrayDouble *arr=0;
2259 arr=field->getArray();
2260 self->copyTinyInfoFrom(field,arr);
2263 std::string __str__() const throw(INTERP_KERNEL::Exception)
2265 return self->simpleRepr();
2268 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2270 DataArrayInt *ret1=0;
2271 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2272 PyObject *ret=PyTuple_New(2);
2273 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2274 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2278 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2280 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2281 std::vector< std::vector<TypeOfField> > typesF;
2282 std::vector< std::vector<std::string> > pfls;
2283 std::vector< std::vector<std::string> > locs;
2284 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2286 PyObject *ret2=PyList_New(sz);
2287 for(int i=0;i<sz;i++)
2289 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2290 const std::vector<TypeOfField>& typesFI=typesF[i];
2291 const std::vector<std::string>& pflsI=pfls[i];
2292 const std::vector<std::string>& locsI=locs[i];
2293 PyObject *elt=PyTuple_New(2);
2294 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2295 int sz2=ret[i].size();
2296 PyObject *elt2=PyList_New(sz2);
2297 for(int j=0;j<sz2;j++)
2299 PyObject *elt3=PyTuple_New(4);
2300 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2301 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2302 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2303 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2304 PyList_SetItem(elt2,j,elt3);
2306 PyTuple_SetItem(elt,1,elt2);
2307 PyList_SetItem(ret2,i,elt);
2312 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2314 DataArrayDouble *ret=self->getUndergroundDataArray();
2320 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2322 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2323 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2326 PyObject *ret=PyTuple_New(2);
2327 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2328 std::size_t sz=elt1Cpp.size();
2329 PyObject *elt=PyList_New(sz);
2330 for(std::size_t i=0;i<sz;i++)
2332 PyObject *elt1=PyTuple_New(2);
2333 PyObject *elt2=PyTuple_New(2);
2334 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2335 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2336 PyObject *elt3=PyTuple_New(2);
2337 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2338 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2339 PyTuple_SetItem(elt1,0,elt2);
2340 PyTuple_SetItem(elt1,1,elt3);
2341 PyList_SetItem(elt,i,elt1);
2343 PyTuple_SetItem(ret,1,elt);
2349 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2352 static MEDFileIntField1TS *New();
2353 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2354 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2355 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2356 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2357 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2359 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2360 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2361 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2362 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2363 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2364 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2365 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2366 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2369 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2371 return MEDFileIntField1TS::New();
2374 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2376 return MEDFileIntField1TS::New(fileName,loadAll);
2379 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2381 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2384 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2386 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2389 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2391 return MEDFileIntField1TS::New(db);
2395 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2397 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2400 std::string __str__() const throw(INTERP_KERNEL::Exception)
2402 return self->simpleRepr();
2405 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2407 DataArrayInt *ret1=0;
2408 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2409 PyObject *ret=PyTuple_New(2);
2410 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2411 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2415 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2417 DataArrayInt *ret=self->getUndergroundDataArray();
2425 class MEDFileAnyTypeFieldMultiTSIterator
2430 PyObject *next() throw(INTERP_KERNEL::Exception)
2432 MEDFileAnyTypeField1TS *ret=self->nextt();
2434 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2437 PyErr_SetString(PyExc_StopIteration,"No more data.");
2444 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2447 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2448 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2449 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2450 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2451 std::string getName() const throw(INTERP_KERNEL::Exception);
2452 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2453 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2454 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2455 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2456 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2457 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2458 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2459 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2460 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2461 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2462 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2463 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2464 void loadArrays() throw(INTERP_KERNEL::Exception);
2465 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2466 void unloadArrays() throw(INTERP_KERNEL::Exception);
2467 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2469 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2470 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2471 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2472 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2473 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2474 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2477 int __len__() const throw(INTERP_KERNEL::Exception)
2479 return self->getNumberOfTS();
2482 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2484 if(elt0 && PyInt_Check(elt0))
2486 int pos=PyInt_AS_LONG(elt0);
2489 else if(elt0 && PyTuple_Check(elt0))
2491 if(PyTuple_Size(elt0)==2)
2493 PyObject *o0=PyTuple_GetItem(elt0,0);
2494 PyObject *o1=PyTuple_GetItem(elt0,1);
2495 if(PyInt_Check(o0) && PyInt_Check(o1))
2497 int iter=PyInt_AS_LONG(o0);
2498 int order=PyInt_AS_LONG(o1);
2499 return self->getPosOfTimeStep(iter,order);
2502 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 !");
2505 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 !");
2507 else if(elt0 && PyFloat_Check(elt0))
2509 double val=PyFloat_AS_DOUBLE(elt0);
2510 return self->getPosGivenTime(val);
2513 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2516 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2518 std::vector< std::pair<int,int> > res(self->getIterations());
2519 return convertVecPairIntToPy(res);
2522 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2524 std::vector<double> ret1;
2525 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2526 std::size_t sz=ret.size();
2527 PyObject *ret2=PyList_New(sz);
2528 for(std::size_t i=0;i<sz;i++)
2530 PyObject *elt=PyTuple_New(3);
2531 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2532 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2533 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2534 PyList_SetItem(ret2,i,elt);
2539 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2541 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2542 PyObject *ret2=PyList_New(ret.size());
2543 for(int i=0;i<(int)ret.size();i++)
2545 const std::vector<TypeOfField>& rett=ret[i];
2546 PyObject *ret3=PyList_New(rett.size());
2547 for(int j=0;j<(int)rett.size();j++)
2548 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2549 PyList_SetItem(ret2,i,ret3);
2554 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2556 std::vector<int> ret1;
2557 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2558 PyObject *elt=PyTuple_New(2);
2559 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2560 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2564 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2566 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2567 std::vector< std::vector<TypeOfField> > typesF;
2568 std::vector< std::vector<std::string> > pfls;
2569 std::vector< std::vector<std::string> > locs;
2570 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2572 PyObject *ret2=PyList_New(sz);
2573 for(int i=0;i<sz;i++)
2575 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2576 const std::vector<TypeOfField>& typesFI=typesF[i];
2577 const std::vector<std::string>& pflsI=pfls[i];
2578 const std::vector<std::string>& locsI=locs[i];
2579 PyObject *elt=PyTuple_New(2);
2580 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2581 int sz2=ret[i].size();
2582 PyObject *elt2=PyList_New(sz2);
2583 for(int j=0;j<sz2;j++)
2585 PyObject *elt3=PyTuple_New(4);
2586 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2587 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));
2588 PyTuple_SetItem(elt3,1,elt4);
2589 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2590 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2591 PyList_SetItem(elt2,j,elt3);
2593 PyTuple_SetItem(elt,1,elt2);
2594 PyList_SetItem(ret2,i,elt);
2599 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2601 if(PyList_Check(elts))
2603 int sz=PyList_Size(elts);
2604 std::vector<int> ret(sz);
2605 for(int i=0;i<sz;i++)
2607 PyObject *elt=PyList_GetItem(elts,i);
2608 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2614 std::vector<int> ret(1);
2615 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2620 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2622 if(PySlice_Check(elts))
2624 Py_ssize_t strt=2,stp=2,step=2;
2625 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2626 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2627 self->eraseTimeStepIds2(strt,stp,step);
2631 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2632 if(!idsToRemove.empty())
2633 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2637 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2641 std::vector<int> pos2;
2642 DataArrayInt *pos3=0;
2643 DataArrayIntTuple *pos4=0;
2644 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2649 self->eraseTimeStepIds(&pos1,&pos1+1);
2656 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2661 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2665 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2669 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2671 return self->iterator();
2674 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2676 if(elt0 && PyList_Check(elt0))
2678 int sz=PyList_Size(elt0);
2679 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2680 int *pt=da->getPointer();
2681 for(int i=0;i<sz;i++,pt++)
2683 PyObject *elt1=PyList_GetItem(elt0,i);
2684 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2686 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2688 else if(elt0 && PySlice_Check(elt0))
2690 Py_ssize_t strt=2,stp=2,step=2;
2691 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2692 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2693 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2696 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2699 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2701 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2702 return self->changeMeshNames(modifTab);
2705 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2707 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2708 std::size_t sz=ret.size();
2709 PyObject *retPy=PyList_New(sz);
2710 for(std::size_t i=0;i<sz;i++)
2711 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2715 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2717 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2718 std::size_t sz=ret.size();
2719 PyObject *retPy=PyList_New(sz);
2720 for(std::size_t i=0;i<sz;i++)
2721 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2725 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2727 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2728 std::size_t sz=ret.size();
2729 PyObject *retPy=PyList_New(sz);
2730 for(std::size_t i=0;i<sz;i++)
2731 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2735 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2738 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2739 if(SWIG_IsOK(status))
2741 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2745 std::vector<MEDFileAnyTypeField1TS *> tmp;
2746 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2747 self->pushBackTimeSteps(tmp);
2751 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2753 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2754 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2755 return self->extractPart(extractDefCpp,mm);
2758 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2760 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2761 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2762 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2763 std::size_t sz=ret.size();
2764 PyObject *retPy=PyList_New(sz);
2765 for(std::size_t i=0;i<sz;i++)
2767 std::size_t sz2=ret[i].size();
2768 PyObject *ret1Py=PyList_New(sz2);
2769 for(std::size_t j=0;j<sz2;j++)
2771 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2774 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2776 PyList_SetItem(retPy,i,ret1Py);
2781 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2783 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2784 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2785 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2786 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2787 if(ret2.size()!=ret.size())
2789 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2790 throw INTERP_KERNEL::Exception(oss.str().c_str());
2792 std::size_t sz=ret.size();
2793 PyObject *retPy=PyList_New(sz);
2794 for(std::size_t i=0;i<sz;i++)
2796 std::size_t sz2=ret[i].size();
2797 PyObject *ret0Py=PyTuple_New(2);
2798 PyObject *ret1Py=PyList_New(sz2);
2799 for(std::size_t j=0;j<sz2;j++)
2801 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2804 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2806 PyTuple_SetItem(ret0Py,0,ret1Py);
2807 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2808 PyList_SetItem(retPy,i,ret0Py);
2815 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2818 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2819 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2820 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2821 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2823 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2824 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2825 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2826 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2827 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2828 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2830 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2831 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2832 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2835 MEDFileFieldMultiTS()
2837 return MEDFileFieldMultiTS::New();
2840 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2842 return MEDFileFieldMultiTS::New(fileName,loadAll);
2845 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2847 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2850 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2852 return MEDFileFieldMultiTS::New(db);
2856 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2858 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2861 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2863 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2864 std::size_t sz(tmp.size());
2865 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2866 for(std::size_t i=0;i<sz;i++)
2868 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2869 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2871 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2874 std::string __str__() const throw(INTERP_KERNEL::Exception)
2876 return self->simpleRepr();
2879 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2881 DataArrayInt *ret1=0;
2882 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2883 PyObject *ret=PyTuple_New(2);
2884 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2885 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2889 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2891 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2892 std::vector< std::vector<TypeOfField> > typesF;
2893 std::vector< std::vector<std::string> > pfls;
2894 std::vector< std::vector<std::string> > locs;
2895 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2897 PyObject *ret2=PyList_New(sz);
2898 for(int i=0;i<sz;i++)
2900 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2901 const std::vector<TypeOfField>& typesFI=typesF[i];
2902 const std::vector<std::string>& pflsI=pfls[i];
2903 const std::vector<std::string>& locsI=locs[i];
2904 PyObject *elt=PyTuple_New(2);
2905 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2906 int sz2=ret[i].size();
2907 PyObject *elt2=PyList_New(sz2);
2908 for(int j=0;j<sz2;j++)
2910 PyObject *elt3=PyTuple_New(4);
2911 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2912 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2913 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2914 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2915 PyList_SetItem(elt2,j,elt3);
2917 PyTuple_SetItem(elt,1,elt2);
2918 PyList_SetItem(ret2,i,elt);
2922 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2924 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2930 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2932 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2933 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2936 PyObject *ret=PyTuple_New(2);
2937 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2938 std::size_t sz=elt1Cpp.size();
2939 PyObject *elt=PyList_New(sz);
2940 for(std::size_t i=0;i<sz;i++)
2942 PyObject *elt1=PyTuple_New(2);
2943 PyObject *elt2=PyTuple_New(2);
2944 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2945 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2946 PyObject *elt3=PyTuple_New(2);
2947 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2948 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2949 PyTuple_SetItem(elt1,0,elt2);
2950 PyTuple_SetItem(elt1,1,elt3);
2951 PyList_SetItem(elt,i,elt1);
2953 PyTuple_SetItem(ret,1,elt);
2959 class MEDFileFieldsIterator
2964 PyObject *next() throw(INTERP_KERNEL::Exception)
2966 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2968 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2971 PyErr_SetString(PyExc_StopIteration,"No more data.");
2978 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2981 static MEDFileIntFieldMultiTS *New();
2982 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2983 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2984 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2986 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2987 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2988 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2989 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2990 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2991 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2992 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2993 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2994 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2997 MEDFileIntFieldMultiTS()
2999 return MEDFileIntFieldMultiTS::New();
3002 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3004 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
3007 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3009 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
3012 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3014 return MEDFileIntFieldMultiTS::New(db);
3018 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3020 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
3023 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3025 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3026 std::size_t sz(tmp.size());
3027 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3028 for(std::size_t i=0;i<sz;i++)
3030 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3031 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3033 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3036 std::string __str__() const throw(INTERP_KERNEL::Exception)
3038 return self->simpleRepr();
3041 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3043 DataArrayInt *ret1=0;
3044 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3045 PyObject *ret=PyTuple_New(2);
3046 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3047 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3051 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3053 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3061 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3064 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3065 std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3068 MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3070 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3071 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3079 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3082 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3084 MEDFileStructureElements();
3087 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3090 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3091 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3092 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3093 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
3094 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3095 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3096 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3097 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3098 void loadArrays() throw(INTERP_KERNEL::Exception);
3099 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3100 void unloadArrays() throw(INTERP_KERNEL::Exception);
3101 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3102 int getNumberOfFields() const;
3103 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3104 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3106 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3107 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3108 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3109 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3110 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3111 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3112 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3113 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3114 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3115 void killStructureElements() throw(INTERP_KERNEL::Exception);
3116 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3117 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3118 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3119 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3120 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3125 return MEDFileFields::New();
3128 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3130 return MEDFileFields::New(fileName,loadAll);
3133 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3135 return MEDFileFields::New(db);
3138 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
3140 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3144 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3146 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3149 std::string __str__() const throw(INTERP_KERNEL::Exception)
3151 return self->simpleRepr();
3154 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3156 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3160 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3162 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3166 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3168 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3169 std::size_t sz(tmp.size());
3170 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3171 for(std::size_t i=0;i<sz;i++)
3173 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3174 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3176 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3179 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3181 std::vector< std::pair<std::string,std::string> > ps;
3182 self->getMeshSENames(ps);
3183 return convertVectPairStToPy(ps);
3186 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3189 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3190 PyObject *ret=PyTuple_New(2);
3191 PyObject *ret_0=PyList_New(ret0.size());
3193 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3195 PyObject *elt=PyTuple_New(2);
3196 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3197 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3198 PyList_SetItem(ret_0,rk,elt);
3200 PyTuple_SetItem(ret,0,ret_0);
3201 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3202 PyTuple_SetItem(ret,1,ret_1);
3206 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3208 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3209 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3212 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3214 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3215 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3218 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3220 if(obj && PyList_Check(obj))
3222 int sz=PyList_Size(obj);
3223 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3224 int *pt=da->getPointer();
3225 for(int i=0;i<sz;i++,pt++)
3227 PyObject *elt1=PyList_GetItem(obj,i);
3228 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3230 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3233 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3236 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3238 self->setFieldAtPos(obj,field);
3242 int __len__() const throw(INTERP_KERNEL::Exception)
3244 return self->getNumberOfFields();
3247 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3249 return self->iterator();
3252 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3254 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3255 return self->changeMeshNames(modifTab);
3258 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3260 if(elt0 && PyInt_Check(elt0))
3262 return PyInt_AS_LONG(elt0);
3264 else if(elt0 && PyString_Check(elt0))
3265 return self->getPosFromFieldName(PyString_AsString(elt0));
3267 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3270 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3272 if(PyList_Check(elts))
3274 int sz=PyList_Size(elts);
3275 std::vector<int> ret(sz);
3276 for(int i=0;i<sz;i++)
3278 PyObject *elt=PyList_GetItem(elts,i);
3279 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3285 std::vector<int> ret(1);
3286 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3291 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3293 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3294 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3295 self->pushFields(tmp);
3298 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3300 if(elts && PySlice_Check(elts))
3302 Py_ssize_t strt=2,stp=2,step=2;
3303 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3304 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3305 self->destroyFieldsAtPos2(strt,stp,step);
3309 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3310 if(!idsToRemove.empty())
3311 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3315 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3317 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3318 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3319 return self->extractPart(extractDefCpp,mm);
3324 class MEDFileParameter1TS : public RefCountObject
3327 void setIteration(int it);
3328 int getIteration() const;
3329 void setOrder(int order);
3330 int getOrder() const;
3331 void setTimeValue(double time);
3332 void setTime(int dt, int it, double time);
3333 double getTime(int& dt, int& it);
3334 double getTimeValue() const;
3337 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3340 void setValue(double val) throw(INTERP_KERNEL::Exception);
3341 double getValue() const throw(INTERP_KERNEL::Exception);
3342 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3345 std::string __str__() const throw(INTERP_KERNEL::Exception)
3347 return self->simpleRepr();
3352 class MEDFileParameterTinyInfo : public MEDFileWritable
3355 void setDescription(const std::string& name);
3356 std::string getDescription() const;
3357 void setTimeUnit(const std::string& unit);
3358 std::string getTimeUnit() const;
3361 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3364 static MEDFileParameterDouble1TS *New();
3365 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3366 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3367 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3368 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3369 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3370 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3371 std::string getName() const throw(INTERP_KERNEL::Exception);
3372 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3375 MEDFileParameterDouble1TS()
3377 return MEDFileParameterDouble1TS::New();
3380 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3382 return MEDFileParameterDouble1TS::New(fileName);
3385 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3387 return MEDFileParameterDouble1TS::New(fileName,paramName);
3390 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3392 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3395 std::string __str__() const throw(INTERP_KERNEL::Exception)
3397 return self->simpleRepr();
3400 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3403 bool ret0=self->isEqual(other,eps,what);
3404 PyObject *res=PyList_New(2);
3405 PyObject *ret0Py=ret0?Py_True:Py_False;
3407 PyList_SetItem(res,0,ret0Py);
3408 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3414 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3417 static MEDFileParameterMultiTS *New();
3418 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3419 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3420 std::string getName() const;
3421 void setName(const std::string& name);
3422 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3423 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3424 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3425 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3426 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3427 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3428 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3429 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3432 MEDFileParameterMultiTS()
3434 return MEDFileParameterMultiTS::New();
3437 MEDFileParameterMultiTS(const std::string& fileName)
3439 return MEDFileParameterMultiTS::New(fileName);
3442 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3444 return MEDFileParameterMultiTS::New(fileName,paramName);
3447 std::string __str__() const throw(INTERP_KERNEL::Exception)
3449 return self->simpleRepr();
3452 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3455 bool ret0=self->isEqual(other,eps,what);
3456 PyObject *res=PyList_New(2);
3457 PyObject *ret0Py=ret0?Py_True:Py_False;
3459 PyList_SetItem(res,0,ret0Py);
3460 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3464 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3468 std::vector<int> pos2;
3469 DataArrayInt *pos3=0;
3470 DataArrayIntTuple *pos4=0;
3471 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3476 self->eraseTimeStepIds(&pos1,&pos1+1);
3483 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3488 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3492 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3496 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3498 if(elt0 && PyInt_Check(elt0))
3500 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3503 else if(elt0 && PyTuple_Check(elt0))
3505 if(PyTuple_Size(elt0)==2)
3507 PyObject *o0=PyTuple_GetItem(elt0,0);
3508 PyObject *o1=PyTuple_GetItem(elt0,1);
3509 if(PyInt_Check(o0) && PyInt_Check(o1))
3511 int iter=PyInt_AS_LONG(o0);
3512 int order=PyInt_AS_LONG(o1);
3513 return self->getPosOfTimeStep(iter,order);
3516 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 !");
3519 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 !");
3521 else if(elt0 && PyFloat_Check(elt0))
3523 double val=PyFloat_AS_DOUBLE(elt0);
3524 return self->getPosGivenTime(val);
3527 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3530 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3532 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3538 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3540 if(PyList_Check(elts))
3542 int sz=PyList_Size(elts);
3543 std::vector<int> ret(sz);
3544 for(int i=0;i<sz;i++)
3546 PyObject *elt=PyList_GetItem(elts,i);
3547 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3553 std::vector<int> ret(1);
3554 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3559 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3561 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3562 if(!idsToRemove.empty())
3563 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3566 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3568 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3574 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3576 std::vector< std::pair<int,int> > res=self->getIterations();
3577 PyObject *ret=PyList_New(res.size());
3579 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3581 PyObject *elt=PyTuple_New(2);
3582 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3583 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3584 PyList_SetItem(ret,rk,elt);
3589 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3591 std::vector<double> res2;
3592 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3593 PyObject *ret=PyList_New(res.size());
3595 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3597 PyObject *elt=PyTuple_New(3);
3598 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3599 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3600 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3601 PyList_SetItem(ret,rk,elt);
3608 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3611 static MEDFileParameters *New();
3612 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3613 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3614 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3615 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3616 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3617 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3618 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3619 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3620 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3621 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3622 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3627 return MEDFileParameters::New();
3630 MEDFileParameters(const std::string& fileName)
3632 return MEDFileParameters::New(fileName);
3635 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3637 return MEDFileParameters::New(db);
3641 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3643 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3646 std::string __str__() const throw(INTERP_KERNEL::Exception)
3648 return self->simpleRepr();
3651 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3653 if(PyInt_Check(obj))
3655 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3660 else if(PyString_Check(obj))
3662 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3668 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3671 int __len__() const throw(INTERP_KERNEL::Exception)
3673 return self->getNumberOfParams();
3676 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3678 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3684 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3686 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3692 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3695 bool ret0=self->isEqual(other,eps,what);
3696 PyObject *res=PyList_New(2);
3697 PyObject *ret0Py=ret0?Py_True:Py_False;
3699 PyList_SetItem(res,0,ret0Py);
3700 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3706 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3709 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3710 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3711 static MEDFileData *New();
3712 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3713 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3714 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3715 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3716 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3717 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3718 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3720 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3721 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3722 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3723 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3724 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3728 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3730 return MEDFileData::New(fileName);
3733 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3735 return MEDFileData::New(db);
3740 return MEDFileData::New();
3743 std::string __str__() const throw(INTERP_KERNEL::Exception)
3745 return self->simpleRepr();
3748 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3750 MEDFileMeshes *ret=self->getMeshes();
3756 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3758 MEDFileParameters *ret=self->getParams();
3764 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3766 MEDFileFields *ret=self->getFields();
3772 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3774 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3775 return self->changeMeshNames(modifTab);
3778 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3780 std::vector<const MEDFileData *> mfdsCpp;
3781 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3782 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3787 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3789 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3794 class SauvReader : public RefCountObject
3797 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3798 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3801 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3803 return SauvReader::New(fileName);
3808 class SauvWriter : public RefCountObject
3811 static SauvWriter * New();
3812 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3813 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3814 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3815 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3818 SauvWriter() throw(INTERP_KERNEL::Exception)
3820 return SauvWriter::New();
3827 class MEDFileMeshStruct;
3829 class MEDFileField1TSStructItem
3832 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3835 class MEDFileMeshStruct : public RefCountObject
3838 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3840 ~MEDFileMeshStruct();
3843 class MEDMeshMultiLev : public RefCountObject
3846 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3847 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3848 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3854 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3856 DataArrayInt *famIds(0);
3857 bool isWithoutCopy(false);
3858 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3859 PyObject *ret=PyTuple_New(2);
3860 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3862 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3863 PyTuple_SetItem(ret,1,ret1Py);
3867 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3869 DataArrayInt *numIds(0);
3870 bool isWithoutCopy(false);
3871 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3872 PyObject *ret=PyTuple_New(2);
3873 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3875 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3876 PyTuple_SetItem(ret,1,ret1Py);
3880 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3882 DataArrayInt *famIds(0);
3883 bool isWithoutCopy(false);
3884 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3885 PyObject *ret=PyTuple_New(2);
3886 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3888 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3889 PyTuple_SetItem(ret,1,ret1Py);
3893 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3895 DataArrayInt *numIds(0);
3896 bool isWithoutCopy(false);
3897 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3898 PyObject *ret=PyTuple_New(2);
3899 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3901 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3902 PyTuple_SetItem(ret,1,ret1Py);
3906 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3908 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3909 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3910 PyObject *res(PyList_New(result.size()));
3911 for(int i=0;iL!=result.end(); i++, iL++)
3912 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3918 class MEDUMeshMultiLev : public MEDMeshMultiLev
3921 ~MEDUMeshMultiLev();
3925 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3927 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3928 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3929 PyObject *ret0Py=ncc?Py_True:Py_False;
3931 PyObject *ret=PyTuple_New(7);
3932 PyTuple_SetItem(ret,0,ret0Py);
3933 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3934 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3935 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3936 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3937 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3938 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3944 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3947 ~MEDStructuredMeshMultiLev();
3950 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3953 ~MEDCMeshMultiLev();
3957 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3960 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3961 std::size_t sz(objs.size());
3962 PyObject *ret(PyTuple_New(2));
3963 PyObject *ret0=PyList_New(sz);
3964 for(std::size_t i=0;i<sz;i++)
3965 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3966 PyTuple_SetItem(ret,0,ret0);
3967 PyObject *ret1Py(isInternal?Py_True:Py_False);
3969 PyTuple_SetItem(ret,1,ret1Py);
3975 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3978 ~MEDCurveLinearMeshMultiLev();
3982 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3984 DataArrayDouble *ret0(0);
3985 std::vector<int> ret1;
3987 self->buildVTUArrays(ret0,ret1,ret2);
3988 std::size_t sz(ret1.size());
3989 PyObject *ret=PyTuple_New(3);
3990 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3991 PyObject *ret1Py=PyList_New(sz);
3992 for(std::size_t i=0;i<sz;i++)
3993 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3994 PyTuple_SetItem(ret,1,ret1Py);
3995 PyObject *ret2Py(ret2?Py_True:Py_False);
3997 PyTuple_SetItem(ret,2,ret2Py);
4003 class MEDFileFastCellSupportComparator : public RefCountObject
4006 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
4007 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4008 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4009 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
4011 ~MEDFileFastCellSupportComparator();
4015 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
4017 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4018 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4019 PyObject *res(PyList_New(result.size()));
4020 for(int i=0;iL!=result.end(); i++, iL++)
4021 PyList_SetItem(res,i,PyInt_FromLong(*iL));