1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
33 #include "MEDLoader.hxx"
34 #include "MEDFileJoint.hxx"
35 #include "MEDFileMesh.hxx"
36 #include "MEDFileField.hxx"
37 #include "MEDFileParameter.hxx"
38 #include "MEDFileData.hxx"
39 #include "MEDFileEquivalence.hxx"
40 #include "MEDFileEntities.hxx"
41 #include "MEDFileMeshReadSelector.hxx"
42 #include "MEDFileFieldOverView.hxx"
43 #include "MEDLoaderTypemaps.i"
44 #include "SauvReader.hxx"
45 #include "SauvWriter.hxx"
47 using namespace MEDCoupling;
50 #if SWIG_VERSION >= 0x010329
51 %template() std::vector<std::string>;
54 %typemap(out) MEDCoupling::MEDFileMesh*
56 $result=convertMEDFileMesh($1,$owner);
59 %typemap(out) MEDCoupling::MEDFileParameter1TS*
61 $result=convertMEDFileParameter1TS($1,$owner);
64 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
66 $result=convertMEDFileFieldMultiTS($1,$owner);
69 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
71 $result=convertMEDFileField1TS($1,$owner);
74 %typemap(out) MEDCoupling::MEDMeshMultiLev*
76 $result=convertMEDMeshMultiLev($1,$owner);
79 %newobject ReadUMeshFromFamiliesSwig;
80 %newobject ReadUMeshFromGroupsSwig;
81 %newobject ReadFieldSwig;
82 %newobject MEDCoupling::ReadUMeshFromFile;
83 %newobject MEDCoupling::ReadMeshFromFile;
84 %newobject MEDCoupling::ReadFieldCell;
85 %newobject MEDCoupling::ReadFieldNode;
86 %newobject MEDCoupling::ReadFieldGauss;
87 %newobject MEDCoupling::ReadFieldGaussNE;
88 %newobject MEDCoupling::MEDFileMesh::New;
89 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
90 %newobject MEDCoupling::MEDFileMesh::deepCopy;
91 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
92 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
93 %newobject MEDCoupling::MEDFileMesh::__getitem__;
94 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
95 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
97 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
101 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
102 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
103 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
104 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
105 %newobject MEDCoupling::MEDFileMesh::cartesianize;
106 %newobject MEDCoupling::MEDFileData::getJoints;
107 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
108 %newobject MEDCoupling::MEDFileUMesh::New;
109 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
110 %newobject MEDCoupling::MEDFileUMesh::getCoords;
111 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
112 %newobject MEDCoupling::MEDFileUMesh::getGroup;
113 %newobject MEDCoupling::MEDFileUMesh::getGroups;
114 %newobject MEDCoupling::MEDFileUMesh::getFamily;
115 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
116 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
120 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
121 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
123 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
124 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
125 %newobject MEDCoupling::MEDFileUMesh::extractPart;
126 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
127 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
128 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
129 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
130 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
131 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
132 %newobject MEDCoupling::MEDFileCMesh::New;
133 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
134 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
136 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
137 %newobject MEDCoupling::MEDFileMeshes::New;
138 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
139 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
140 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
141 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
142 %newobject MEDCoupling::MEDFileMeshes::__iter__;
144 %newobject MEDCoupling::MEDFileMeshSupports::New;
145 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
147 %newobject MEDCoupling::MEDFileStructureElements::New;
149 %newobject MEDCoupling::MEDFileFields::New;
150 %newobject MEDCoupling::MEDFileFields::NewAdv;
151 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
152 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
153 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
154 %newobject MEDCoupling::MEDFileFields::deepCopy;
155 %newobject MEDCoupling::MEDFileFields::shallowCpy;
156 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
157 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
158 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
159 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
160 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
161 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
162 %newobject MEDCoupling::MEDFileFields::__iter__;
163 %newobject MEDCoupling::MEDFileFields::extractPart;
165 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
166 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
167 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
168 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
169 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
170 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
173 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
174 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
175 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
176 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
177 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
178 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
179 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
182 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
183 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
184 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
185 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
186 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
187 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
188 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
189 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
190 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
191 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
192 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
194 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
195 %newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
196 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
197 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
198 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
199 %newobject MEDCoupling::MEDFileField1TS::New;
200 %newobject MEDCoupling::MEDFileField1TS::field;
201 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
202 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
203 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
204 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
205 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
206 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
208 %newobject MEDCoupling::MEDFileIntField1TS::New;
209 %newobject MEDCoupling::MEDFileIntField1TS::field;
210 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
211 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
212 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
213 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
214 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
215 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
217 %newobject MEDCoupling::MEDFileData::New;
218 %newobject MEDCoupling::MEDFileData::deepCopy;
219 %newobject MEDCoupling::MEDFileData::getMeshes;
220 %newobject MEDCoupling::MEDFileData::getFields;
221 %newobject MEDCoupling::MEDFileData::getParams;
222 %newobject MEDCoupling::MEDFileData::Aggregate;
224 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
226 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
227 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
228 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
229 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
230 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
231 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
232 %newobject MEDCoupling::MEDFileParameters::New;
233 %newobject MEDCoupling::MEDFileParameters::deepCopy;
234 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
235 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
236 %newobject MEDCoupling::MEDFileParameters::__getitem__;
238 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
239 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
240 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
241 %newobject MEDCoupling::MEDFileJointOneStep::New;
242 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
243 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
244 %newobject MEDCoupling::MEDFileJoint::New;
245 %newobject MEDCoupling::MEDFileJoint::deepCopy;
246 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
247 %newobject MEDCoupling::MEDFileJoints::New;
248 %newobject MEDCoupling::MEDFileJoints::deepCopy;
249 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
250 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
251 %newobject MEDCoupling::MEDFileJoints::__getitem__;
252 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
253 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
254 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
255 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
256 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
257 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
258 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
259 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
260 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
262 %newobject MEDCoupling::SauvWriter::New;
263 %newobject MEDCoupling::SauvReader::New;
264 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
266 %newobject MEDCoupling::MEDFileMeshStruct::New;
267 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
268 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
269 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
270 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
271 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
273 %feature("unref") MEDFileMesh "$this->decrRef();"
274 %feature("unref") MEDFileUMesh "$this->decrRef();"
275 %feature("unref") MEDFileCMesh "$this->decrRef();"
276 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
277 %feature("unref") MEDFileMeshes "$this->decrRef();"
278 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
279 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
280 %feature("unref") MEDFileField1TS "$this->decrRef();"
281 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
282 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
283 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
284 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
285 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
286 %feature("unref") MEDFileStructureElements "$this->decrRef();"
287 %feature("unref") MEDFileFields "$this->decrRef();"
288 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
289 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
290 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
291 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
292 %feature("unref") MEDFileParameters "$this->decrRef();"
293 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
294 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
295 %feature("unref") MEDFileJoint "$this->decrRef();"
296 %feature("unref") MEDFileJoints "$this->decrRef();"
297 %feature("unref") MEDFileEquivalences "$this->decrRef();"
298 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
299 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
300 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
301 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
302 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
303 %feature("unref") MEDFileData "$this->decrRef();"
304 %feature("unref") SauvReader "$this->decrRef();"
305 %feature("unref") SauvWriter "$this->decrRef();"
306 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
307 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
308 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
309 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
310 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
311 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
313 namespace MEDCoupling
316 std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
317 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
318 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
319 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
320 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
321 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
322 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
323 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
324 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
325 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
326 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
327 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
328 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
329 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
330 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
331 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
332 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
333 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
334 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
335 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
336 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
337 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
338 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
339 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
340 MEDCoupling::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
341 MEDCoupling::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
342 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
343 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
344 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
345 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
346 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
347 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
348 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
349 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
352 %rename (MEDFileVersion) MEDFileVersionSwig;
353 %rename (GetFieldIterations) GetFieldIterationsSwig;
354 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
355 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
356 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
357 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
358 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
359 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
360 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
361 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
362 %rename (WriteUMeshes) WriteUMeshesSwig;
363 %rename (GetTypesOfField) GetTypesOfFieldSwig;
364 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
365 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
366 %rename (ReadField) ReadFieldSwig;
370 PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
372 int major,minor,release;
373 MEDCoupling::MEDFileVersion(major,minor,release);
374 PyObject *ret(PyTuple_New(3));
375 PyTuple_SetItem(ret,0,SWIG_From_int(major));
376 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
377 PyTuple_SetItem(ret,2,SWIG_From_int(release));
381 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName) throw(INTERP_KERNEL::Exception)
383 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName));
387 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
389 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName));
393 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
395 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
399 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
401 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
405 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
407 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
408 PyObject *ret=PyList_New(res.size());
410 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
412 PyObject *elt=PyTuple_New(2);
413 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
414 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
415 PyList_SetItem(ret,rk,elt);
420 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
422 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
423 PyObject *ret=PyList_New(res.size());
425 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
427 PyObject *elt=PyTuple_New(3);
428 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
429 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
430 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
431 PyList_SetItem(ret,rk,elt);
436 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
438 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
439 PyObject *ret=PyList_New(res.size());
441 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
443 PyObject *elt=PyTuple_New(2);
444 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
445 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
446 PyList_SetItem(ret,rk,elt);
451 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
453 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
454 PyObject *ret=PyList_New(res.size());
456 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
458 PyObject *elt=PyTuple_New(2);
459 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
460 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
461 PyList_SetItem(ret,rk,elt);
466 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
468 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
469 PyObject *ret=PyList_New(res.size());
471 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
473 PyObject *elt=PyTuple_New(2);
474 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
475 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
476 PyList_SetItem(ret,rk,elt);
481 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
483 int meshDim,spaceDim,numberOfNodes;
484 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
485 PyObject *ret=PyTuple_New(4);
486 PyObject *elt0=PyList_New(res.size());
488 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
490 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
492 PyObject *elt1=PyList_New(obj2.size());
493 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
495 PyObject *elt2=PyTuple_New(2);
496 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
497 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
498 PyList_SetItem(elt1,j,elt2);
500 PyList_SetItem(elt0,i,elt1);
502 PyTuple_SetItem(ret,0,elt0);
503 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
504 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
505 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
509 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
510 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
512 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
513 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
514 return convertFieldDoubleVecToPy(res);
517 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
519 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
520 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
521 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
524 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
526 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
527 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
528 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
531 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
533 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
534 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
535 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
538 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
540 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
542 PyObject *ret=PyList_New(size);
543 for(int i=0;i<size;i++)
544 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
548 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
550 std::vector<std::string> grps;
551 converPyListToVecString(li,grps);
552 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
555 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
557 std::vector<std::string> fams;
558 converPyListToVecString(li,fams);
559 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
563 namespace MEDCoupling
565 class MEDFileWritable
568 void copyOptionsFrom(const MEDFileWritable& other) const;
569 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
570 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
571 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
572 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
575 class MEDFileWritableStandAlone : public MEDFileWritable
578 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
579 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
582 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
584 MCAuto<DataArrayByte> ret(self->serialize());
588 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
590 PyObject *ret(PyList_New(0));
594 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
598 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
601 PyObject *ret(PyTuple_New(1));
602 PyObject *ret0(PyDict_New());
603 DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
604 PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
605 {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
606 PyObject *tmp1(PyInt_FromLong(0));
607 PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
608 PyTuple_SetItem(ret,0,ret0);
612 throw INTERP_KERNEL::Exception("PyWrap of MEDFileData.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
618 class MEDFileMeshReadSelector
621 MEDFileMeshReadSelector();
622 MEDFileMeshReadSelector(unsigned int code);
623 unsigned int getCode() const;
624 void setCode(unsigned int newCode);
625 bool isCellFamilyFieldReading() const;
626 bool isNodeFamilyFieldReading() const;
627 bool isCellNameFieldReading() const;
628 bool isNodeNameFieldReading() const;
629 bool isCellNumFieldReading() const;
630 bool isNodeNumFieldReading() const;
631 bool isGlobalNodeNumFieldReading() const;
632 void setCellFamilyFieldReading(bool b);
633 void setNodeFamilyFieldReading(bool b);
634 void setCellNameFieldReading(bool b);
635 void setNodeNameFieldReading(bool b);
636 void setCellNumFieldReading(bool b);
637 void setNodeNumFieldReading(bool b);
638 void setGlobalNodeNumFieldReading(bool b);
641 std::string __str__() const throw(INTERP_KERNEL::Exception)
643 std::ostringstream oss;
648 std::string __repr__() const throw(INTERP_KERNEL::Exception)
650 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
656 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
659 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
660 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
661 throw(INTERP_KERNEL::Exception);
662 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
663 INTERP_KERNEL::NormalizedCellType loc_geo_type,
664 INTERP_KERNEL::NormalizedCellType rem_geo_type)
665 throw(INTERP_KERNEL::Exception);
666 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
667 MEDFileJointCorrespondence *deepCopy() const;
668 MEDFileJointCorrespondence *shallowCpy() const;
669 void setIsNodal(bool isNodal);
670 bool getIsNodal() const;
671 bool isEqual(const MEDFileJointCorrespondence *other) const;
672 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
673 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
674 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
675 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
676 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
677 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
678 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const throw(INTERP_KERNEL::Exception);
679 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
682 MEDFileJointCorrespondence()
684 return MEDFileJointCorrespondence::New();
686 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
688 return MEDFileJointCorrespondence::New(correspondence);
690 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
691 INTERP_KERNEL::NormalizedCellType loc_geo_type,
692 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
694 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
697 std::string __str__() const throw(INTERP_KERNEL::Exception)
699 return self->simpleRepr();
704 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
707 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
708 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
709 MEDFileJointOneStep *deepCopy() const;
710 MEDFileJointOneStep *shallowCpy() const;
711 bool isEqual(const MEDFileJointOneStep *other) const;
712 void setOrder(int order);
713 int getOrder() const;
714 void setIteration(int it);
715 int getIteration() const;
716 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
717 int getNumberOfCorrespondences() const;
718 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
719 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
720 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
723 MEDFileJointOneStep()
725 return MEDFileJointOneStep::New();
728 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
730 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
733 std::string __str__() const throw(INTERP_KERNEL::Exception)
735 return self->simpleRepr();
740 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
743 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
744 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
745 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
746 MEDFileJoint *deepCopy() const;
747 MEDFileJoint *shallowCpy() const;
748 bool isEqual(const MEDFileJoint *other) const;
749 void setLocalMeshName(const std::string& name);
750 std::string getLocalMeshName() const;
751 void setRemoteMeshName(const std::string& name);
752 std::string getRemoteMeshName() const;
753 void setDescription(const std::string& name);
754 std::string getDescription() const;
755 void setJointName(const std::string& name);
756 std::string getJointName() const;
757 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
758 void setDomainNumber(const int& number);
759 int getDomainNumber() const;
760 void pushStep(MEDFileJointOneStep* step);
761 int getNumberOfSteps() const;
762 MEDFileJointOneStep *getStepAtPos(int i) const;
763 std::string simpleRepr() const;
768 return MEDFileJoint::New();
771 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
773 return MEDFileJoint::New(fileName,mName,num);
776 std::string __str__() const throw(INTERP_KERNEL::Exception)
778 return self->simpleRepr();
783 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
786 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
787 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
788 MEDFileJoints *deepCopy() const;
789 std::string simpleRepr() const;
790 std::string getMeshName() const;
791 int getNumberOfJoints() const;
792 std::vector<std::string> getJointsNames() const;
793 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
794 void resize(int newSize) throw(INTERP_KERNEL::Exception);
795 void pushJoint(MEDFileJoint *joint);
796 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
797 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
802 return MEDFileJoints::New();
805 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
807 return MEDFileJoints::New(fileName,meshName);
810 std::string __str__() const throw(INTERP_KERNEL::Exception)
812 return self->simpleRepr();
815 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
819 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
824 else if(PyString_Check(obj))
826 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
832 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
835 int __len__() const throw(INTERP_KERNEL::Exception)
837 return self->getNumberOfJoints();
840 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
842 MEDFileJoint *ret=self->getJointAtPos(i);
848 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
850 MEDFileJoint *ret=self->getJointWithName(paramName);
858 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
861 MEDFileEquivalenceBase();
864 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
867 MEDFileEquivalenceData();
869 void setArray(DataArrayInt *data);
872 DataArrayInt *getArray()
874 DataArrayInt *ret(self->getArray());
875 if(ret) ret->incrRef();
881 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
884 MEDFileEquivalenceNode();
887 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
890 MEDFileEquivalenceCell();
893 std::size_t size() const;
894 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
895 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
898 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
900 DataArrayInt *ret(self->getArray(type));
901 if(ret) ret->incrRef();
905 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
907 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
908 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
909 PyObject *res=PyList_New(result.size());
910 for(int i=0;iL!=result.end(); i++, iL++)
911 PyList_SetItem(res,i,PyInt_FromLong(*iL));
917 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
920 MEDFileEquivalencePair();
922 std::string getName() const;
923 void setName(const std::string& name);
924 std::string getDescription() const;
925 void setDescription(const std::string& descr);
926 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
929 MEDFileEquivalenceCell *initCell()
931 MEDFileEquivalenceCell *ret(self->initCell());
932 if(ret) ret->incrRef();
936 MEDFileEquivalenceNode *initNode()
938 MEDFileEquivalenceNode *ret(self->initNode());
939 if(ret) ret->incrRef();
943 MEDFileEquivalenceCell *getCell()
945 MEDFileEquivalenceCell *ret(self->getCell());
946 if(ret) ret->incrRef();
950 MEDFileEquivalenceNode *getNode()
952 MEDFileEquivalenceNode *ret(self->getNode());
953 if(ret) ret->incrRef();
959 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
962 MEDFileEquivalences();
965 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
966 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
967 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
971 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
973 MEDFileEquivalencePair *ret(self->getEquivalence(i));
974 if(ret) ret->incrRef();
977 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
979 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
980 if(ret) ret->incrRef();
984 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
986 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
987 if(ret) ret->incrRef();
993 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
996 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
997 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
998 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
999 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
1000 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
1001 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
1002 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
1003 void setName(const std::string& name);
1004 std::string getName();
1005 std::string getUnivName() const;
1006 bool getUnivNameWrStatus() const;
1007 void setUnivNameWrStatus(bool newStatus);
1008 void setDescription(const std::string& name);
1009 std::string getDescription() const;
1010 void setOrder(int order);
1011 int getOrder() const;
1012 void setIteration(int it);
1014 void setTimeValue(double time);
1015 void setTime(int dt, int it, double time);
1016 double getTimeValue() const;
1017 void setTimeUnit(const std::string& unit);
1018 std::string getTimeUnit() const;
1019 void setAxisType(MEDCouplingAxisType at);
1020 MEDCouplingAxisType getAxisType() const;
1021 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
1022 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1023 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
1024 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1025 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
1026 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
1027 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1028 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1029 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1030 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
1031 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
1032 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
1033 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1034 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1036 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
1037 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
1038 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1039 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1040 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1041 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1042 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1043 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1044 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1045 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1046 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1047 void clearFamMap() throw(INTERP_KERNEL::Exception);
1048 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1049 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1050 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1051 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1052 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1053 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1054 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1055 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1056 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1057 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1058 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1059 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1060 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1061 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1062 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1063 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1064 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1065 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1066 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1067 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1068 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1069 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1070 static std::string GetMagicFamilyStr();
1071 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1072 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1073 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1074 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1075 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1076 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1077 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1078 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1079 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1080 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1081 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1082 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1083 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1084 void setFamilyInfo(const std::map<std::string,int>& info);
1085 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1086 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1087 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1088 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1089 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1090 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1091 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1092 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1093 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1094 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1095 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1096 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1097 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1098 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1099 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1100 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1101 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1102 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1103 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1104 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1105 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1107 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1108 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1109 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1110 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1111 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1112 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1113 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1114 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1115 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1116 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1117 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1118 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1119 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1120 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1121 int getNumberOfJoints();
1122 MEDFileJoints *getJoints();
1123 void setJoints( MEDFileJoints* joints );
1124 void initializeEquivalences();
1125 void killEquivalences();
1126 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1127 void killStructureElements() throw(INTERP_KERNEL::Exception);
1130 std::string __str__() const throw(INTERP_KERNEL::Exception)
1132 return self->simpleRepr();
1135 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1137 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1140 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1143 double tmp0=self->getTime(tmp1,tmp2);
1144 PyObject *res = PyList_New(3);
1145 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1146 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1147 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1151 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1154 bool ret0=self->isEqual(other,eps,what);
1155 PyObject *res=PyList_New(2);
1156 PyObject *ret0Py=ret0?Py_True:Py_False;
1158 PyList_SetItem(res,0,ret0Py);
1159 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1163 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1165 std::vector<const DataArrayInt *> grps;
1166 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1167 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1170 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1173 bool ret0=self->areFamsEqual(other,what);
1174 PyObject *res=PyList_New(2);
1175 PyObject *ret0Py=ret0?Py_True:Py_False;
1177 PyList_SetItem(res,0,ret0Py);
1178 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1182 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1185 bool ret0=self->areGrpsEqual(other,what);
1186 PyObject *res=PyList_New(2);
1187 PyObject *ret0Py=ret0?Py_True:Py_False;
1189 PyList_SetItem(res,0,ret0Py);
1190 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1194 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1196 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1197 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1198 PyObject *res=PyList_New(result.size());
1199 for(int i=0;iL!=result.end(); i++, iL++)
1200 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1204 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1206 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1207 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1208 PyObject *res=PyList_New(result.size());
1209 for(int i=0;iL!=result.end(); i++, iL++)
1210 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1214 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1216 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1219 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1222 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1224 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1227 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1230 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1232 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1235 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1238 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1240 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1243 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1246 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1248 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1251 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1254 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1257 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1258 PyObject *ret=PyTuple_New(2);
1259 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1260 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1264 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1266 DataArrayInt *ret3=0;
1267 std::vector<int> ret1,ret2;
1268 bool ret0=self->unPolyze(ret1,ret2,ret3);
1269 PyObject *ret=PyTuple_New(4);
1270 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1272 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1273 for(int j=0;j<(int)ret1.size()/3;j++)
1275 PyObject *retLev2=PyList_New(3);
1276 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1277 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1278 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1279 PyList_SetItem(retLev1_0,j,retLev2);
1281 PyTuple_SetItem(ret,1,retLev1_0);
1283 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1284 for(int j=0;j<(int)ret2.size()/3;j++)
1286 PyObject *retLev2=PyList_New(3);
1287 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1288 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1289 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1290 PyList_SetItem(retLev1_1,j,retLev2);
1292 PyTuple_SetItem(ret,2,retLev1_1);
1294 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1298 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1300 MEDFileEquivalences *ret(self->getEquivalences());
1301 if(ret) ret->incrRef();
1307 class MEDFileUMesh : public MEDFileMesh
1310 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1311 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1312 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1313 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1314 static MEDFileUMesh *New();
1315 static const char *GetSpeStr4ExtMesh();
1317 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1318 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1319 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1320 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1321 void clearNodeAndCellNumbers();
1323 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1324 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1325 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1326 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1327 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1328 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1329 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1330 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1331 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1332 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1334 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1335 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1336 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1337 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1338 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1339 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1340 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1341 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1342 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1343 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1344 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1345 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1346 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1347 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1348 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1351 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1353 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1356 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1358 return MEDFileUMesh::New(fileName,mrs);
1361 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1363 return MEDFileUMesh::New(mem);
1366 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1368 return MEDFileUMesh::New(db);
1373 return MEDFileUMesh::New();
1377 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1379 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1382 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)
1384 std::vector<int> typesCpp1;
1385 convertPyToNewIntArr3(types,typesCpp1);
1386 std::size_t sz(typesCpp1.size());
1387 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1388 for(std::size_t ii=0;ii<sz;ii++)
1389 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1390 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1393 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1394 {// put an empty dict in input to say to __new__ to call __init__...
1395 PyObject *ret(PyTuple_New(1));
1396 PyObject *ret0(PyDict_New());
1397 PyTuple_SetItem(ret,0,ret0);
1401 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1403 std::vector<double> a0;
1404 std::vector<int> a1;
1405 std::vector<std::string> a2;
1406 std::vector< MCAuto<DataArrayInt> > a3;
1407 MCAuto<DataArrayDouble> a4;
1408 self->serialize(a0,a1,a2,a3,a4);
1409 PyObject *ret(PyTuple_New(5));
1410 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1411 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1413 PyObject *ret2(PyList_New(sz));
1414 for(int i=0;i<sz;i++)
1415 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1416 PyTuple_SetItem(ret,2,ret2);
1418 PyObject *ret3(PyList_New(sz));
1419 for(int i=0;i<sz;i++)
1421 DataArrayInt *elt(a3[i]);
1424 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1426 PyTuple_SetItem(ret,3,ret3);
1427 DataArrayDouble *ret4(a4);
1430 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1434 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1436 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1437 if(!PyTuple_Check(inp))
1438 throw INTERP_KERNEL::Exception(MSG);
1439 int sz(PyTuple_Size(inp));
1441 throw INTERP_KERNEL::Exception(MSG);
1442 std::vector<double> a0;
1443 std::vector<int> a1;
1444 std::vector<std::string> a2;
1445 std::vector< MCAuto<DataArrayInt> > a3;
1446 MCAuto<DataArrayDouble> a4;
1448 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1450 fillArrayWithPyListDbl3(a0py,tmp,a0);
1451 convertPyToNewIntArr3(a1py,a1);
1452 fillStringVector(a2py,a2);
1454 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1456 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1457 if(!SWIG_IsOK(status))
1458 throw INTERP_KERNEL::Exception(MSG);
1459 a4=reinterpret_cast<DataArrayDouble *>(argp);
1460 if((DataArrayDouble *)a4)
1463 std::vector< DataArrayInt * > a3Tmp;
1464 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1465 std::size_t sz(a3Tmp.size());
1467 for(std::size_t i=0;i<sz;i++)
1471 a3Tmp[i]->incrRef();
1473 self->unserialize(a0,a1,a2,a3,a4);
1477 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1480 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1481 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1484 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1487 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1490 self->setMeshAtLevel(meshDimRelToMax,m1);
1493 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1496 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1498 self->removeMeshAtLevel(meshDimRelToMax);
1501 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1503 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1505 DataArrayDouble *a,*a2;
1506 DataArrayDoubleTuple *aa,*aa2;
1507 std::vector<double> bb,bb2;
1509 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1510 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1511 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1515 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1517 std::vector<const MEDFileUMesh *> meshesCpp;
1518 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1519 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1523 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1525 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1526 return convertVecPairIntToPy(ret);
1529 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1531 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1532 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1533 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1536 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1538 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1539 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1540 return self->extractPart(extractDefCpp);
1543 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1545 std::vector<const MEDCouplingUMesh *> ms;
1546 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1547 self->setMeshes(ms,renum);
1550 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1552 std::vector<const MEDCouplingUMesh *> ms;
1553 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1554 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1557 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1559 std::vector<const MEDCouplingUMesh *> ms;
1560 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1561 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1564 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1566 DataArrayDouble *ret=self->getCoords();
1572 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1574 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1577 return const_cast<PartDefinition *>(ret);
1580 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1582 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1583 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1584 PyObject *ret=PyTuple_New(3);
1585 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1586 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1587 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1591 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1593 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1599 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1601 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1602 std::size_t sz(tmp.size());
1603 PyObject *ret=PyList_New(sz);
1604 for(std::size_t i=0;i<sz;i++)
1608 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1615 class MEDFileStructuredMesh : public MEDFileMesh
1620 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1622 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1630 class MEDFileCMesh : public MEDFileStructuredMesh
1633 static MEDFileCMesh *New();
1634 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1635 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1636 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1637 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1638 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1643 return MEDFileCMesh::New();
1646 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1648 return MEDFileCMesh::New(fileName,mrs);
1651 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1653 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1656 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1658 return MEDFileCMesh::New(db);
1662 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1664 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1667 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1669 const MEDCouplingCMesh *tmp=self->getMesh();
1672 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1677 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1680 static MEDFileCurveLinearMesh *New();
1681 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1682 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1683 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1684 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1687 MEDFileCurveLinearMesh()
1689 return MEDFileCurveLinearMesh::New();
1692 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1694 return MEDFileCurveLinearMesh::New(fileName,mrs);
1697 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1699 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1702 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1704 return MEDFileCurveLinearMesh::New(db);
1708 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1710 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1713 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1715 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1718 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1723 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1726 static MEDFileMeshMultiTS *New();
1727 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1728 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1729 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1730 std::string getName() const throw(INTERP_KERNEL::Exception);
1731 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1732 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1735 MEDFileMeshMultiTS()
1737 return MEDFileMeshMultiTS::New();
1740 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1742 return MEDFileMeshMultiTS::New(fileName);
1745 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1747 return MEDFileMeshMultiTS::New(fileName,mName);
1750 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1752 MEDFileMesh *ret=self->getOneTimeStep();
1760 class MEDFileMeshesIterator
1765 PyObject *next() throw(INTERP_KERNEL::Exception)
1767 MEDFileMesh *ret=self->nextt();
1771 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1775 PyErr_SetString(PyExc_StopIteration,"No more data.");
1782 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1785 static MEDFileMeshes *New();
1786 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1787 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1788 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1789 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1791 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1792 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1793 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1794 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1795 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1796 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1797 void killStructureElements() throw(INTERP_KERNEL::Exception);
1802 return MEDFileMeshes::New();
1805 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1807 return MEDFileMeshes::New(fileName);
1810 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1812 return MEDFileMeshes::New(db);
1816 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1818 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1821 std::string __str__() const throw(INTERP_KERNEL::Exception)
1823 return self->simpleRepr();
1826 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1828 if(PyInt_Check(obj))
1830 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1835 else if(PyString_Check(obj))
1837 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1843 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1846 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1848 self->setMeshAtPos(obj,mesh);
1852 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1854 return self->iterator();
1857 int __len__() const throw(INTERP_KERNEL::Exception)
1859 return self->getNumberOfMeshes();
1862 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1864 MEDFileMesh *ret=self->getMeshAtPos(i);
1869 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1871 MEDFileMesh *ret=self->getMeshWithName(mname);
1879 class MEDFileFieldLoc : public RefCountObject
1882 std::string getName() const;
1883 int getDimension() const;
1884 int getNumberOfGaussPoints() const;
1885 int getNumberOfPointsInCells() const;
1886 const std::vector<double>& getRefCoords() const;
1887 const std::vector<double>& getGaussCoords() const;
1888 const std::vector<double>& getGaussWeights() const;
1889 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1892 std::string __str__() const throw(INTERP_KERNEL::Exception)
1894 return self->repr();
1899 class MEDFileFieldGlobsReal
1902 void resetContent();
1903 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1904 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1905 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1906 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1907 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1908 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1909 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1910 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1911 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1912 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1913 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1914 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1915 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1916 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1917 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1918 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1919 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1920 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1921 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1922 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1923 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1924 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1925 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1926 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1927 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1928 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1929 void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
1932 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1934 const DataArrayInt *ret=self->getProfile(pflName);
1937 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1940 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1942 const DataArrayInt *ret=self->getProfileFromId(pflId);
1945 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1948 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1950 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1953 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1956 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1958 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1961 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1964 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1966 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1967 return convertVecPairVecStToPy(ret);
1970 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1972 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1973 return convertVecPairVecStToPy(ret);
1976 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1978 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1979 self->changePflsNames(v);
1982 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1984 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1985 self->changePflsRefsNamesGen(v);
1988 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1990 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1991 self->changePflsNamesInStruct(v);
1994 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1996 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1997 self->changeLocsNames(v);
2000 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
2002 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2003 self->changeLocsRefsNamesGen(v);
2006 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2008 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2009 self->changeLocsNamesInStruct(v);
2012 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
2014 std::ostringstream oss;
2015 self->simpleReprGlobs(oss);
2021 class MEDFileEntities
2026 static MEDFileEntities *BuildFrom(PyObject *entities) throw(INTERP_KERNEL::Exception)
2028 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2029 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2031 std::size_t sz(inp0.size());
2033 for(std::size_t i=0;i<sz;i++)
2034 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2036 return MEDFileEntities::BuildFrom(&inp);
2043 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2046 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2047 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2048 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2049 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
2050 void loadArrays() throw(INTERP_KERNEL::Exception);
2051 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2052 void unloadArrays() throw(INTERP_KERNEL::Exception);
2053 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2054 int getDimension() const throw(INTERP_KERNEL::Exception);
2055 int getIteration() const throw(INTERP_KERNEL::Exception);
2056 int getOrder() const throw(INTERP_KERNEL::Exception);
2057 std::string getName() throw(INTERP_KERNEL::Exception);
2058 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2059 std::string getMeshName() throw(INTERP_KERNEL::Exception);
2060 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2061 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2062 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2063 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2064 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2065 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2066 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2067 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2068 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2069 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2070 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2071 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2072 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2075 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2078 double tmp0=self->getTime(tmp1,tmp2);
2079 PyObject *res = PyList_New(3);
2080 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2081 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2082 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2086 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2088 std::pair<int,int> res=self->getDtIt();
2089 PyObject *elt=PyTuple_New(2);
2090 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2091 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2095 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2097 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2100 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2102 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2105 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2107 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2108 return self->changeMeshNames(modifTab);
2111 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2113 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2114 PyObject *ret2=PyList_New(ret.size());
2115 for(int i=0;i<(int)ret.size();i++)
2116 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2120 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2122 std::vector<int> ret1;
2123 int ret0=self->getNonEmptyLevels(mname,ret1);
2124 PyObject *elt=PyTuple_New(2);
2125 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2126 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2130 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2132 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2133 std::vector< std::vector<TypeOfField> > typesF;
2134 std::vector< std::vector<std::string> > pfls;
2135 std::vector< std::vector<std::string> > locs;
2136 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2138 PyObject *ret2=PyList_New(sz);
2139 for(int i=0;i<sz;i++)
2141 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2142 const std::vector<TypeOfField>& typesFI=typesF[i];
2143 const std::vector<std::string>& pflsI=pfls[i];
2144 const std::vector<std::string>& locsI=locs[i];
2145 PyObject *elt=PyTuple_New(2);
2146 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2147 int sz2=ret[i].size();
2148 PyObject *elt2=PyList_New(sz2);
2149 for(int j=0;j<sz2;j++)
2151 PyObject *elt3=PyTuple_New(4);
2152 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2153 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));
2154 PyTuple_SetItem(elt3,1,elt4);
2155 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2156 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2157 PyList_SetItem(elt2,j,elt3);
2159 PyTuple_SetItem(elt,1,elt2);
2160 PyList_SetItem(ret2,i,elt);
2165 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2167 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2168 std::size_t sz=ret.size();
2169 PyObject *retPy=PyList_New(sz);
2170 for(std::size_t i=0;i<sz;i++)
2171 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2175 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2177 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2178 std::size_t sz=ret.size();
2179 PyObject *retPy=PyList_New(sz);
2180 for(std::size_t i=0;i<sz;i++)
2181 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2185 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2187 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2188 std::size_t sz=ret.size();
2189 PyObject *retPy=PyList_New(sz);
2190 for(std::size_t i=0;i<sz;i++)
2191 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2195 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2197 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2198 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2199 return self->extractPart(extractDefCpp,mm);
2204 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2207 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2208 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2209 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2210 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2211 static MEDFileField1TS *New();
2212 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2213 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2214 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2215 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2216 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2217 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2218 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2220 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2221 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2222 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2223 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2226 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2228 return MEDFileField1TS::New(fileName,loadAll);
2231 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2233 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2236 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2238 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2241 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2243 return MEDFileField1TS::New(db);
2248 return MEDFileField1TS::New();
2252 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2254 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2257 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2259 const DataArrayDouble *arr=0;
2261 arr=field->getArray();
2262 self->copyTinyInfoFrom(field,arr);
2265 std::string __str__() const throw(INTERP_KERNEL::Exception)
2267 return self->simpleRepr();
2270 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2272 DataArrayInt *ret1=0;
2273 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2274 PyObject *ret=PyTuple_New(2);
2275 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2276 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2280 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2282 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2283 std::vector< std::vector<TypeOfField> > typesF;
2284 std::vector< std::vector<std::string> > pfls;
2285 std::vector< std::vector<std::string> > locs;
2286 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2288 PyObject *ret2=PyList_New(sz);
2289 for(int i=0;i<sz;i++)
2291 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2292 const std::vector<TypeOfField>& typesFI=typesF[i];
2293 const std::vector<std::string>& pflsI=pfls[i];
2294 const std::vector<std::string>& locsI=locs[i];
2295 PyObject *elt=PyTuple_New(2);
2296 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2297 int sz2=ret[i].size();
2298 PyObject *elt2=PyList_New(sz2);
2299 for(int j=0;j<sz2;j++)
2301 PyObject *elt3=PyTuple_New(4);
2302 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2303 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2304 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2305 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2306 PyList_SetItem(elt2,j,elt3);
2308 PyTuple_SetItem(elt,1,elt2);
2309 PyList_SetItem(ret2,i,elt);
2314 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2316 DataArrayDouble *ret=self->getUndergroundDataArray();
2322 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2324 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2325 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2328 PyObject *ret=PyTuple_New(2);
2329 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2330 std::size_t sz=elt1Cpp.size();
2331 PyObject *elt=PyList_New(sz);
2332 for(std::size_t i=0;i<sz;i++)
2334 PyObject *elt1=PyTuple_New(2);
2335 PyObject *elt2=PyTuple_New(2);
2336 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2337 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2338 PyObject *elt3=PyTuple_New(2);
2339 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2340 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2341 PyTuple_SetItem(elt1,0,elt2);
2342 PyTuple_SetItem(elt1,1,elt3);
2343 PyList_SetItem(elt,i,elt1);
2345 PyTuple_SetItem(ret,1,elt);
2351 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2354 static MEDFileIntField1TS *New();
2355 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2356 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2357 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2358 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2359 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2361 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2362 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2363 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2364 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2365 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2366 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2367 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2368 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2371 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2373 return MEDFileIntField1TS::New();
2376 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2378 return MEDFileIntField1TS::New(fileName,loadAll);
2381 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2383 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2386 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2388 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2391 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2393 return MEDFileIntField1TS::New(db);
2397 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2399 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2402 std::string __str__() const throw(INTERP_KERNEL::Exception)
2404 return self->simpleRepr();
2407 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2409 DataArrayInt *ret1=0;
2410 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2411 PyObject *ret=PyTuple_New(2);
2412 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2413 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2417 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2419 DataArrayInt *ret=self->getUndergroundDataArray();
2427 class MEDFileAnyTypeFieldMultiTSIterator
2432 PyObject *next() throw(INTERP_KERNEL::Exception)
2434 MEDFileAnyTypeField1TS *ret=self->nextt();
2436 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2439 PyErr_SetString(PyExc_StopIteration,"No more data.");
2446 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2449 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2450 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2451 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2452 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2453 std::string getName() const throw(INTERP_KERNEL::Exception);
2454 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2455 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2456 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2457 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2458 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2459 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2460 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2461 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2462 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2463 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2464 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2465 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2466 void loadArrays() throw(INTERP_KERNEL::Exception);
2467 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2468 void unloadArrays() throw(INTERP_KERNEL::Exception);
2469 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2471 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2472 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2473 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2474 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2475 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2476 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2479 int __len__() const throw(INTERP_KERNEL::Exception)
2481 return self->getNumberOfTS();
2484 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2486 if(elt0 && PyInt_Check(elt0))
2488 int pos=PyInt_AS_LONG(elt0);
2491 else if(elt0 && PyTuple_Check(elt0))
2493 if(PyTuple_Size(elt0)==2)
2495 PyObject *o0=PyTuple_GetItem(elt0,0);
2496 PyObject *o1=PyTuple_GetItem(elt0,1);
2497 if(PyInt_Check(o0) && PyInt_Check(o1))
2499 int iter=PyInt_AS_LONG(o0);
2500 int order=PyInt_AS_LONG(o1);
2501 return self->getPosOfTimeStep(iter,order);
2504 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 !");
2507 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 !");
2509 else if(elt0 && PyFloat_Check(elt0))
2511 double val=PyFloat_AS_DOUBLE(elt0);
2512 return self->getPosGivenTime(val);
2515 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2518 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2520 std::vector< std::pair<int,int> > res(self->getIterations());
2521 return convertVecPairIntToPy(res);
2524 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2526 std::vector<double> ret1;
2527 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2528 std::size_t sz=ret.size();
2529 PyObject *ret2=PyList_New(sz);
2530 for(std::size_t i=0;i<sz;i++)
2532 PyObject *elt=PyTuple_New(3);
2533 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2534 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2535 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2536 PyList_SetItem(ret2,i,elt);
2541 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2543 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2544 PyObject *ret2=PyList_New(ret.size());
2545 for(int i=0;i<(int)ret.size();i++)
2547 const std::vector<TypeOfField>& rett=ret[i];
2548 PyObject *ret3=PyList_New(rett.size());
2549 for(int j=0;j<(int)rett.size();j++)
2550 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2551 PyList_SetItem(ret2,i,ret3);
2556 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2558 std::vector<int> ret1;
2559 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2560 PyObject *elt=PyTuple_New(2);
2561 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2562 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2566 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2568 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2569 std::vector< std::vector<TypeOfField> > typesF;
2570 std::vector< std::vector<std::string> > pfls;
2571 std::vector< std::vector<std::string> > locs;
2572 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2574 PyObject *ret2=PyList_New(sz);
2575 for(int i=0;i<sz;i++)
2577 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2578 const std::vector<TypeOfField>& typesFI=typesF[i];
2579 const std::vector<std::string>& pflsI=pfls[i];
2580 const std::vector<std::string>& locsI=locs[i];
2581 PyObject *elt=PyTuple_New(2);
2582 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2583 int sz2=ret[i].size();
2584 PyObject *elt2=PyList_New(sz2);
2585 for(int j=0;j<sz2;j++)
2587 PyObject *elt3=PyTuple_New(4);
2588 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2589 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));
2590 PyTuple_SetItem(elt3,1,elt4);
2591 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2592 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2593 PyList_SetItem(elt2,j,elt3);
2595 PyTuple_SetItem(elt,1,elt2);
2596 PyList_SetItem(ret2,i,elt);
2601 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2603 if(PyList_Check(elts))
2605 int sz=PyList_Size(elts);
2606 std::vector<int> ret(sz);
2607 for(int i=0;i<sz;i++)
2609 PyObject *elt=PyList_GetItem(elts,i);
2610 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2616 std::vector<int> ret(1);
2617 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2622 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2624 if(PySlice_Check(elts))
2626 Py_ssize_t strt=2,stp=2,step=2;
2627 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2628 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2629 self->eraseTimeStepIds2(strt,stp,step);
2633 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2634 if(!idsToRemove.empty())
2635 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2639 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2643 std::vector<int> pos2;
2644 DataArrayInt *pos3=0;
2645 DataArrayIntTuple *pos4=0;
2646 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2651 self->eraseTimeStepIds(&pos1,&pos1+1);
2658 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2663 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2667 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2671 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2673 return self->iterator();
2676 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2678 if(elt0 && PyList_Check(elt0))
2680 int sz=PyList_Size(elt0);
2681 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2682 int *pt=da->getPointer();
2683 for(int i=0;i<sz;i++,pt++)
2685 PyObject *elt1=PyList_GetItem(elt0,i);
2686 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2688 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2690 else if(elt0 && PySlice_Check(elt0))
2692 Py_ssize_t strt=2,stp=2,step=2;
2693 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2694 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2695 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2698 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2701 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2703 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2704 return self->changeMeshNames(modifTab);
2707 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2709 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2710 std::size_t sz=ret.size();
2711 PyObject *retPy=PyList_New(sz);
2712 for(std::size_t i=0;i<sz;i++)
2713 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2717 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2719 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2720 std::size_t sz=ret.size();
2721 PyObject *retPy=PyList_New(sz);
2722 for(std::size_t i=0;i<sz;i++)
2723 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2727 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2729 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2730 std::size_t sz=ret.size();
2731 PyObject *retPy=PyList_New(sz);
2732 for(std::size_t i=0;i<sz;i++)
2733 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2737 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2740 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2741 if(SWIG_IsOK(status))
2743 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2747 std::vector<MEDFileAnyTypeField1TS *> tmp;
2748 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2749 self->pushBackTimeSteps(tmp);
2753 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2755 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2756 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2757 return self->extractPart(extractDefCpp,mm);
2760 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2762 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2763 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2764 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2765 std::size_t sz=ret.size();
2766 PyObject *retPy=PyList_New(sz);
2767 for(std::size_t i=0;i<sz;i++)
2769 std::size_t sz2=ret[i].size();
2770 PyObject *ret1Py=PyList_New(sz2);
2771 for(std::size_t j=0;j<sz2;j++)
2773 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2776 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2778 PyList_SetItem(retPy,i,ret1Py);
2783 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2785 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2786 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2787 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2788 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2789 if(ret2.size()!=ret.size())
2791 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2792 throw INTERP_KERNEL::Exception(oss.str().c_str());
2794 std::size_t sz=ret.size();
2795 PyObject *retPy=PyList_New(sz);
2796 for(std::size_t i=0;i<sz;i++)
2798 std::size_t sz2=ret[i].size();
2799 PyObject *ret0Py=PyTuple_New(2);
2800 PyObject *ret1Py=PyList_New(sz2);
2801 for(std::size_t j=0;j<sz2;j++)
2803 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2806 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2808 PyTuple_SetItem(ret0Py,0,ret1Py);
2809 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2810 PyList_SetItem(retPy,i,ret0Py);
2817 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2820 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2821 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2822 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2823 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2825 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2826 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2827 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2828 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2829 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2830 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2832 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2833 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2834 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2837 MEDFileFieldMultiTS()
2839 return MEDFileFieldMultiTS::New();
2842 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2844 return MEDFileFieldMultiTS::New(fileName,loadAll);
2847 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2849 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2852 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2854 return MEDFileFieldMultiTS::New(db);
2858 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2860 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2863 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2865 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2866 std::size_t sz(tmp.size());
2867 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2868 for(std::size_t i=0;i<sz;i++)
2870 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2871 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2873 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2876 std::string __str__() const throw(INTERP_KERNEL::Exception)
2878 return self->simpleRepr();
2881 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2883 DataArrayInt *ret1=0;
2884 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2885 PyObject *ret=PyTuple_New(2);
2886 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2887 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2891 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2893 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2894 std::vector< std::vector<TypeOfField> > typesF;
2895 std::vector< std::vector<std::string> > pfls;
2896 std::vector< std::vector<std::string> > locs;
2897 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2899 PyObject *ret2=PyList_New(sz);
2900 for(int i=0;i<sz;i++)
2902 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2903 const std::vector<TypeOfField>& typesFI=typesF[i];
2904 const std::vector<std::string>& pflsI=pfls[i];
2905 const std::vector<std::string>& locsI=locs[i];
2906 PyObject *elt=PyTuple_New(2);
2907 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2908 int sz2=ret[i].size();
2909 PyObject *elt2=PyList_New(sz2);
2910 for(int j=0;j<sz2;j++)
2912 PyObject *elt3=PyTuple_New(4);
2913 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2914 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2915 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2916 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2917 PyList_SetItem(elt2,j,elt3);
2919 PyTuple_SetItem(elt,1,elt2);
2920 PyList_SetItem(ret2,i,elt);
2924 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2926 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2932 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2934 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2935 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2938 PyObject *ret=PyTuple_New(2);
2939 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2940 std::size_t sz=elt1Cpp.size();
2941 PyObject *elt=PyList_New(sz);
2942 for(std::size_t i=0;i<sz;i++)
2944 PyObject *elt1=PyTuple_New(2);
2945 PyObject *elt2=PyTuple_New(2);
2946 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2947 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2948 PyObject *elt3=PyTuple_New(2);
2949 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2950 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2951 PyTuple_SetItem(elt1,0,elt2);
2952 PyTuple_SetItem(elt1,1,elt3);
2953 PyList_SetItem(elt,i,elt1);
2955 PyTuple_SetItem(ret,1,elt);
2961 class MEDFileFieldsIterator
2966 PyObject *next() throw(INTERP_KERNEL::Exception)
2968 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2970 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2973 PyErr_SetString(PyExc_StopIteration,"No more data.");
2980 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2983 static MEDFileIntFieldMultiTS *New();
2984 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2985 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2986 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2988 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2989 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2990 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2991 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2992 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2993 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2994 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2995 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2996 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2999 MEDFileIntFieldMultiTS()
3001 return MEDFileIntFieldMultiTS::New();
3004 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3006 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
3009 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3011 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
3014 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3016 return MEDFileIntFieldMultiTS::New(db);
3020 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3022 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
3025 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3027 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3028 std::size_t sz(tmp.size());
3029 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3030 for(std::size_t i=0;i<sz;i++)
3032 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3033 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3035 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3038 std::string __str__() const throw(INTERP_KERNEL::Exception)
3040 return self->simpleRepr();
3043 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3045 DataArrayInt *ret1=0;
3046 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3047 PyObject *ret=PyTuple_New(2);
3048 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3049 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3053 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3055 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3063 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3066 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3067 std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3070 MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3072 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3073 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3081 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3084 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3086 MEDFileStructureElements();
3089 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3092 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3093 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3094 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3095 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
3096 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3097 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3098 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3099 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3100 void loadArrays() throw(INTERP_KERNEL::Exception);
3101 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3102 void unloadArrays() throw(INTERP_KERNEL::Exception);
3103 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3104 int getNumberOfFields() const;
3105 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3106 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3108 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3109 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3110 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3111 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3112 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3113 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3114 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3115 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3116 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3117 void killStructureElements() throw(INTERP_KERNEL::Exception);
3118 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3119 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3120 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3121 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3122 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3127 return MEDFileFields::New();
3130 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3132 return MEDFileFields::New(fileName,loadAll);
3135 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3137 return MEDFileFields::New(db);
3140 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
3142 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3146 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3148 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3151 std::string __str__() const throw(INTERP_KERNEL::Exception)
3153 return self->simpleRepr();
3156 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3158 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3162 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3164 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3168 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3170 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3171 std::size_t sz(tmp.size());
3172 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3173 for(std::size_t i=0;i<sz;i++)
3175 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3176 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3178 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3181 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3183 std::vector< std::pair<std::string,std::string> > ps;
3184 self->getMeshSENames(ps);
3185 return convertVectPairStToPy(ps);
3188 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3191 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3192 PyObject *ret=PyTuple_New(2);
3193 PyObject *ret_0=PyList_New(ret0.size());
3195 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3197 PyObject *elt=PyTuple_New(2);
3198 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3199 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3200 PyList_SetItem(ret_0,rk,elt);
3202 PyTuple_SetItem(ret,0,ret_0);
3203 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3204 PyTuple_SetItem(ret,1,ret_1);
3208 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3210 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3211 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3214 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3216 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3217 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3220 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3222 if(obj && PyList_Check(obj))
3224 int sz=PyList_Size(obj);
3225 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3226 int *pt=da->getPointer();
3227 for(int i=0;i<sz;i++,pt++)
3229 PyObject *elt1=PyList_GetItem(obj,i);
3230 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3232 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3235 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3238 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3240 self->setFieldAtPos(obj,field);
3244 int __len__() const throw(INTERP_KERNEL::Exception)
3246 return self->getNumberOfFields();
3249 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3251 return self->iterator();
3254 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3256 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3257 return self->changeMeshNames(modifTab);
3260 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3262 if(elt0 && PyInt_Check(elt0))
3264 return PyInt_AS_LONG(elt0);
3266 else if(elt0 && PyString_Check(elt0))
3267 return self->getPosFromFieldName(PyString_AsString(elt0));
3269 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3272 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3274 if(PyList_Check(elts))
3276 int sz=PyList_Size(elts);
3277 std::vector<int> ret(sz);
3278 for(int i=0;i<sz;i++)
3280 PyObject *elt=PyList_GetItem(elts,i);
3281 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3287 std::vector<int> ret(1);
3288 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3293 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3295 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3296 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3297 self->pushFields(tmp);
3300 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3302 if(elts && PySlice_Check(elts))
3304 Py_ssize_t strt=2,stp=2,step=2;
3305 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3306 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3307 self->destroyFieldsAtPos2(strt,stp,step);
3311 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3312 if(!idsToRemove.empty())
3313 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3317 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3319 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3320 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3321 return self->extractPart(extractDefCpp,mm);
3326 class MEDFileParameter1TS : public RefCountObject
3329 void setIteration(int it);
3330 int getIteration() const;
3331 void setOrder(int order);
3332 int getOrder() const;
3333 void setTimeValue(double time);
3334 void setTime(int dt, int it, double time);
3335 double getTime(int& dt, int& it);
3336 double getTimeValue() const;
3339 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3342 void setValue(double val) throw(INTERP_KERNEL::Exception);
3343 double getValue() const throw(INTERP_KERNEL::Exception);
3344 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3347 std::string __str__() const throw(INTERP_KERNEL::Exception)
3349 return self->simpleRepr();
3354 class MEDFileParameterTinyInfo : public MEDFileWritable
3357 void setDescription(const std::string& name);
3358 std::string getDescription() const;
3359 void setTimeUnit(const std::string& unit);
3360 std::string getTimeUnit() const;
3363 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3366 static MEDFileParameterDouble1TS *New();
3367 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3368 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3369 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3370 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3371 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3372 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3373 std::string getName() const throw(INTERP_KERNEL::Exception);
3374 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3377 MEDFileParameterDouble1TS()
3379 return MEDFileParameterDouble1TS::New();
3382 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3384 return MEDFileParameterDouble1TS::New(fileName);
3387 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3389 return MEDFileParameterDouble1TS::New(fileName,paramName);
3392 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3394 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3397 std::string __str__() const throw(INTERP_KERNEL::Exception)
3399 return self->simpleRepr();
3402 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3405 bool ret0=self->isEqual(other,eps,what);
3406 PyObject *res=PyList_New(2);
3407 PyObject *ret0Py=ret0?Py_True:Py_False;
3409 PyList_SetItem(res,0,ret0Py);
3410 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3416 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3419 static MEDFileParameterMultiTS *New();
3420 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3421 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3422 std::string getName() const;
3423 void setName(const std::string& name);
3424 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3425 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3426 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3427 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3428 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3429 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3430 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3431 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3434 MEDFileParameterMultiTS()
3436 return MEDFileParameterMultiTS::New();
3439 MEDFileParameterMultiTS(const std::string& fileName)
3441 return MEDFileParameterMultiTS::New(fileName);
3444 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3446 return MEDFileParameterMultiTS::New(fileName,paramName);
3449 std::string __str__() const throw(INTERP_KERNEL::Exception)
3451 return self->simpleRepr();
3454 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3457 bool ret0=self->isEqual(other,eps,what);
3458 PyObject *res=PyList_New(2);
3459 PyObject *ret0Py=ret0?Py_True:Py_False;
3461 PyList_SetItem(res,0,ret0Py);
3462 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3466 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3470 std::vector<int> pos2;
3471 DataArrayInt *pos3=0;
3472 DataArrayIntTuple *pos4=0;
3473 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3478 self->eraseTimeStepIds(&pos1,&pos1+1);
3485 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3490 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3494 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3498 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3500 if(elt0 && PyInt_Check(elt0))
3502 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3505 else if(elt0 && PyTuple_Check(elt0))
3507 if(PyTuple_Size(elt0)==2)
3509 PyObject *o0=PyTuple_GetItem(elt0,0);
3510 PyObject *o1=PyTuple_GetItem(elt0,1);
3511 if(PyInt_Check(o0) && PyInt_Check(o1))
3513 int iter=PyInt_AS_LONG(o0);
3514 int order=PyInt_AS_LONG(o1);
3515 return self->getPosOfTimeStep(iter,order);
3518 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 !");
3521 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 !");
3523 else if(elt0 && PyFloat_Check(elt0))
3525 double val=PyFloat_AS_DOUBLE(elt0);
3526 return self->getPosGivenTime(val);
3529 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3532 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3534 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3540 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3542 if(PyList_Check(elts))
3544 int sz=PyList_Size(elts);
3545 std::vector<int> ret(sz);
3546 for(int i=0;i<sz;i++)
3548 PyObject *elt=PyList_GetItem(elts,i);
3549 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3555 std::vector<int> ret(1);
3556 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3561 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3563 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3564 if(!idsToRemove.empty())
3565 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3568 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3570 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3576 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3578 std::vector< std::pair<int,int> > res=self->getIterations();
3579 PyObject *ret=PyList_New(res.size());
3581 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3583 PyObject *elt=PyTuple_New(2);
3584 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3585 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3586 PyList_SetItem(ret,rk,elt);
3591 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3593 std::vector<double> res2;
3594 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3595 PyObject *ret=PyList_New(res.size());
3597 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3599 PyObject *elt=PyTuple_New(3);
3600 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3601 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3602 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3603 PyList_SetItem(ret,rk,elt);
3610 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3613 static MEDFileParameters *New();
3614 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3615 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3616 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3617 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3618 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3619 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3620 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3621 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3622 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3623 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3624 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3629 return MEDFileParameters::New();
3632 MEDFileParameters(const std::string& fileName)
3634 return MEDFileParameters::New(fileName);
3637 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3639 return MEDFileParameters::New(db);
3643 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3645 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3648 std::string __str__() const throw(INTERP_KERNEL::Exception)
3650 return self->simpleRepr();
3653 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3655 if(PyInt_Check(obj))
3657 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3662 else if(PyString_Check(obj))
3664 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3670 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3673 int __len__() const throw(INTERP_KERNEL::Exception)
3675 return self->getNumberOfParams();
3678 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3680 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3686 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3688 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3694 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3697 bool ret0=self->isEqual(other,eps,what);
3698 PyObject *res=PyList_New(2);
3699 PyObject *ret0Py=ret0?Py_True:Py_False;
3701 PyList_SetItem(res,0,ret0Py);
3702 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3708 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3711 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3712 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3713 static MEDFileData *New();
3714 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3715 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3716 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3717 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3718 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3719 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3720 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3722 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3723 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3724 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3725 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3726 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3730 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3732 return MEDFileData::New(fileName);
3735 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3737 return MEDFileData::New(db);
3742 return MEDFileData::New();
3745 std::string __str__() const throw(INTERP_KERNEL::Exception)
3747 return self->simpleRepr();
3750 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3752 MEDFileMeshes *ret=self->getMeshes();
3758 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3760 MEDFileParameters *ret=self->getParams();
3766 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3768 MEDFileFields *ret=self->getFields();
3774 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3776 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3777 return self->changeMeshNames(modifTab);
3780 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3782 std::vector<const MEDFileData *> mfdsCpp;
3783 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3784 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3789 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3791 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3796 class SauvReader : public RefCountObject
3799 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3800 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3803 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3805 return SauvReader::New(fileName);
3810 class SauvWriter : public RefCountObject
3813 static SauvWriter * New();
3814 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3815 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3816 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3817 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3820 SauvWriter() throw(INTERP_KERNEL::Exception)
3822 return SauvWriter::New();
3829 class MEDFileMeshStruct;
3831 class MEDFileField1TSStructItem
3834 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3837 class MEDFileMeshStruct : public RefCountObject
3840 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3842 ~MEDFileMeshStruct();
3845 class MEDMeshMultiLev : public RefCountObject
3848 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3849 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3850 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3856 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3858 DataArrayInt *famIds(0);
3859 bool isWithoutCopy(false);
3860 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3861 PyObject *ret=PyTuple_New(2);
3862 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3864 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3865 PyTuple_SetItem(ret,1,ret1Py);
3869 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3871 DataArrayInt *numIds(0);
3872 bool isWithoutCopy(false);
3873 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3874 PyObject *ret=PyTuple_New(2);
3875 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3877 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3878 PyTuple_SetItem(ret,1,ret1Py);
3882 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3884 DataArrayInt *famIds(0);
3885 bool isWithoutCopy(false);
3886 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3887 PyObject *ret=PyTuple_New(2);
3888 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3890 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3891 PyTuple_SetItem(ret,1,ret1Py);
3895 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3897 DataArrayInt *numIds(0);
3898 bool isWithoutCopy(false);
3899 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3900 PyObject *ret=PyTuple_New(2);
3901 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3903 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3904 PyTuple_SetItem(ret,1,ret1Py);
3908 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3910 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3911 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3912 PyObject *res(PyList_New(result.size()));
3913 for(int i=0;iL!=result.end(); i++, iL++)
3914 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3920 class MEDUMeshMultiLev : public MEDMeshMultiLev
3923 ~MEDUMeshMultiLev();
3927 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3929 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3930 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3931 PyObject *ret0Py=ncc?Py_True:Py_False;
3933 PyObject *ret=PyTuple_New(7);
3934 PyTuple_SetItem(ret,0,ret0Py);
3935 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3936 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3937 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3938 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3939 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3940 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3946 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3949 ~MEDStructuredMeshMultiLev();
3952 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3955 ~MEDCMeshMultiLev();
3959 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3962 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3963 std::size_t sz(objs.size());
3964 PyObject *ret(PyTuple_New(2));
3965 PyObject *ret0=PyList_New(sz);
3966 for(std::size_t i=0;i<sz;i++)
3967 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3968 PyTuple_SetItem(ret,0,ret0);
3969 PyObject *ret1Py(isInternal?Py_True:Py_False);
3971 PyTuple_SetItem(ret,1,ret1Py);
3977 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3980 ~MEDCurveLinearMeshMultiLev();
3984 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3986 DataArrayDouble *ret0(0);
3987 std::vector<int> ret1;
3989 self->buildVTUArrays(ret0,ret1,ret2);
3990 std::size_t sz(ret1.size());
3991 PyObject *ret=PyTuple_New(3);
3992 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3993 PyObject *ret1Py=PyList_New(sz);
3994 for(std::size_t i=0;i<sz;i++)
3995 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3996 PyTuple_SetItem(ret,1,ret1Py);
3997 PyObject *ret2Py(ret2?Py_True:Py_False);
3999 PyTuple_SetItem(ret,2,ret2Py);
4005 class MEDFileFastCellSupportComparator : public RefCountObject
4008 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
4009 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4010 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4011 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
4013 ~MEDFileFastCellSupportComparator();
4017 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
4019 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4020 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4021 PyObject *res(PyList_New(result.size()));
4022 for(int i=0;iL!=result.end(); i++, iL++)
4023 PyList_SetItem(res,i,PyInt_FromLong(*iL));