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 "MEDFileMeshReadSelector.hxx"
41 #include "MEDFileFieldOverView.hxx"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
46 using namespace MEDCoupling;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) MEDCoupling::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) MEDCoupling::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) MEDCoupling::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject ReadUMeshFromFamiliesSwig;
79 %newobject ReadUMeshFromGroupsSwig;
80 %newobject MEDCoupling::ReadUMeshFromFile;
81 %newobject MEDCoupling::ReadMeshFromFile;
82 %newobject MEDCoupling::ReadField;
83 %newobject MEDCoupling::ReadFieldCell;
84 %newobject MEDCoupling::ReadFieldNode;
85 %newobject MEDCoupling::ReadFieldGauss;
86 %newobject MEDCoupling::ReadFieldGaussNE;
87 %newobject MEDCoupling::MEDFileMesh::New;
88 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
89 %newobject MEDCoupling::MEDFileMesh::deepCopy;
90 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
91 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
92 %newobject MEDCoupling::MEDFileMesh::__getitem__;
93 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
94 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
95 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
97 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
101 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
104 %newobject MEDCoupling::MEDFileMesh::cartesianize;
105 %newobject MEDCoupling::MEDFileData::getJoints;
106 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject MEDCoupling::MEDFileUMesh::New;
108 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
109 %newobject MEDCoupling::MEDFileUMesh::getCoords;
110 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
111 %newobject MEDCoupling::MEDFileUMesh::getGroup;
112 %newobject MEDCoupling::MEDFileUMesh::getGroups;
113 %newobject MEDCoupling::MEDFileUMesh::getFamily;
114 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
115 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
116 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
120 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
121 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
123 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
124 %newobject MEDCoupling::MEDFileUMesh::extractPart;
125 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
126 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
127 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
128 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
129 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
130 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
131 %newobject MEDCoupling::MEDFileCMesh::New;
132 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
133 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
134 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
136 %newobject MEDCoupling::MEDFileMeshes::New;
137 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
138 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
139 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
140 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
141 %newobject MEDCoupling::MEDFileMeshes::__iter__;
143 %newobject MEDCoupling::MEDFileFields::New;
144 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
145 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
146 %newobject MEDCoupling::MEDFileFields::deepCopy;
147 %newobject MEDCoupling::MEDFileFields::shallowCpy;
148 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
149 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
150 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
151 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
152 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
153 %newobject MEDCoupling::MEDFileFields::__iter__;
154 %newobject MEDCoupling::MEDFileFields::extractPart;
156 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
157 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
158 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
159 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
160 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
161 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
162 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
163 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
164 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
165 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
166 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
167 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
168 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
169 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
170 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
171 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
172 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
173 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
174 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
175 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
176 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
177 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
178 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
179 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
180 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
181 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
182 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
183 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
185 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
186 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
187 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
188 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
189 %newobject MEDCoupling::MEDFileField1TS::New;
190 %newobject MEDCoupling::MEDFileField1TS::field;
191 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
192 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
193 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
194 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
195 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
196 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
198 %newobject MEDCoupling::MEDFileIntField1TS::New;
199 %newobject MEDCoupling::MEDFileIntField1TS::field;
200 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
201 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
202 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
203 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
204 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
205 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
207 %newobject MEDCoupling::MEDFileData::New;
208 %newobject MEDCoupling::MEDFileData::deepCopy;
209 %newobject MEDCoupling::MEDFileData::getMeshes;
210 %newobject MEDCoupling::MEDFileData::getFields;
211 %newobject MEDCoupling::MEDFileData::getParams;
212 %newobject MEDCoupling::MEDFileData::Aggregate;
214 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
215 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
216 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
217 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
218 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
219 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
220 %newobject MEDCoupling::MEDFileParameters::New;
221 %newobject MEDCoupling::MEDFileParameters::deepCopy;
222 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
223 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
224 %newobject MEDCoupling::MEDFileParameters::__getitem__;
226 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
227 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
228 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
229 %newobject MEDCoupling::MEDFileJointOneStep::New;
230 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
231 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
232 %newobject MEDCoupling::MEDFileJoint::New;
233 %newobject MEDCoupling::MEDFileJoint::deepCopy;
234 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
235 %newobject MEDCoupling::MEDFileJoints::New;
236 %newobject MEDCoupling::MEDFileJoints::deepCopy;
237 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
238 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
239 %newobject MEDCoupling::MEDFileJoints::__getitem__;
240 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
241 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
242 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
243 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
244 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
245 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
246 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
247 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
248 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
250 %newobject MEDCoupling::SauvWriter::New;
251 %newobject MEDCoupling::SauvReader::New;
252 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
254 %newobject MEDCoupling::MEDFileMeshStruct::New;
255 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
256 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
257 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
258 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
259 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
261 %feature("unref") MEDFileMesh "$this->decrRef();"
262 %feature("unref") MEDFileUMesh "$this->decrRef();"
263 %feature("unref") MEDFileCMesh "$this->decrRef();"
264 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
265 %feature("unref") MEDFileMeshes "$this->decrRef();"
266 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
267 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
268 %feature("unref") MEDFileField1TS "$this->decrRef();"
269 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
270 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
271 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
272 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
273 %feature("unref") MEDFileFields "$this->decrRef();"
274 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
275 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
276 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
277 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
278 %feature("unref") MEDFileParameters "$this->decrRef();"
279 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
280 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
281 %feature("unref") MEDFileJoint "$this->decrRef();"
282 %feature("unref") MEDFileJoints "$this->decrRef();"
283 %feature("unref") MEDFileEquivalences "$this->decrRef();"
284 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
285 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
286 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
287 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
288 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
289 %feature("unref") MEDFileData "$this->decrRef();"
290 %feature("unref") SauvReader "$this->decrRef();"
291 %feature("unref") SauvWriter "$this->decrRef();"
292 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
293 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
294 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
295 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
296 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
297 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
299 namespace MEDCoupling
302 std::string MEDFileVersionStr();
303 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
304 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
305 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
306 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
307 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
308 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
309 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
310 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
311 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
312 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
313 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
314 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
315 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
316 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
317 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
318 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
319 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
320 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
321 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
322 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
323 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
324 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
325 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
326 MEDCoupling::MEDCouplingFieldDouble *ReadField(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);
327 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);
328 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);
329 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);
330 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);
331 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
332 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
333 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
334 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
335 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
336 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
339 %rename (MEDFileVersion) MEDFileVersionSwig;
340 %rename (GetFieldIterations) GetFieldIterationsSwig;
341 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
342 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
343 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
344 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
345 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
346 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
347 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
348 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
349 %rename (WriteUMeshes) WriteUMeshesSwig;
350 %rename (GetTypesOfField) GetTypesOfFieldSwig;
351 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
352 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
356 PyObject *MEDFileVersionSwig()
358 int major,minor,release;
359 MEDCoupling::MEDFileVersion(major,minor,release);
360 PyObject *ret(PyTuple_New(3));
361 PyTuple_SetItem(ret,0,SWIG_From_int(major));
362 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
363 PyTuple_SetItem(ret,2,SWIG_From_int(release));
367 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
369 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
370 PyObject *ret=PyList_New(res.size());
372 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
374 PyObject *elt=PyTuple_New(2);
375 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
376 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
377 PyList_SetItem(ret,rk,elt);
382 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
384 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
385 PyObject *ret=PyList_New(res.size());
387 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
389 PyObject *elt=PyTuple_New(3);
390 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
391 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
392 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
393 PyList_SetItem(ret,rk,elt);
398 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
400 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
401 PyObject *ret=PyList_New(res.size());
403 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
405 PyObject *elt=PyTuple_New(2);
406 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
407 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
408 PyList_SetItem(ret,rk,elt);
413 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
415 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
416 PyObject *ret=PyList_New(res.size());
418 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
420 PyObject *elt=PyTuple_New(2);
421 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
422 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
423 PyList_SetItem(ret,rk,elt);
428 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
430 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
431 PyObject *ret=PyList_New(res.size());
433 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
435 PyObject *elt=PyTuple_New(2);
436 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
437 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
438 PyList_SetItem(ret,rk,elt);
443 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
445 int meshDim,spaceDim,numberOfNodes;
446 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
447 PyObject *ret=PyTuple_New(4);
448 PyObject *elt0=PyList_New(res.size());
450 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
452 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
454 PyObject *elt1=PyList_New(obj2.size());
455 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
457 PyObject *elt2=PyTuple_New(2);
458 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
459 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
460 PyList_SetItem(elt1,j,elt2);
462 PyList_SetItem(elt0,i,elt1);
464 PyTuple_SetItem(ret,0,elt0);
465 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
466 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
467 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
471 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
472 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
474 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
475 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
476 return convertFieldDoubleVecToPy(res);
479 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
481 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
482 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
483 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
486 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
488 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
489 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
490 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
493 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
495 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
496 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
497 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
500 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
502 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
504 PyObject *ret=PyList_New(size);
505 for(int i=0;i<size;i++)
506 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
510 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
512 std::vector<std::string> grps;
513 converPyListToVecString(li,grps);
514 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
517 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
519 std::vector<std::string> fams;
520 converPyListToVecString(li,fams);
521 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
525 namespace MEDCoupling
527 class MEDFileWritable
530 void copyOptionsFrom(const MEDFileWritable& other) const;
531 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
532 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
533 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
534 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
537 class MEDFileWritableStandAlone : public MEDFileWritable
540 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
541 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
544 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
546 MCAuto<DataArrayByte> ret(self->serialize());
550 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
553 PyObject *ret(PyTuple_New(1));
554 PyObject *ret0(PyDict_New());
555 DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
556 PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
557 {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
558 PyObject *tmp1(PyInt_FromLong(0));
559 PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
560 PyTuple_SetItem(ret,0,ret0);
564 throw INTERP_KERNEL::Exception("PyWrap of MEDFileData.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
570 class MEDFileMeshReadSelector
573 MEDFileMeshReadSelector();
574 MEDFileMeshReadSelector(unsigned int code);
575 unsigned int getCode() const;
576 void setCode(unsigned int newCode);
577 bool isCellFamilyFieldReading() const;
578 bool isNodeFamilyFieldReading() const;
579 bool isCellNameFieldReading() const;
580 bool isNodeNameFieldReading() const;
581 bool isCellNumFieldReading() const;
582 bool isNodeNumFieldReading() const;
583 void setCellFamilyFieldReading(bool b);
584 void setNodeFamilyFieldReading(bool b);
585 void setCellNameFieldReading(bool b);
586 void setNodeNameFieldReading(bool b);
587 void setCellNumFieldReading(bool b);
588 void setNodeNumFieldReading(bool b);
591 std::string __str__() const throw(INTERP_KERNEL::Exception)
593 std::ostringstream oss;
598 std::string __repr__() const throw(INTERP_KERNEL::Exception)
600 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
606 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
609 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
610 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
611 throw(INTERP_KERNEL::Exception);
612 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
613 INTERP_KERNEL::NormalizedCellType loc_geo_type,
614 INTERP_KERNEL::NormalizedCellType rem_geo_type)
615 throw(INTERP_KERNEL::Exception);
616 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
617 MEDFileJointCorrespondence *deepCopy() const;
618 MEDFileJointCorrespondence *shallowCpy() const;
619 void setIsNodal(bool isNodal);
620 bool getIsNodal() const;
621 bool isEqual(const MEDFileJointCorrespondence *other) const;
622 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
623 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
624 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
625 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
626 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
627 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
628 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);
629 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
632 MEDFileJointCorrespondence()
634 return MEDFileJointCorrespondence::New();
636 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
638 return MEDFileJointCorrespondence::New(correspondence);
640 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
641 INTERP_KERNEL::NormalizedCellType loc_geo_type,
642 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
644 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
647 std::string __str__() const throw(INTERP_KERNEL::Exception)
649 return self->simpleRepr();
654 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
657 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
658 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
659 MEDFileJointOneStep *deepCopy() const;
660 MEDFileJointOneStep *shallowCpy() const;
661 bool isEqual(const MEDFileJointOneStep *other) const;
662 void setOrder(int order);
663 int getOrder() const;
664 void setIteration(int it);
665 int getIteration() const;
666 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
667 int getNumberOfCorrespondences() const;
668 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
669 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
670 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
673 MEDFileJointOneStep()
675 return MEDFileJointOneStep::New();
678 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
680 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
683 std::string __str__() const throw(INTERP_KERNEL::Exception)
685 return self->simpleRepr();
690 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
693 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
694 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
695 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
696 MEDFileJoint *deepCopy() const;
697 MEDFileJoint *shallowCpy() const;
698 bool isEqual(const MEDFileJoint *other) const;
699 void setLocalMeshName(const std::string& name);
700 std::string getLocalMeshName() const;
701 void setRemoteMeshName(const std::string& name);
702 std::string getRemoteMeshName() const;
703 void setDescription(const std::string& name);
704 std::string getDescription() const;
705 void setJointName(const std::string& name);
706 std::string getJointName() const;
707 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
708 void setDomainNumber(const int& number);
709 int getDomainNumber() const;
710 void pushStep(MEDFileJointOneStep* step);
711 int getNumberOfSteps() const;
712 MEDFileJointOneStep *getStepAtPos(int i) const;
713 std::string simpleRepr() const;
718 return MEDFileJoint::New();
721 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
723 return MEDFileJoint::New(fileName,mName,num);
726 std::string __str__() const throw(INTERP_KERNEL::Exception)
728 return self->simpleRepr();
733 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
736 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
737 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
738 MEDFileJoints *deepCopy() const;
739 std::string simpleRepr() const;
740 std::string getMeshName() const;
741 int getNumberOfJoints() const;
742 std::vector<std::string> getJointsNames() const;
743 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
744 void resize(int newSize) throw(INTERP_KERNEL::Exception);
745 void pushJoint(MEDFileJoint *joint);
746 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
747 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
752 return MEDFileJoints::New();
755 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
757 return MEDFileJoints::New(fileName,meshName);
760 std::string __str__() const throw(INTERP_KERNEL::Exception)
762 return self->simpleRepr();
765 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
769 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
774 else if(PyString_Check(obj))
776 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
782 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
785 int __len__() const throw(INTERP_KERNEL::Exception)
787 return self->getNumberOfJoints();
790 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
792 MEDFileJoint *ret=self->getJointAtPos(i);
798 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
800 MEDFileJoint *ret=self->getJointWithName(paramName);
808 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
811 MEDFileEquivalenceBase();
814 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
817 MEDFileEquivalenceData();
819 void setArray(DataArrayInt *data);
822 DataArrayInt *getArray()
824 DataArrayInt *ret(self->getArray());
825 if(ret) ret->incrRef();
831 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
834 MEDFileEquivalenceNode();
837 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
840 MEDFileEquivalenceCell();
843 std::size_t size() const;
844 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
845 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
848 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
850 DataArrayInt *ret(self->getArray(type));
851 if(ret) ret->incrRef();
855 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
857 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
858 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
859 PyObject *res=PyList_New(result.size());
860 for(int i=0;iL!=result.end(); i++, iL++)
861 PyList_SetItem(res,i,PyInt_FromLong(*iL));
867 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
870 MEDFileEquivalencePair();
872 std::string getName() const;
873 void setName(const std::string& name);
874 std::string getDescription() const;
875 void setDescription(const std::string& descr);
876 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
879 MEDFileEquivalenceCell *initCell()
881 MEDFileEquivalenceCell *ret(self->initCell());
882 if(ret) ret->incrRef();
886 MEDFileEquivalenceNode *initNode()
888 MEDFileEquivalenceNode *ret(self->initNode());
889 if(ret) ret->incrRef();
893 MEDFileEquivalenceCell *getCell()
895 MEDFileEquivalenceCell *ret(self->getCell());
896 if(ret) ret->incrRef();
900 MEDFileEquivalenceNode *getNode()
902 MEDFileEquivalenceNode *ret(self->getNode());
903 if(ret) ret->incrRef();
909 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
912 MEDFileEquivalences();
915 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
916 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
917 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
921 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
923 MEDFileEquivalencePair *ret(self->getEquivalence(i));
924 if(ret) ret->incrRef();
927 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
929 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
930 if(ret) ret->incrRef();
934 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
936 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
937 if(ret) ret->incrRef();
943 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
946 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
947 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
948 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
949 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
950 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
951 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
952 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
953 void setName(const std::string& name);
954 std::string getName();
955 std::string getUnivName() const;
956 bool getUnivNameWrStatus() const;
957 void setUnivNameWrStatus(bool newStatus);
958 void setDescription(const std::string& name);
959 std::string getDescription() const;
960 void setOrder(int order);
961 int getOrder() const;
962 void setIteration(int it);
964 void setTimeValue(double time);
965 void setTime(int dt, int it, double time);
966 double getTimeValue() const;
967 void setTimeUnit(const std::string& unit);
968 std::string getTimeUnit() const;
969 void setAxisType(MEDCouplingAxisType at);
970 MEDCouplingAxisType getAxisType() const;
971 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
972 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
973 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
974 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
975 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
976 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
977 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
978 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
979 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
980 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
981 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
982 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
983 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
984 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
986 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
987 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
988 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
989 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
990 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
991 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
992 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
993 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
994 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
995 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
996 void clearGrpMap() throw(INTERP_KERNEL::Exception);
997 void clearFamMap() throw(INTERP_KERNEL::Exception);
998 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
999 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1000 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1001 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1002 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1003 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1004 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1005 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1006 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1007 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1008 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1009 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1010 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1011 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1012 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1013 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1014 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1015 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1016 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1017 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1018 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1019 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1020 static std::string GetMagicFamilyStr();
1021 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1022 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1023 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1024 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1025 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1026 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1027 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1028 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1029 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1030 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1031 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1032 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1033 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1034 void setFamilyInfo(const std::map<std::string,int>& info);
1035 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1036 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1037 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1038 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1039 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1040 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1041 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1042 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1043 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1044 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1045 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1046 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1047 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1048 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1049 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1050 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1051 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1052 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1053 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1054 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1055 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1057 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1058 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1059 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1060 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1061 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1062 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1063 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1064 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1065 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1066 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1067 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1068 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1069 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1070 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1071 int getNumberOfJoints();
1072 MEDFileJoints *getJoints();
1073 void setJoints( MEDFileJoints* joints );
1074 void initializeEquivalences();
1075 void killEquivalences();
1078 std::string __str__() const throw(INTERP_KERNEL::Exception)
1080 return self->simpleRepr();
1083 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1085 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1088 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1091 double tmp0=self->getTime(tmp1,tmp2);
1092 PyObject *res = PyList_New(3);
1093 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1094 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1095 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1099 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1102 bool ret0=self->isEqual(other,eps,what);
1103 PyObject *res=PyList_New(2);
1104 PyObject *ret0Py=ret0?Py_True:Py_False;
1106 PyList_SetItem(res,0,ret0Py);
1107 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1111 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1113 std::vector<const DataArrayInt *> grps;
1114 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1115 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1118 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1121 bool ret0=self->areFamsEqual(other,what);
1122 PyObject *res=PyList_New(2);
1123 PyObject *ret0Py=ret0?Py_True:Py_False;
1125 PyList_SetItem(res,0,ret0Py);
1126 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1130 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1133 bool ret0=self->areGrpsEqual(other,what);
1134 PyObject *res=PyList_New(2);
1135 PyObject *ret0Py=ret0?Py_True:Py_False;
1137 PyList_SetItem(res,0,ret0Py);
1138 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1142 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1144 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1145 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1146 PyObject *res=PyList_New(result.size());
1147 for(int i=0;iL!=result.end(); i++, iL++)
1148 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1152 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1154 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1155 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1156 PyObject *res=PyList_New(result.size());
1157 for(int i=0;iL!=result.end(); i++, iL++)
1158 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1162 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1164 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1167 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1170 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1172 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1175 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1178 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1180 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1183 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1186 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1188 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1191 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1194 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1196 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1199 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1202 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1205 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1206 PyObject *ret=PyTuple_New(2);
1207 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1208 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1212 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1214 DataArrayInt *ret3=0;
1215 std::vector<int> ret1,ret2;
1216 bool ret0=self->unPolyze(ret1,ret2,ret3);
1217 PyObject *ret=PyTuple_New(4);
1218 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1220 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1221 for(int j=0;j<(int)ret1.size()/3;j++)
1223 PyObject *retLev2=PyList_New(3);
1224 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1225 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1226 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1227 PyList_SetItem(retLev1_0,j,retLev2);
1229 PyTuple_SetItem(ret,1,retLev1_0);
1231 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1232 for(int j=0;j<(int)ret2.size()/3;j++)
1234 PyObject *retLev2=PyList_New(3);
1235 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1236 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1237 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1238 PyList_SetItem(retLev1_1,j,retLev2);
1240 PyTuple_SetItem(ret,2,retLev1_1);
1242 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1246 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1248 MEDFileEquivalences *ret(self->getEquivalences());
1249 if(ret) ret->incrRef();
1255 class MEDFileUMesh : public MEDFileMesh
1258 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1259 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1260 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1261 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1262 static MEDFileUMesh *New();
1263 static const char *GetSpeStr4ExtMesh();
1265 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1266 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1267 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1268 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1269 void clearNodeAndCellNumbers();
1271 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1272 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1273 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1274 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1275 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1276 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1277 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1278 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1279 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1280 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1282 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1283 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1284 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1285 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1286 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1287 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1288 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1289 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1290 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1291 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1292 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1293 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1294 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1295 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1296 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1299 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1301 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1304 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1306 return MEDFileUMesh::New(fileName,mrs);
1309 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1311 return MEDFileUMesh::New(mem);
1314 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1316 return MEDFileUMesh::New(db);
1321 return MEDFileUMesh::New();
1325 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1327 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1330 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)
1332 std::vector<int> typesCpp1;
1333 convertPyToNewIntArr3(types,typesCpp1);
1334 std::size_t sz(typesCpp1.size());
1335 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1336 for(std::size_t ii=0;ii<sz;ii++)
1337 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1338 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1341 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1342 {// put an empty dict in input to say to __new__ to call __init__...
1343 PyObject *ret(PyTuple_New(1));
1344 PyObject *ret0(PyDict_New());
1345 PyTuple_SetItem(ret,0,ret0);
1349 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1351 std::vector<double> a0;
1352 std::vector<int> a1;
1353 std::vector<std::string> a2;
1354 std::vector< MCAuto<DataArrayInt> > a3;
1355 MCAuto<DataArrayDouble> a4;
1356 self->serialize(a0,a1,a2,a3,a4);
1357 PyObject *ret(PyTuple_New(5));
1358 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1359 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1361 PyObject *ret2(PyList_New(sz));
1362 for(int i=0;i<sz;i++)
1363 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1364 PyTuple_SetItem(ret,2,ret2);
1366 PyObject *ret3(PyList_New(sz));
1367 for(int i=0;i<sz;i++)
1369 DataArrayInt *elt(a3[i]);
1372 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1374 PyTuple_SetItem(ret,3,ret3);
1375 DataArrayDouble *ret4(a4);
1378 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1382 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1384 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1385 if(!PyTuple_Check(inp))
1386 throw INTERP_KERNEL::Exception(MSG);
1387 int sz(PyTuple_Size(inp));
1389 throw INTERP_KERNEL::Exception(MSG);
1390 std::vector<double> a0;
1391 std::vector<int> a1;
1392 std::vector<std::string> a2;
1393 std::vector< MCAuto<DataArrayInt> > a3;
1394 MCAuto<DataArrayDouble> a4;
1396 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1398 fillArrayWithPyListDbl3(a0py,tmp,a0);
1399 convertPyToNewIntArr3(a1py,a1);
1400 fillStringVector(a2py,a2);
1402 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1404 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1405 if(!SWIG_IsOK(status))
1406 throw INTERP_KERNEL::Exception(MSG);
1407 a4=reinterpret_cast<DataArrayDouble *>(argp);
1408 if((DataArrayDouble *)a4)
1411 std::vector< DataArrayInt * > a3Tmp;
1412 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1413 std::size_t sz(a3Tmp.size());
1415 for(std::size_t i=0;i<sz;i++)
1419 a3Tmp[i]->incrRef();
1421 self->unserialize(a0,a1,a2,a3,a4);
1425 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1428 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1429 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1432 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1435 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1438 self->setMeshAtLevel(meshDimRelToMax,m1);
1441 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1444 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1446 self->removeMeshAtLevel(meshDimRelToMax);
1449 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1451 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1453 DataArrayDouble *a,*a2;
1454 DataArrayDoubleTuple *aa,*aa2;
1455 std::vector<double> bb,bb2;
1457 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1458 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1459 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1463 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1465 std::vector<const MEDFileUMesh *> meshesCpp;
1466 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1467 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1471 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1473 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1474 return convertVecPairIntToPy(ret);
1477 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1479 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1480 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1481 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1484 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1486 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1487 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1488 return self->extractPart(extractDefCpp);
1491 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1493 std::vector<const MEDCouplingUMesh *> ms;
1494 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1495 self->setMeshes(ms,renum);
1498 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1500 std::vector<const MEDCouplingUMesh *> ms;
1501 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1502 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1505 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1507 std::vector<const MEDCouplingUMesh *> ms;
1508 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1509 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1512 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1514 DataArrayDouble *ret=self->getCoords();
1520 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1522 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1525 return const_cast<PartDefinition *>(ret);
1528 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1530 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1531 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1532 PyObject *ret=PyTuple_New(3);
1533 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1534 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1535 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1539 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1541 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1547 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1549 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1550 std::size_t sz(tmp.size());
1551 PyObject *ret=PyList_New(sz);
1552 for(std::size_t i=0;i<sz;i++)
1556 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1563 class MEDFileStructuredMesh : public MEDFileMesh
1568 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1570 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1578 class MEDFileCMesh : public MEDFileStructuredMesh
1581 static MEDFileCMesh *New();
1582 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1583 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1584 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1585 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1586 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1591 return MEDFileCMesh::New();
1594 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1596 return MEDFileCMesh::New(fileName,mrs);
1599 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1601 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1604 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1606 return MEDFileCMesh::New(db);
1609 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1611 const MEDCouplingCMesh *tmp=self->getMesh();
1614 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1619 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1622 static MEDFileCurveLinearMesh *New();
1623 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1624 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1625 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1626 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1629 MEDFileCurveLinearMesh()
1631 return MEDFileCurveLinearMesh::New();
1634 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1636 return MEDFileCurveLinearMesh::New(fileName,mrs);
1639 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1641 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1644 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1646 return MEDFileCurveLinearMesh::New(db);
1649 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1651 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1654 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1659 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1662 static MEDFileMeshMultiTS *New();
1663 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1664 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1665 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1666 std::string getName() const throw(INTERP_KERNEL::Exception);
1667 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1668 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1671 MEDFileMeshMultiTS()
1673 return MEDFileMeshMultiTS::New();
1676 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1678 return MEDFileMeshMultiTS::New(fileName);
1681 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1683 return MEDFileMeshMultiTS::New(fileName,mName);
1686 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1688 MEDFileMesh *ret=self->getOneTimeStep();
1696 class MEDFileMeshesIterator
1701 PyObject *next() throw(INTERP_KERNEL::Exception)
1703 MEDFileMesh *ret=self->nextt();
1707 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1711 PyErr_SetString(PyExc_StopIteration,"No more data.");
1718 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1721 static MEDFileMeshes *New();
1722 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1723 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1724 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1725 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1727 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1728 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1729 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1730 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1731 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1736 return MEDFileMeshes::New();
1739 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1741 return MEDFileMeshes::New(fileName);
1744 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1746 return MEDFileMeshes::New(db);
1749 std::string __str__() const throw(INTERP_KERNEL::Exception)
1751 return self->simpleRepr();
1754 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1756 if(PyInt_Check(obj))
1758 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1763 else if(PyString_Check(obj))
1765 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1771 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1774 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1776 self->setMeshAtPos(obj,mesh);
1780 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1782 return self->iterator();
1785 int __len__() const throw(INTERP_KERNEL::Exception)
1787 return self->getNumberOfMeshes();
1790 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1792 MEDFileMesh *ret=self->getMeshAtPos(i);
1797 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1799 MEDFileMesh *ret=self->getMeshWithName(mname);
1807 class MEDFileFieldLoc : public RefCountObject
1810 std::string getName() const;
1811 int getDimension() const;
1812 int getNumberOfGaussPoints() const;
1813 int getNumberOfPointsInCells() const;
1814 const std::vector<double>& getRefCoords() const;
1815 const std::vector<double>& getGaussCoords() const;
1816 const std::vector<double>& getGaussWeights() const;
1817 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1820 std::string __str__() const throw(INTERP_KERNEL::Exception)
1822 return self->repr();
1827 class MEDFileFieldGlobsReal
1830 void resetContent();
1831 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1832 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1833 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1834 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1835 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1836 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1837 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1838 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1839 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1840 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1841 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1842 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1843 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1844 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1845 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1846 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1847 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1848 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1849 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1850 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1851 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1852 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1853 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1854 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1855 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1856 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1859 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1861 const DataArrayInt *ret=self->getProfile(pflName);
1864 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1867 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1869 const DataArrayInt *ret=self->getProfileFromId(pflId);
1872 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1875 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1877 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1880 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1883 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1885 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1888 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1891 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1893 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1894 return convertVecPairVecStToPy(ret);
1897 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1899 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1900 return convertVecPairVecStToPy(ret);
1903 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1905 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1906 self->changePflsNames(v);
1909 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1911 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1912 self->changePflsRefsNamesGen(v);
1915 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1917 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1918 self->changePflsNamesInStruct(v);
1921 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1923 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1924 self->changeLocsNames(v);
1927 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1929 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1930 self->changeLocsRefsNamesGen(v);
1933 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1935 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1936 self->changeLocsNamesInStruct(v);
1939 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1941 std::ostringstream oss;
1942 self->simpleReprGlobs(oss);
1948 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
1951 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1952 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1953 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1954 void loadArrays() throw(INTERP_KERNEL::Exception);
1955 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1956 void unloadArrays() throw(INTERP_KERNEL::Exception);
1957 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1958 int getDimension() const throw(INTERP_KERNEL::Exception);
1959 int getIteration() const throw(INTERP_KERNEL::Exception);
1960 int getOrder() const throw(INTERP_KERNEL::Exception);
1961 std::string getName() throw(INTERP_KERNEL::Exception);
1962 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1963 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1964 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1965 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1966 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1967 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1968 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1969 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1970 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1971 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1972 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1973 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1974 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
1975 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1976 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1979 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1982 double tmp0=self->getTime(tmp1,tmp2);
1983 PyObject *res = PyList_New(3);
1984 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1985 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1986 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1990 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1992 std::pair<int,int> res=self->getDtIt();
1993 PyObject *elt=PyTuple_New(2);
1994 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1995 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1999 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2001 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2004 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2006 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2009 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2011 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2012 return self->changeMeshNames(modifTab);
2015 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2017 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2018 PyObject *ret2=PyList_New(ret.size());
2019 for(int i=0;i<(int)ret.size();i++)
2020 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2024 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2026 std::vector<int> ret1;
2027 int ret0=self->getNonEmptyLevels(mname,ret1);
2028 PyObject *elt=PyTuple_New(2);
2029 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2030 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2034 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2036 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2037 std::vector< std::vector<TypeOfField> > typesF;
2038 std::vector< std::vector<std::string> > pfls;
2039 std::vector< std::vector<std::string> > locs;
2040 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2042 PyObject *ret2=PyList_New(sz);
2043 for(int i=0;i<sz;i++)
2045 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2046 const std::vector<TypeOfField>& typesFI=typesF[i];
2047 const std::vector<std::string>& pflsI=pfls[i];
2048 const std::vector<std::string>& locsI=locs[i];
2049 PyObject *elt=PyTuple_New(2);
2050 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2051 int sz2=ret[i].size();
2052 PyObject *elt2=PyList_New(sz2);
2053 for(int j=0;j<sz2;j++)
2055 PyObject *elt3=PyTuple_New(4);
2056 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2057 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));
2058 PyTuple_SetItem(elt3,1,elt4);
2059 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2060 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2061 PyList_SetItem(elt2,j,elt3);
2063 PyTuple_SetItem(elt,1,elt2);
2064 PyList_SetItem(ret2,i,elt);
2069 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2071 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2072 std::size_t sz=ret.size();
2073 PyObject *retPy=PyList_New(sz);
2074 for(std::size_t i=0;i<sz;i++)
2075 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2079 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2081 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2082 std::size_t sz=ret.size();
2083 PyObject *retPy=PyList_New(sz);
2084 for(std::size_t i=0;i<sz;i++)
2085 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2089 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2091 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2092 std::size_t sz=ret.size();
2093 PyObject *retPy=PyList_New(sz);
2094 for(std::size_t i=0;i<sz;i++)
2095 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2099 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2101 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2102 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2103 return self->extractPart(extractDefCpp,mm);
2108 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2111 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2112 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2113 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2114 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2115 static MEDFileField1TS *New();
2116 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2117 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2118 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2119 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2120 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2121 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2122 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2124 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2125 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2126 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2127 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2130 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2132 return MEDFileField1TS::New(fileName,loadAll);
2135 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2137 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2140 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2142 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2145 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2147 return MEDFileField1TS::New(db);
2152 return MEDFileField1TS::New();
2155 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2157 const DataArrayDouble *arr=0;
2159 arr=field->getArray();
2160 self->copyTinyInfoFrom(field,arr);
2163 std::string __str__() const throw(INTERP_KERNEL::Exception)
2165 return self->simpleRepr();
2168 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2170 DataArrayInt *ret1=0;
2171 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2172 PyObject *ret=PyTuple_New(2);
2173 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2174 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2178 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2180 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2181 std::vector< std::vector<TypeOfField> > typesF;
2182 std::vector< std::vector<std::string> > pfls;
2183 std::vector< std::vector<std::string> > locs;
2184 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2186 PyObject *ret2=PyList_New(sz);
2187 for(int i=0;i<sz;i++)
2189 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2190 const std::vector<TypeOfField>& typesFI=typesF[i];
2191 const std::vector<std::string>& pflsI=pfls[i];
2192 const std::vector<std::string>& locsI=locs[i];
2193 PyObject *elt=PyTuple_New(2);
2194 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2195 int sz2=ret[i].size();
2196 PyObject *elt2=PyList_New(sz2);
2197 for(int j=0;j<sz2;j++)
2199 PyObject *elt3=PyTuple_New(4);
2200 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2201 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2202 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2203 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2204 PyList_SetItem(elt2,j,elt3);
2206 PyTuple_SetItem(elt,1,elt2);
2207 PyList_SetItem(ret2,i,elt);
2212 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2214 DataArrayDouble *ret=self->getUndergroundDataArray();
2220 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2222 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2223 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2226 PyObject *ret=PyTuple_New(2);
2227 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2228 std::size_t sz=elt1Cpp.size();
2229 PyObject *elt=PyList_New(sz);
2230 for(std::size_t i=0;i<sz;i++)
2232 PyObject *elt1=PyTuple_New(2);
2233 PyObject *elt2=PyTuple_New(2);
2234 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2235 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2236 PyObject *elt3=PyTuple_New(2);
2237 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2238 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2239 PyTuple_SetItem(elt1,0,elt2);
2240 PyTuple_SetItem(elt1,1,elt3);
2241 PyList_SetItem(elt,i,elt1);
2243 PyTuple_SetItem(ret,1,elt);
2249 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2252 static MEDFileIntField1TS *New();
2253 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2254 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2255 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2256 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2257 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2259 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2260 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2261 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2262 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2263 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2264 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2265 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2266 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2269 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2271 return MEDFileIntField1TS::New();
2274 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2276 return MEDFileIntField1TS::New(fileName,loadAll);
2279 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2281 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2284 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2286 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2289 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2291 return MEDFileIntField1TS::New(db);
2294 std::string __str__() const throw(INTERP_KERNEL::Exception)
2296 return self->simpleRepr();
2299 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2301 DataArrayInt *ret1=0;
2302 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2303 PyObject *ret=PyTuple_New(2);
2304 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2305 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2309 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2311 DataArrayInt *ret=self->getUndergroundDataArray();
2319 class MEDFileAnyTypeFieldMultiTSIterator
2324 PyObject *next() throw(INTERP_KERNEL::Exception)
2326 MEDFileAnyTypeField1TS *ret=self->nextt();
2328 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2331 PyErr_SetString(PyExc_StopIteration,"No more data.");
2338 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2341 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2342 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2343 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2344 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2345 std::string getName() const throw(INTERP_KERNEL::Exception);
2346 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2347 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2348 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2349 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2350 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2351 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2352 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2353 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2354 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2355 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2356 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2357 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2358 void loadArrays() throw(INTERP_KERNEL::Exception);
2359 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2360 void unloadArrays() throw(INTERP_KERNEL::Exception);
2361 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2363 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2364 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2365 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2366 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2367 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2368 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2371 int __len__() const throw(INTERP_KERNEL::Exception)
2373 return self->getNumberOfTS();
2376 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2378 if(elt0 && PyInt_Check(elt0))
2380 int pos=PyInt_AS_LONG(elt0);
2383 else if(elt0 && PyTuple_Check(elt0))
2385 if(PyTuple_Size(elt0)==2)
2387 PyObject *o0=PyTuple_GetItem(elt0,0);
2388 PyObject *o1=PyTuple_GetItem(elt0,1);
2389 if(PyInt_Check(o0) && PyInt_Check(o1))
2391 int iter=PyInt_AS_LONG(o0);
2392 int order=PyInt_AS_LONG(o1);
2393 return self->getPosOfTimeStep(iter,order);
2396 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 !");
2399 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 !");
2401 else if(elt0 && PyFloat_Check(elt0))
2403 double val=PyFloat_AS_DOUBLE(elt0);
2404 return self->getPosGivenTime(val);
2407 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2410 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2412 std::vector< std::pair<int,int> > res(self->getIterations());
2413 return convertVecPairIntToPy(res);
2416 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2418 std::vector<double> ret1;
2419 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2420 std::size_t sz=ret.size();
2421 PyObject *ret2=PyList_New(sz);
2422 for(std::size_t i=0;i<sz;i++)
2424 PyObject *elt=PyTuple_New(3);
2425 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2426 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2427 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2428 PyList_SetItem(ret2,i,elt);
2433 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2435 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2436 PyObject *ret2=PyList_New(ret.size());
2437 for(int i=0;i<(int)ret.size();i++)
2439 const std::vector<TypeOfField>& rett=ret[i];
2440 PyObject *ret3=PyList_New(rett.size());
2441 for(int j=0;j<(int)rett.size();j++)
2442 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2443 PyList_SetItem(ret2,i,ret3);
2448 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2450 std::vector<int> ret1;
2451 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2452 PyObject *elt=PyTuple_New(2);
2453 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2454 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2458 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2460 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2461 std::vector< std::vector<TypeOfField> > typesF;
2462 std::vector< std::vector<std::string> > pfls;
2463 std::vector< std::vector<std::string> > locs;
2464 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2466 PyObject *ret2=PyList_New(sz);
2467 for(int i=0;i<sz;i++)
2469 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2470 const std::vector<TypeOfField>& typesFI=typesF[i];
2471 const std::vector<std::string>& pflsI=pfls[i];
2472 const std::vector<std::string>& locsI=locs[i];
2473 PyObject *elt=PyTuple_New(2);
2474 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2475 int sz2=ret[i].size();
2476 PyObject *elt2=PyList_New(sz2);
2477 for(int j=0;j<sz2;j++)
2479 PyObject *elt3=PyTuple_New(4);
2480 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2481 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));
2482 PyTuple_SetItem(elt3,1,elt4);
2483 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2484 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2485 PyList_SetItem(elt2,j,elt3);
2487 PyTuple_SetItem(elt,1,elt2);
2488 PyList_SetItem(ret2,i,elt);
2493 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2495 if(PyList_Check(elts))
2497 int sz=PyList_Size(elts);
2498 std::vector<int> ret(sz);
2499 for(int i=0;i<sz;i++)
2501 PyObject *elt=PyList_GetItem(elts,i);
2502 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2508 std::vector<int> ret(1);
2509 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2514 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2516 if(PySlice_Check(elts))
2518 Py_ssize_t strt=2,stp=2,step=2;
2519 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2520 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2521 self->eraseTimeStepIds2(strt,stp,step);
2525 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2526 if(!idsToRemove.empty())
2527 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2531 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2535 std::vector<int> pos2;
2536 DataArrayInt *pos3=0;
2537 DataArrayIntTuple *pos4=0;
2538 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2543 self->eraseTimeStepIds(&pos1,&pos1+1);
2550 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2555 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2559 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2563 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2565 return self->iterator();
2568 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2570 if(elt0 && PyList_Check(elt0))
2572 int sz=PyList_Size(elt0);
2573 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2574 int *pt=da->getPointer();
2575 for(int i=0;i<sz;i++,pt++)
2577 PyObject *elt1=PyList_GetItem(elt0,i);
2578 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2580 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2582 else if(elt0 && PySlice_Check(elt0))
2584 Py_ssize_t strt=2,stp=2,step=2;
2585 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2586 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2587 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2590 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2593 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2595 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2596 return self->changeMeshNames(modifTab);
2599 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2601 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2602 std::size_t sz=ret.size();
2603 PyObject *retPy=PyList_New(sz);
2604 for(std::size_t i=0;i<sz;i++)
2605 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2609 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2611 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2612 std::size_t sz=ret.size();
2613 PyObject *retPy=PyList_New(sz);
2614 for(std::size_t i=0;i<sz;i++)
2615 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2619 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2621 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2622 std::size_t sz=ret.size();
2623 PyObject *retPy=PyList_New(sz);
2624 for(std::size_t i=0;i<sz;i++)
2625 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2629 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2632 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2633 if(SWIG_IsOK(status))
2635 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2639 std::vector<MEDFileAnyTypeField1TS *> tmp;
2640 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2641 self->pushBackTimeSteps(tmp);
2645 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2647 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2648 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2649 return self->extractPart(extractDefCpp,mm);
2652 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2654 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2655 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2656 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2657 std::size_t sz=ret.size();
2658 PyObject *retPy=PyList_New(sz);
2659 for(std::size_t i=0;i<sz;i++)
2661 std::size_t sz2=ret[i].size();
2662 PyObject *ret1Py=PyList_New(sz2);
2663 for(std::size_t j=0;j<sz2;j++)
2665 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2668 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2670 PyList_SetItem(retPy,i,ret1Py);
2675 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2677 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2678 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2679 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2680 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2681 if(ret2.size()!=ret.size())
2683 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2684 throw INTERP_KERNEL::Exception(oss.str().c_str());
2686 std::size_t sz=ret.size();
2687 PyObject *retPy=PyList_New(sz);
2688 for(std::size_t i=0;i<sz;i++)
2690 std::size_t sz2=ret[i].size();
2691 PyObject *ret0Py=PyTuple_New(2);
2692 PyObject *ret1Py=PyList_New(sz2);
2693 for(std::size_t j=0;j<sz2;j++)
2695 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2698 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2700 PyTuple_SetItem(ret0Py,0,ret1Py);
2701 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2702 PyList_SetItem(retPy,i,ret0Py);
2709 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2712 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2713 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2714 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2716 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2717 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2718 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2719 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2720 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2721 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2723 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2724 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2725 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2728 MEDFileFieldMultiTS()
2730 return MEDFileFieldMultiTS::New();
2733 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2735 return MEDFileFieldMultiTS::New(fileName,loadAll);
2738 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2740 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2743 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2745 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2746 std::size_t sz(tmp.size());
2747 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2748 for(std::size_t i=0;i<sz;i++)
2750 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2751 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2753 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2756 std::string __str__() const throw(INTERP_KERNEL::Exception)
2758 return self->simpleRepr();
2761 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2763 DataArrayInt *ret1=0;
2764 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2765 PyObject *ret=PyTuple_New(2);
2766 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2767 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2771 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2773 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2774 std::vector< std::vector<TypeOfField> > typesF;
2775 std::vector< std::vector<std::string> > pfls;
2776 std::vector< std::vector<std::string> > locs;
2777 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2779 PyObject *ret2=PyList_New(sz);
2780 for(int i=0;i<sz;i++)
2782 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2783 const std::vector<TypeOfField>& typesFI=typesF[i];
2784 const std::vector<std::string>& pflsI=pfls[i];
2785 const std::vector<std::string>& locsI=locs[i];
2786 PyObject *elt=PyTuple_New(2);
2787 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2788 int sz2=ret[i].size();
2789 PyObject *elt2=PyList_New(sz2);
2790 for(int j=0;j<sz2;j++)
2792 PyObject *elt3=PyTuple_New(4);
2793 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2794 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2795 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2796 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2797 PyList_SetItem(elt2,j,elt3);
2799 PyTuple_SetItem(elt,1,elt2);
2800 PyList_SetItem(ret2,i,elt);
2804 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2806 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2812 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2814 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2815 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2818 PyObject *ret=PyTuple_New(2);
2819 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2820 std::size_t sz=elt1Cpp.size();
2821 PyObject *elt=PyList_New(sz);
2822 for(std::size_t i=0;i<sz;i++)
2824 PyObject *elt1=PyTuple_New(2);
2825 PyObject *elt2=PyTuple_New(2);
2826 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2827 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2828 PyObject *elt3=PyTuple_New(2);
2829 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2830 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2831 PyTuple_SetItem(elt1,0,elt2);
2832 PyTuple_SetItem(elt1,1,elt3);
2833 PyList_SetItem(elt,i,elt1);
2835 PyTuple_SetItem(ret,1,elt);
2841 class MEDFileFieldsIterator
2846 PyObject *next() throw(INTERP_KERNEL::Exception)
2848 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2850 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2853 PyErr_SetString(PyExc_StopIteration,"No more data.");
2860 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2863 static MEDFileIntFieldMultiTS *New();
2864 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2865 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2866 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2868 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2869 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2870 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2871 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2872 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2873 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2874 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2875 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2876 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2879 MEDFileIntFieldMultiTS()
2881 return MEDFileIntFieldMultiTS::New();
2884 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2886 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2889 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2891 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2894 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2896 return MEDFileIntFieldMultiTS::New(db);
2899 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2901 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2902 std::size_t sz(tmp.size());
2903 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2904 for(std::size_t i=0;i<sz;i++)
2906 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2907 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2909 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2912 std::string __str__() const throw(INTERP_KERNEL::Exception)
2914 return self->simpleRepr();
2917 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2919 DataArrayInt *ret1=0;
2920 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2921 PyObject *ret=PyTuple_New(2);
2922 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2923 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2927 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2929 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2937 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2940 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2941 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2942 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2943 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2944 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
2945 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2946 void loadArrays() throw(INTERP_KERNEL::Exception);
2947 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2948 void unloadArrays() throw(INTERP_KERNEL::Exception);
2949 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2950 int getNumberOfFields() const;
2951 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2952 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2954 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2955 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2956 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2957 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2958 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2959 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2960 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2961 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2962 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2967 return MEDFileFields::New();
2970 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2972 return MEDFileFields::New(fileName,loadAll);
2975 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2977 return MEDFileFields::New(db);
2980 std::string __str__() const throw(INTERP_KERNEL::Exception)
2982 return self->simpleRepr();
2985 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2987 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2988 std::size_t sz(tmp.size());
2989 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2990 for(std::size_t i=0;i<sz;i++)
2992 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2993 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2995 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2998 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3001 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3002 PyObject *ret=PyTuple_New(2);
3003 PyObject *ret_0=PyList_New(ret0.size());
3005 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3007 PyObject *elt=PyTuple_New(2);
3008 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3009 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3010 PyList_SetItem(ret_0,rk,elt);
3012 PyTuple_SetItem(ret,0,ret_0);
3013 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3014 PyTuple_SetItem(ret,1,ret_1);
3018 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3020 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3021 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3024 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3026 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3027 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3030 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3032 if(obj && PyList_Check(obj))
3034 int sz=PyList_Size(obj);
3035 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3036 int *pt=da->getPointer();
3037 for(int i=0;i<sz;i++,pt++)
3039 PyObject *elt1=PyList_GetItem(obj,i);
3040 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3042 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3045 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3048 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3050 self->setFieldAtPos(obj,field);
3054 int __len__() const throw(INTERP_KERNEL::Exception)
3056 return self->getNumberOfFields();
3059 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3061 return self->iterator();
3064 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3066 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3067 return self->changeMeshNames(modifTab);
3070 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3072 if(elt0 && PyInt_Check(elt0))
3074 return PyInt_AS_LONG(elt0);
3076 else if(elt0 && PyString_Check(elt0))
3077 return self->getPosFromFieldName(PyString_AsString(elt0));
3079 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3082 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3084 if(PyList_Check(elts))
3086 int sz=PyList_Size(elts);
3087 std::vector<int> ret(sz);
3088 for(int i=0;i<sz;i++)
3090 PyObject *elt=PyList_GetItem(elts,i);
3091 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3097 std::vector<int> ret(1);
3098 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3103 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3105 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3106 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3107 self->pushFields(tmp);
3110 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3112 if(elts && PySlice_Check(elts))
3114 Py_ssize_t strt=2,stp=2,step=2;
3115 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3116 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3117 self->destroyFieldsAtPos2(strt,stp,step);
3121 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3122 if(!idsToRemove.empty())
3123 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3127 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3129 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3130 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3131 return self->extractPart(extractDefCpp,mm);
3136 class MEDFileParameter1TS : public RefCountObject
3139 void setIteration(int it);
3140 int getIteration() const;
3141 void setOrder(int order);
3142 int getOrder() const;
3143 void setTimeValue(double time);
3144 void setTime(int dt, int it, double time);
3145 double getTime(int& dt, int& it);
3146 double getTimeValue() const;
3149 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3152 void setValue(double val) throw(INTERP_KERNEL::Exception);
3153 double getValue() const throw(INTERP_KERNEL::Exception);
3154 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3157 std::string __str__() const throw(INTERP_KERNEL::Exception)
3159 return self->simpleRepr();
3164 class MEDFileParameterTinyInfo : public MEDFileWritable
3167 void setDescription(const std::string& name);
3168 std::string getDescription() const;
3169 void setTimeUnit(const std::string& unit);
3170 std::string getTimeUnit() const;
3173 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3176 static MEDFileParameterDouble1TS *New();
3177 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3178 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3179 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3180 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3181 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3182 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3183 std::string getName() const throw(INTERP_KERNEL::Exception);
3184 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3187 MEDFileParameterDouble1TS()
3189 return MEDFileParameterDouble1TS::New();
3192 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3194 return MEDFileParameterDouble1TS::New(fileName);
3197 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3199 return MEDFileParameterDouble1TS::New(fileName,paramName);
3202 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3204 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3207 std::string __str__() const throw(INTERP_KERNEL::Exception)
3209 return self->simpleRepr();
3212 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3215 bool ret0=self->isEqual(other,eps,what);
3216 PyObject *res=PyList_New(2);
3217 PyObject *ret0Py=ret0?Py_True:Py_False;
3219 PyList_SetItem(res,0,ret0Py);
3220 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3226 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3229 static MEDFileParameterMultiTS *New();
3230 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3231 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3232 std::string getName() const;
3233 void setName(const std::string& name);
3234 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3235 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3236 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3237 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3238 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3239 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3240 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3241 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3244 MEDFileParameterMultiTS()
3246 return MEDFileParameterMultiTS::New();
3249 MEDFileParameterMultiTS(const std::string& fileName)
3251 return MEDFileParameterMultiTS::New(fileName);
3254 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3256 return MEDFileParameterMultiTS::New(fileName,paramName);
3259 std::string __str__() const throw(INTERP_KERNEL::Exception)
3261 return self->simpleRepr();
3264 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3267 bool ret0=self->isEqual(other,eps,what);
3268 PyObject *res=PyList_New(2);
3269 PyObject *ret0Py=ret0?Py_True:Py_False;
3271 PyList_SetItem(res,0,ret0Py);
3272 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3276 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3280 std::vector<int> pos2;
3281 DataArrayInt *pos3=0;
3282 DataArrayIntTuple *pos4=0;
3283 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3288 self->eraseTimeStepIds(&pos1,&pos1+1);
3295 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3300 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3304 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3308 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3310 if(elt0 && PyInt_Check(elt0))
3312 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3315 else if(elt0 && PyTuple_Check(elt0))
3317 if(PyTuple_Size(elt0)==2)
3319 PyObject *o0=PyTuple_GetItem(elt0,0);
3320 PyObject *o1=PyTuple_GetItem(elt0,1);
3321 if(PyInt_Check(o0) && PyInt_Check(o1))
3323 int iter=PyInt_AS_LONG(o0);
3324 int order=PyInt_AS_LONG(o1);
3325 return self->getPosOfTimeStep(iter,order);
3328 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 !");
3331 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 !");
3333 else if(elt0 && PyFloat_Check(elt0))
3335 double val=PyFloat_AS_DOUBLE(elt0);
3336 return self->getPosGivenTime(val);
3339 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3342 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3344 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3350 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3352 if(PyList_Check(elts))
3354 int sz=PyList_Size(elts);
3355 std::vector<int> ret(sz);
3356 for(int i=0;i<sz;i++)
3358 PyObject *elt=PyList_GetItem(elts,i);
3359 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3365 std::vector<int> ret(1);
3366 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3371 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3373 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3374 if(!idsToRemove.empty())
3375 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3378 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3380 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3386 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3388 std::vector< std::pair<int,int> > res=self->getIterations();
3389 PyObject *ret=PyList_New(res.size());
3391 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3393 PyObject *elt=PyTuple_New(2);
3394 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3395 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3396 PyList_SetItem(ret,rk,elt);
3401 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3403 std::vector<double> res2;
3404 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3405 PyObject *ret=PyList_New(res.size());
3407 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3409 PyObject *elt=PyTuple_New(3);
3410 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3411 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3412 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3413 PyList_SetItem(ret,rk,elt);
3420 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3423 static MEDFileParameters *New();
3424 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3425 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3426 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3427 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3428 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3429 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3430 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3431 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3432 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3433 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3434 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3439 return MEDFileParameters::New();
3442 MEDFileParameters(const std::string& fileName)
3444 return MEDFileParameters::New(fileName);
3447 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3449 return MEDFileParameters::New(db);
3452 std::string __str__() const throw(INTERP_KERNEL::Exception)
3454 return self->simpleRepr();
3457 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3459 if(PyInt_Check(obj))
3461 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3466 else if(PyString_Check(obj))
3468 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3474 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3477 int __len__() const throw(INTERP_KERNEL::Exception)
3479 return self->getNumberOfParams();
3482 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3484 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3490 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3492 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3498 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3501 bool ret0=self->isEqual(other,eps,what);
3502 PyObject *res=PyList_New(2);
3503 PyObject *ret0Py=ret0?Py_True:Py_False;
3505 PyList_SetItem(res,0,ret0Py);
3506 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3512 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3515 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3516 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3517 static MEDFileData *New();
3518 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3519 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3520 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3521 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3522 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3523 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3524 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3526 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3527 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3531 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3533 return MEDFileData::New(fileName);
3536 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3538 return MEDFileData::New(db);
3543 return MEDFileData::New();
3546 std::string __str__() const throw(INTERP_KERNEL::Exception)
3548 return self->simpleRepr();
3551 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3553 MEDFileMeshes *ret=self->getMeshes();
3559 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3561 MEDFileParameters *ret=self->getParams();
3567 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3569 MEDFileFields *ret=self->getFields();
3575 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3577 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3578 return self->changeMeshNames(modifTab);
3581 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3583 std::vector<const MEDFileData *> mfdsCpp;
3584 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3585 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3590 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3592 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3595 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
3597 PyObject *ret(PyList_New(0));
3601 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
3607 class SauvReader : public RefCountObject
3610 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3611 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3614 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3616 return SauvReader::New(fileName);
3621 class SauvWriter : public RefCountObject
3624 static SauvWriter * New();
3625 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3626 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3627 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3628 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3631 SauvWriter() throw(INTERP_KERNEL::Exception)
3633 return SauvWriter::New();
3640 class MEDFileMeshStruct;
3642 class MEDFileField1TSStructItem
3645 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3648 class MEDFileMeshStruct : public RefCountObject
3651 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3653 ~MEDFileMeshStruct();
3656 class MEDMeshMultiLev : public RefCountObject
3659 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3660 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3661 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3667 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3669 DataArrayInt *famIds(0);
3670 bool isWithoutCopy(false);
3671 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3672 PyObject *ret=PyTuple_New(2);
3673 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3675 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3676 PyTuple_SetItem(ret,1,ret1Py);
3680 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3682 DataArrayInt *numIds(0);
3683 bool isWithoutCopy(false);
3684 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3685 PyObject *ret=PyTuple_New(2);
3686 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3688 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3689 PyTuple_SetItem(ret,1,ret1Py);
3693 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3695 DataArrayInt *famIds(0);
3696 bool isWithoutCopy(false);
3697 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3698 PyObject *ret=PyTuple_New(2);
3699 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3701 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3702 PyTuple_SetItem(ret,1,ret1Py);
3706 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3708 DataArrayInt *numIds(0);
3709 bool isWithoutCopy(false);
3710 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3711 PyObject *ret=PyTuple_New(2);
3712 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3714 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3715 PyTuple_SetItem(ret,1,ret1Py);
3719 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3721 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3722 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3723 PyObject *res(PyList_New(result.size()));
3724 for(int i=0;iL!=result.end(); i++, iL++)
3725 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3731 class MEDUMeshMultiLev : public MEDMeshMultiLev
3734 ~MEDUMeshMultiLev();
3738 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3740 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3741 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3742 PyObject *ret0Py=ncc?Py_True:Py_False;
3744 PyObject *ret=PyTuple_New(7);
3745 PyTuple_SetItem(ret,0,ret0Py);
3746 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3747 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3748 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3749 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3750 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3751 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3757 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3760 ~MEDStructuredMeshMultiLev();
3763 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3766 ~MEDCMeshMultiLev();
3770 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3773 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3774 std::size_t sz(objs.size());
3775 PyObject *ret(PyTuple_New(2));
3776 PyObject *ret0=PyList_New(sz);
3777 for(std::size_t i=0;i<sz;i++)
3778 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3779 PyTuple_SetItem(ret,0,ret0);
3780 PyObject *ret1Py(isInternal?Py_True:Py_False);
3782 PyTuple_SetItem(ret,1,ret1Py);
3788 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3791 ~MEDCurveLinearMeshMultiLev();
3795 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3797 DataArrayDouble *ret0(0);
3798 std::vector<int> ret1;
3800 self->buildVTUArrays(ret0,ret1,ret2);
3801 std::size_t sz(ret1.size());
3802 PyObject *ret=PyTuple_New(3);
3803 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3804 PyObject *ret1Py=PyList_New(sz);
3805 for(std::size_t i=0;i<sz;i++)
3806 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3807 PyTuple_SetItem(ret,1,ret1Py);
3808 PyObject *ret2Py(ret2?Py_True:Py_False);
3810 PyTuple_SetItem(ret,2,ret2Py);
3816 class MEDFileFastCellSupportComparator : public RefCountObject
3819 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3820 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3821 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3822 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3824 ~MEDFileFastCellSupportComparator();
3828 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3830 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3831 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3832 PyObject *res(PyList_New(result.size()));
3833 for(int i=0;iL!=result.end(); i++, iL++)
3834 PyList_SetItem(res,i,PyInt_FromLong(*iL));