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::MEDFileAnyTypeFieldMultiTS::New;
157 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
158 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
159 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
160 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
161 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
162 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
163 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
164 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
165 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
166 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
167 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
168 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
169 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
170 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
171 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
172 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
173 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
174 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
175 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
176 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
177 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
178 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
179 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
180 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
181 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
182 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
184 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
185 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
186 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
187 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
188 %newobject MEDCoupling::MEDFileField1TS::New;
189 %newobject MEDCoupling::MEDFileField1TS::field;
190 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
191 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
192 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
193 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
194 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
195 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
197 %newobject MEDCoupling::MEDFileIntField1TS::New;
198 %newobject MEDCoupling::MEDFileIntField1TS::field;
199 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
200 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
201 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
202 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
203 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
204 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
206 %newobject MEDCoupling::MEDFileData::New;
207 %newobject MEDCoupling::MEDFileData::deepCopy;
208 %newobject MEDCoupling::MEDFileData::getMeshes;
209 %newobject MEDCoupling::MEDFileData::getFields;
210 %newobject MEDCoupling::MEDFileData::getParams;
211 %newobject MEDCoupling::MEDFileData::Aggregate;
213 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
214 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
215 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
216 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
217 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
218 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
219 %newobject MEDCoupling::MEDFileParameters::New;
220 %newobject MEDCoupling::MEDFileParameters::deepCopy;
221 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
222 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
223 %newobject MEDCoupling::MEDFileParameters::__getitem__;
225 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
226 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
227 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
228 %newobject MEDCoupling::MEDFileJointOneStep::New;
229 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
230 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
231 %newobject MEDCoupling::MEDFileJoint::New;
232 %newobject MEDCoupling::MEDFileJoint::deepCopy;
233 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
234 %newobject MEDCoupling::MEDFileJoints::New;
235 %newobject MEDCoupling::MEDFileJoints::deepCopy;
236 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
237 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
238 %newobject MEDCoupling::MEDFileJoints::__getitem__;
239 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
240 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
241 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
242 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
243 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
244 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
245 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
246 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
247 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
249 %newobject MEDCoupling::SauvWriter::New;
250 %newobject MEDCoupling::SauvReader::New;
251 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
253 %newobject MEDCoupling::MEDFileMeshStruct::New;
254 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
255 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
256 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
257 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
258 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
260 %feature("unref") MEDFileMesh "$this->decrRef();"
261 %feature("unref") MEDFileUMesh "$this->decrRef();"
262 %feature("unref") MEDFileCMesh "$this->decrRef();"
263 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
264 %feature("unref") MEDFileMeshes "$this->decrRef();"
265 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
266 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
267 %feature("unref") MEDFileField1TS "$this->decrRef();"
268 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
269 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
270 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
271 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
272 %feature("unref") MEDFileFields "$this->decrRef();"
273 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
274 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
275 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
276 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
277 %feature("unref") MEDFileParameters "$this->decrRef();"
278 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
279 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
280 %feature("unref") MEDFileJoint "$this->decrRef();"
281 %feature("unref") MEDFileJoints "$this->decrRef();"
282 %feature("unref") MEDFileEquivalences "$this->decrRef();"
283 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
284 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
285 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
286 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
287 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
288 %feature("unref") MEDFileData "$this->decrRef();"
289 %feature("unref") SauvReader "$this->decrRef();"
290 %feature("unref") SauvWriter "$this->decrRef();"
291 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
292 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
293 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
294 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
295 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
296 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
298 namespace MEDCoupling
301 std::string MEDFileVersionStr();
302 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
303 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
304 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
305 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
306 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
307 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
308 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
309 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
310 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
311 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
312 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
313 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
314 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
315 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
316 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
317 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
318 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
319 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
320 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
321 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
322 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
323 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
324 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);
325 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);
326 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);
327 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);
328 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);
329 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
330 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
331 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
332 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
333 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
334 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
337 %rename (MEDFileVersion) MEDFileVersionSwig;
338 %rename (GetFieldIterations) GetFieldIterationsSwig;
339 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
340 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
341 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
342 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
343 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
344 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
345 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
346 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
347 %rename (WriteUMeshes) WriteUMeshesSwig;
348 %rename (GetTypesOfField) GetTypesOfFieldSwig;
349 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
350 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
354 PyObject *MEDFileVersionSwig()
356 int major,minor,release;
357 MEDCoupling::MEDFileVersion(major,minor,release);
358 PyObject *ret(PyTuple_New(3));
359 PyTuple_SetItem(ret,0,SWIG_From_int(major));
360 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
361 PyTuple_SetItem(ret,2,SWIG_From_int(release));
365 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
367 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
368 PyObject *ret=PyList_New(res.size());
370 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
372 PyObject *elt=PyTuple_New(2);
373 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
374 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
375 PyList_SetItem(ret,rk,elt);
380 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
382 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
383 PyObject *ret=PyList_New(res.size());
385 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
387 PyObject *elt=PyTuple_New(3);
388 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
389 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
390 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
391 PyList_SetItem(ret,rk,elt);
396 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
398 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
399 PyObject *ret=PyList_New(res.size());
401 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
403 PyObject *elt=PyTuple_New(2);
404 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
405 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
406 PyList_SetItem(ret,rk,elt);
411 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
413 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
414 PyObject *ret=PyList_New(res.size());
416 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
418 PyObject *elt=PyTuple_New(2);
419 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
420 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
421 PyList_SetItem(ret,rk,elt);
426 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
428 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
429 PyObject *ret=PyList_New(res.size());
431 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
433 PyObject *elt=PyTuple_New(2);
434 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
435 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
436 PyList_SetItem(ret,rk,elt);
441 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
443 int meshDim,spaceDim,numberOfNodes;
444 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
445 PyObject *ret=PyTuple_New(4);
446 PyObject *elt0=PyList_New(res.size());
448 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
450 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
452 PyObject *elt1=PyList_New(obj2.size());
453 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
455 PyObject *elt2=PyTuple_New(2);
456 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
457 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
458 PyList_SetItem(elt1,j,elt2);
460 PyList_SetItem(elt0,i,elt1);
462 PyTuple_SetItem(ret,0,elt0);
463 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
464 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
465 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
469 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
470 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
472 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
473 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
474 return convertFieldDoubleVecToPy(res);
477 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
479 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
480 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
481 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
484 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
486 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
487 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
488 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
491 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
493 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
494 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
495 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
498 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
500 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
502 PyObject *ret=PyList_New(size);
503 for(int i=0;i<size;i++)
504 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
508 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
510 std::vector<std::string> grps;
511 converPyListToVecString(li,grps);
512 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
515 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
517 std::vector<std::string> fams;
518 converPyListToVecString(li,fams);
519 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
523 namespace MEDCoupling
525 class MEDFileWritable
528 void copyOptionsFrom(const MEDFileWritable& other) const;
529 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
530 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
531 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
532 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
535 class MEDFileMeshReadSelector
538 MEDFileMeshReadSelector();
539 MEDFileMeshReadSelector(unsigned int code);
540 unsigned int getCode() const;
541 void setCode(unsigned int newCode);
542 bool isCellFamilyFieldReading() const;
543 bool isNodeFamilyFieldReading() const;
544 bool isCellNameFieldReading() const;
545 bool isNodeNameFieldReading() const;
546 bool isCellNumFieldReading() const;
547 bool isNodeNumFieldReading() const;
548 void setCellFamilyFieldReading(bool b);
549 void setNodeFamilyFieldReading(bool b);
550 void setCellNameFieldReading(bool b);
551 void setNodeNameFieldReading(bool b);
552 void setCellNumFieldReading(bool b);
553 void setNodeNumFieldReading(bool b);
556 std::string __str__() const throw(INTERP_KERNEL::Exception)
558 std::ostringstream oss;
563 std::string __repr__() const throw(INTERP_KERNEL::Exception)
565 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
571 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
574 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
575 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
576 throw(INTERP_KERNEL::Exception);
577 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
578 INTERP_KERNEL::NormalizedCellType loc_geo_type,
579 INTERP_KERNEL::NormalizedCellType rem_geo_type)
580 throw(INTERP_KERNEL::Exception);
581 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
582 MEDFileJointCorrespondence *deepCopy() const;
583 MEDFileJointCorrespondence *shallowCpy() const;
584 void setIsNodal(bool isNodal);
585 bool getIsNodal() const;
586 bool isEqual(const MEDFileJointCorrespondence *other) const;
587 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
588 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
589 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
590 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
591 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
592 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
593 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);
594 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
597 MEDFileJointCorrespondence()
599 return MEDFileJointCorrespondence::New();
601 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
603 return MEDFileJointCorrespondence::New(correspondence);
605 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
606 INTERP_KERNEL::NormalizedCellType loc_geo_type,
607 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
609 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
612 std::string __str__() const throw(INTERP_KERNEL::Exception)
614 return self->simpleRepr();
619 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
622 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
623 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
624 MEDFileJointOneStep *deepCopy() const;
625 MEDFileJointOneStep *shallowCpy() const;
626 bool isEqual(const MEDFileJointOneStep *other) const;
627 void setOrder(int order);
628 int getOrder() const;
629 void setIteration(int it);
630 int getIteration() const;
631 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
632 int getNumberOfCorrespondences() const;
633 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
634 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
635 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
638 MEDFileJointOneStep()
640 return MEDFileJointOneStep::New();
643 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
645 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
648 std::string __str__() const throw(INTERP_KERNEL::Exception)
650 return self->simpleRepr();
655 class MEDFileJoint : public RefCountObject, public MEDFileWritable
658 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
659 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
660 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
661 MEDFileJoint *deepCopy() const;
662 MEDFileJoint *shallowCpy() const;
663 bool isEqual(const MEDFileJoint *other) const;
664 void setLocalMeshName(const std::string& name);
665 std::string getLocalMeshName() const;
666 void setRemoteMeshName(const std::string& name);
667 std::string getRemoteMeshName() const;
668 void setDescription(const std::string& name);
669 std::string getDescription() const;
670 void setJointName(const std::string& name);
671 std::string getJointName() const;
672 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
673 void setDomainNumber(const int& number);
674 int getDomainNumber() const;
675 void pushStep(MEDFileJointOneStep* step);
676 int getNumberOfSteps() const;
677 MEDFileJointOneStep *getStepAtPos(int i) const;
678 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
679 std::string simpleRepr() const;
684 return MEDFileJoint::New();
687 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
689 return MEDFileJoint::New(fileName,mName,num);
692 std::string __str__() const throw(INTERP_KERNEL::Exception)
694 return self->simpleRepr();
699 class MEDFileJoints : public RefCountObject, public MEDFileWritable
702 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
703 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
704 MEDFileJoints *deepCopy() const;
705 std::string simpleRepr() const;
706 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
707 std::string getMeshName() const;
708 int getNumberOfJoints() const;
709 std::vector<std::string> getJointsNames() const;
710 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
711 void resize(int newSize) throw(INTERP_KERNEL::Exception);
712 void pushJoint(MEDFileJoint *joint);
713 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
714 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
719 return MEDFileJoints::New();
722 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
724 return MEDFileJoints::New(fileName,meshName);
727 std::string __str__() const throw(INTERP_KERNEL::Exception)
729 return self->simpleRepr();
732 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
736 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
741 else if(PyString_Check(obj))
743 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
749 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
752 int __len__() const throw(INTERP_KERNEL::Exception)
754 return self->getNumberOfJoints();
757 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
759 MEDFileJoint *ret=self->getJointAtPos(i);
765 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
767 MEDFileJoint *ret=self->getJointWithName(paramName);
775 class MEDFileEquivalenceBase : public RefCountObject
778 MEDFileEquivalenceBase();
781 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
784 MEDFileEquivalenceData();
786 void setArray(DataArrayInt *data);
789 DataArrayInt *getArray()
791 DataArrayInt *ret(self->getArray());
792 if(ret) ret->incrRef();
798 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
801 MEDFileEquivalenceNode();
804 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
807 MEDFileEquivalenceCell();
810 std::size_t size() const;
811 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
812 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
815 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
817 DataArrayInt *ret(self->getArray(type));
818 if(ret) ret->incrRef();
822 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
824 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
825 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
826 PyObject *res=PyList_New(result.size());
827 for(int i=0;iL!=result.end(); i++, iL++)
828 PyList_SetItem(res,i,PyInt_FromLong(*iL));
834 class MEDFileEquivalencePair : public RefCountObject
837 MEDFileEquivalencePair();
839 std::string getName() const;
840 void setName(const std::string& name);
841 std::string getDescription() const;
842 void setDescription(const std::string& descr);
843 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
846 MEDFileEquivalenceCell *initCell()
848 MEDFileEquivalenceCell *ret(self->initCell());
849 if(ret) ret->incrRef();
853 MEDFileEquivalenceNode *initNode()
855 MEDFileEquivalenceNode *ret(self->initNode());
856 if(ret) ret->incrRef();
860 MEDFileEquivalenceCell *getCell()
862 MEDFileEquivalenceCell *ret(self->getCell());
863 if(ret) ret->incrRef();
867 MEDFileEquivalenceNode *getNode()
869 MEDFileEquivalenceNode *ret(self->getNode());
870 if(ret) ret->incrRef();
876 class MEDFileEquivalences : public RefCountObject
879 MEDFileEquivalences();
882 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
883 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
884 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
888 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
890 MEDFileEquivalencePair *ret(self->getEquivalence(i));
891 if(ret) ret->incrRef();
894 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
896 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
897 if(ret) ret->incrRef();
901 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
903 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
904 if(ret) ret->incrRef();
910 class MEDFileMesh : public RefCountObject, public MEDFileWritable
913 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
914 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
915 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
916 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
917 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
918 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
919 void setName(const std::string& name);
920 std::string getName();
921 std::string getUnivName() const;
922 bool getUnivNameWrStatus() const;
923 void setUnivNameWrStatus(bool newStatus);
924 void setDescription(const std::string& name);
925 std::string getDescription() const;
926 void setOrder(int order);
927 int getOrder() const;
928 void setIteration(int it);
930 void setTimeValue(double time);
931 void setTime(int dt, int it, double time);
932 double getTimeValue() const;
933 void setTimeUnit(const std::string& unit);
934 std::string getTimeUnit() const;
935 void setAxisType(MEDCouplingAxisType at);
936 MEDCouplingAxisType getAxisType() const;
937 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
938 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
939 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
940 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
941 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
942 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
943 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
944 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
945 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
946 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
947 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
948 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
949 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
950 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
951 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
953 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
954 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
955 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
956 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
957 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
958 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
959 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
960 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
961 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
962 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
963 void clearGrpMap() throw(INTERP_KERNEL::Exception);
964 void clearFamMap() throw(INTERP_KERNEL::Exception);
965 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
966 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
967 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
968 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
969 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
970 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
971 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
972 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
973 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
974 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
975 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
976 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
977 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
978 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
979 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
980 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
981 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
982 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
983 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
984 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
985 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
986 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
987 static std::string GetMagicFamilyStr();
988 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
989 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
990 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
991 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
992 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
993 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
994 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
995 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
996 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
997 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
998 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
999 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1000 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1001 void setFamilyInfo(const std::map<std::string,int>& info);
1002 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1003 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1004 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1005 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1006 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1007 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1008 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1009 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1010 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1011 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1012 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1013 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1014 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1015 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1016 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1017 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1018 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1019 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1020 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1021 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1022 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1024 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1025 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1026 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1027 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1028 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1029 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1030 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1031 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1032 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1033 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1034 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1035 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1036 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1037 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1038 int getNumberOfJoints();
1039 MEDFileJoints *getJoints();
1040 void setJoints( MEDFileJoints* joints );
1041 void initializeEquivalences();
1042 void killEquivalences();
1045 std::string __str__() const throw(INTERP_KERNEL::Exception)
1047 return self->simpleRepr();
1050 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1052 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1055 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1058 double tmp0=self->getTime(tmp1,tmp2);
1059 PyObject *res = PyList_New(3);
1060 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1061 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1062 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1066 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1069 bool ret0=self->isEqual(other,eps,what);
1070 PyObject *res=PyList_New(2);
1071 PyObject *ret0Py=ret0?Py_True:Py_False;
1073 PyList_SetItem(res,0,ret0Py);
1074 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1078 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1080 std::vector<const DataArrayInt *> grps;
1081 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1082 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1085 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1088 bool ret0=self->areFamsEqual(other,what);
1089 PyObject *res=PyList_New(2);
1090 PyObject *ret0Py=ret0?Py_True:Py_False;
1092 PyList_SetItem(res,0,ret0Py);
1093 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1097 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1100 bool ret0=self->areGrpsEqual(other,what);
1101 PyObject *res=PyList_New(2);
1102 PyObject *ret0Py=ret0?Py_True:Py_False;
1104 PyList_SetItem(res,0,ret0Py);
1105 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1109 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1111 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1112 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1113 PyObject *res=PyList_New(result.size());
1114 for(int i=0;iL!=result.end(); i++, iL++)
1115 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1119 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1121 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1122 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1123 PyObject *res=PyList_New(result.size());
1124 for(int i=0;iL!=result.end(); i++, iL++)
1125 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1129 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1131 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1134 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1137 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1139 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1142 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1145 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1147 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1150 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1153 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1155 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1158 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1161 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1163 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1166 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1169 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1172 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1173 PyObject *ret=PyTuple_New(2);
1174 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1175 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1179 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1181 DataArrayInt *ret3=0;
1182 std::vector<int> ret1,ret2;
1183 bool ret0=self->unPolyze(ret1,ret2,ret3);
1184 PyObject *ret=PyTuple_New(4);
1185 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1187 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1188 for(int j=0;j<(int)ret1.size()/3;j++)
1190 PyObject *retLev2=PyList_New(3);
1191 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1192 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1193 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1194 PyList_SetItem(retLev1_0,j,retLev2);
1196 PyTuple_SetItem(ret,1,retLev1_0);
1198 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1199 for(int j=0;j<(int)ret2.size()/3;j++)
1201 PyObject *retLev2=PyList_New(3);
1202 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1203 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1204 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1205 PyList_SetItem(retLev1_1,j,retLev2);
1207 PyTuple_SetItem(ret,2,retLev1_1);
1209 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1213 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1215 MEDFileEquivalences *ret(self->getEquivalences());
1216 if(ret) ret->incrRef();
1222 class MEDFileUMesh : public MEDFileMesh
1225 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1226 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1227 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1228 static MEDFileUMesh *New();
1229 static const char *GetSpeStr4ExtMesh();
1231 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1232 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1233 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1234 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1235 void clearNodeAndCellNumbers();
1237 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1238 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1239 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1240 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1241 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1242 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1243 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1244 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1245 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1246 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1248 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1249 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1250 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1251 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1252 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1253 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1254 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1255 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1256 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1257 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1258 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1259 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1260 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1261 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1262 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1265 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1267 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1270 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1272 return MEDFileUMesh::New(fileName,mrs);
1275 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1277 return MEDFileUMesh::New(mem);
1282 return MEDFileUMesh::New();
1286 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1288 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1291 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)
1293 std::vector<int> typesCpp1;
1294 convertPyToNewIntArr3(types,typesCpp1);
1295 std::size_t sz(typesCpp1.size());
1296 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1297 for(std::size_t ii=0;ii<sz;ii++)
1298 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1299 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1302 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1303 {// put an empty dict in input to say to __new__ to call __init__...
1304 PyObject *ret(PyTuple_New(1));
1305 PyObject *ret0(PyDict_New());
1306 PyTuple_SetItem(ret,0,ret0);
1310 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1312 std::vector<double> a0;
1313 std::vector<int> a1;
1314 std::vector<std::string> a2;
1315 std::vector< MCAuto<DataArrayInt> > a3;
1316 MCAuto<DataArrayDouble> a4;
1317 self->serialize(a0,a1,a2,a3,a4);
1318 PyObject *ret(PyTuple_New(5));
1319 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1320 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1322 PyObject *ret2(PyList_New(sz));
1323 for(int i=0;i<sz;i++)
1324 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1325 PyTuple_SetItem(ret,2,ret2);
1327 PyObject *ret3(PyList_New(sz));
1328 for(int i=0;i<sz;i++)
1330 DataArrayInt *elt(a3[i]);
1333 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1335 PyTuple_SetItem(ret,3,ret3);
1336 DataArrayDouble *ret4(a4);
1339 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1343 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1345 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1346 if(!PyTuple_Check(inp))
1347 throw INTERP_KERNEL::Exception(MSG);
1348 int sz(PyTuple_Size(inp));
1350 throw INTERP_KERNEL::Exception(MSG);
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;
1357 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1359 fillArrayWithPyListDbl3(a0py,tmp,a0);
1360 convertPyToNewIntArr3(a1py,a1);
1361 fillStringVector(a2py,a2);
1363 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1365 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1366 if(!SWIG_IsOK(status))
1367 throw INTERP_KERNEL::Exception(MSG);
1368 a4=reinterpret_cast<DataArrayDouble *>(argp);
1369 if((DataArrayDouble *)a4)
1372 std::vector< DataArrayInt * > a3Tmp;
1373 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1374 std::size_t sz(a3Tmp.size());
1376 for(std::size_t i=0;i<sz;i++)
1380 a3Tmp[i]->incrRef();
1382 self->unserialize(a0,a1,a2,a3,a4);
1386 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1389 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1390 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1393 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1396 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1399 self->setMeshAtLevel(meshDimRelToMax,m1);
1402 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1405 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1407 self->removeMeshAtLevel(meshDimRelToMax);
1410 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1412 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1414 DataArrayDouble *a,*a2;
1415 DataArrayDoubleTuple *aa,*aa2;
1416 std::vector<double> bb,bb2;
1418 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1419 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1420 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1424 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1426 std::vector<const MEDFileUMesh *> meshesCpp;
1427 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1428 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1432 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1434 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1435 return convertVecPairIntToPy(ret);
1438 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1440 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1441 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1442 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1445 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1447 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1448 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1449 return self->extractPart(extractDefCpp);
1452 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1454 std::vector<const MEDCouplingUMesh *> ms;
1455 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1456 self->setMeshes(ms,renum);
1459 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1461 std::vector<const MEDCouplingUMesh *> ms;
1462 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1463 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1466 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1468 std::vector<const MEDCouplingUMesh *> ms;
1469 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1470 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1473 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1475 DataArrayDouble *ret=self->getCoords();
1481 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1483 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1486 return const_cast<PartDefinition *>(ret);
1489 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1491 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1492 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1493 PyObject *ret=PyTuple_New(3);
1494 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1495 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1496 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1500 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1502 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1508 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1510 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1511 std::size_t sz(tmp.size());
1512 PyObject *ret=PyList_New(sz);
1513 for(std::size_t i=0;i<sz;i++)
1517 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1524 class MEDFileStructuredMesh : public MEDFileMesh
1529 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1531 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1539 class MEDFileCMesh : public MEDFileStructuredMesh
1542 static MEDFileCMesh *New();
1543 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1544 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1545 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1546 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1551 return MEDFileCMesh::New();
1554 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1556 return MEDFileCMesh::New(fileName,mrs);
1559 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1561 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1564 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1566 const MEDCouplingCMesh *tmp=self->getMesh();
1569 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1574 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1577 static MEDFileCurveLinearMesh *New();
1578 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1579 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1580 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1583 MEDFileCurveLinearMesh()
1585 return MEDFileCurveLinearMesh::New();
1588 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1590 return MEDFileCurveLinearMesh::New(fileName,mrs);
1593 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1595 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1598 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1600 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1603 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1608 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1611 static MEDFileMeshMultiTS *New();
1612 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1613 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1614 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1615 std::string getName() const throw(INTERP_KERNEL::Exception);
1616 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1617 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1618 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1621 MEDFileMeshMultiTS()
1623 return MEDFileMeshMultiTS::New();
1626 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1628 return MEDFileMeshMultiTS::New(fileName);
1631 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1633 return MEDFileMeshMultiTS::New(fileName,mName);
1636 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1638 MEDFileMesh *ret=self->getOneTimeStep();
1646 class MEDFileMeshesIterator
1651 PyObject *next() throw(INTERP_KERNEL::Exception)
1653 MEDFileMesh *ret=self->nextt();
1657 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1661 PyErr_SetString(PyExc_StopIteration,"No more data.");
1668 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1671 static MEDFileMeshes *New();
1672 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1673 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1674 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1675 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1676 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1678 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1679 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1680 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1681 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1682 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1687 return MEDFileMeshes::New();
1690 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1692 return MEDFileMeshes::New(fileName);
1695 std::string __str__() const throw(INTERP_KERNEL::Exception)
1697 return self->simpleRepr();
1700 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1702 if(PyInt_Check(obj))
1704 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1709 else if(PyString_Check(obj))
1711 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1717 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1720 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1722 self->setMeshAtPos(obj,mesh);
1726 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1728 return self->iterator();
1731 int __len__() const throw(INTERP_KERNEL::Exception)
1733 return self->getNumberOfMeshes();
1736 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1738 MEDFileMesh *ret=self->getMeshAtPos(i);
1743 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1745 MEDFileMesh *ret=self->getMeshWithName(mname);
1753 class MEDFileFieldLoc : public RefCountObject
1756 std::string getName() const;
1757 int getDimension() const;
1758 int getNumberOfGaussPoints() const;
1759 int getNumberOfPointsInCells() const;
1760 const std::vector<double>& getRefCoords() const;
1761 const std::vector<double>& getGaussCoords() const;
1762 const std::vector<double>& getGaussWeights() const;
1763 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1766 std::string __str__() const throw(INTERP_KERNEL::Exception)
1768 return self->repr();
1773 class MEDFileFieldGlobsReal
1776 void resetContent();
1777 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1778 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1779 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1780 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1781 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1782 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1783 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1784 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1785 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1786 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1787 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1788 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1789 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1790 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1791 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1792 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1793 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1794 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1795 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1796 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1797 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1798 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1799 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1800 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1801 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1802 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1805 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1807 const DataArrayInt *ret=self->getProfile(pflName);
1810 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1813 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1815 const DataArrayInt *ret=self->getProfileFromId(pflId);
1818 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1821 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1823 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1826 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1829 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1831 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1834 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1837 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1839 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1840 return convertVecPairVecStToPy(ret);
1843 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1845 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1846 return convertVecPairVecStToPy(ret);
1849 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1851 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1852 self->changePflsNames(v);
1855 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1857 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1858 self->changePflsRefsNamesGen(v);
1861 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1863 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1864 self->changePflsNamesInStruct(v);
1867 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1869 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1870 self->changeLocsNames(v);
1873 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1875 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1876 self->changeLocsRefsNamesGen(v);
1879 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1881 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1882 self->changeLocsNamesInStruct(v);
1885 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1887 std::ostringstream oss;
1888 self->simpleReprGlobs(oss);
1894 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1897 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1898 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1899 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1900 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1901 void loadArrays() throw(INTERP_KERNEL::Exception);
1902 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1903 void unloadArrays() throw(INTERP_KERNEL::Exception);
1904 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1905 int getDimension() const throw(INTERP_KERNEL::Exception);
1906 int getIteration() const throw(INTERP_KERNEL::Exception);
1907 int getOrder() const throw(INTERP_KERNEL::Exception);
1908 std::string getName() throw(INTERP_KERNEL::Exception);
1909 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1910 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1911 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1912 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1913 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1914 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1915 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1916 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1917 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1918 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1919 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1920 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1921 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
1922 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1923 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1926 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1929 double tmp0=self->getTime(tmp1,tmp2);
1930 PyObject *res = PyList_New(3);
1931 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1932 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1933 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1937 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1939 std::pair<int,int> res=self->getDtIt();
1940 PyObject *elt=PyTuple_New(2);
1941 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1942 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1946 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1948 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1951 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1953 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1956 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1958 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1959 return self->changeMeshNames(modifTab);
1962 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1964 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1965 PyObject *ret2=PyList_New(ret.size());
1966 for(int i=0;i<(int)ret.size();i++)
1967 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1971 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1973 std::vector<int> ret1;
1974 int ret0=self->getNonEmptyLevels(mname,ret1);
1975 PyObject *elt=PyTuple_New(2);
1976 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1977 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1981 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1983 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1984 std::vector< std::vector<TypeOfField> > typesF;
1985 std::vector< std::vector<std::string> > pfls;
1986 std::vector< std::vector<std::string> > locs;
1987 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1989 PyObject *ret2=PyList_New(sz);
1990 for(int i=0;i<sz;i++)
1992 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1993 const std::vector<TypeOfField>& typesFI=typesF[i];
1994 const std::vector<std::string>& pflsI=pfls[i];
1995 const std::vector<std::string>& locsI=locs[i];
1996 PyObject *elt=PyTuple_New(2);
1997 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1998 int sz2=ret[i].size();
1999 PyObject *elt2=PyList_New(sz2);
2000 for(int j=0;j<sz2;j++)
2002 PyObject *elt3=PyTuple_New(4);
2003 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2004 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));
2005 PyTuple_SetItem(elt3,1,elt4);
2006 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2007 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2008 PyList_SetItem(elt2,j,elt3);
2010 PyTuple_SetItem(elt,1,elt2);
2011 PyList_SetItem(ret2,i,elt);
2016 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2018 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2019 std::size_t sz=ret.size();
2020 PyObject *retPy=PyList_New(sz);
2021 for(std::size_t i=0;i<sz;i++)
2022 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2026 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2028 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2029 std::size_t sz=ret.size();
2030 PyObject *retPy=PyList_New(sz);
2031 for(std::size_t i=0;i<sz;i++)
2032 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2036 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2038 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2039 std::size_t sz=ret.size();
2040 PyObject *retPy=PyList_New(sz);
2041 for(std::size_t i=0;i<sz;i++)
2042 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2046 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2048 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2049 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2050 return self->extractPart(extractDefCpp,mm);
2055 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2058 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2059 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2060 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2061 static MEDFileField1TS *New();
2062 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2063 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2064 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2065 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2066 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2067 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2068 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2070 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2071 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2072 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2073 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2076 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2078 return MEDFileField1TS::New(fileName,loadAll);
2081 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2083 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2086 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2088 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2093 return MEDFileField1TS::New();
2096 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2098 const DataArrayDouble *arr=0;
2100 arr=field->getArray();
2101 self->copyTinyInfoFrom(field,arr);
2104 std::string __str__() const throw(INTERP_KERNEL::Exception)
2106 return self->simpleRepr();
2109 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2111 DataArrayInt *ret1=0;
2112 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2113 PyObject *ret=PyTuple_New(2);
2114 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2115 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2119 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2121 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2122 std::vector< std::vector<TypeOfField> > typesF;
2123 std::vector< std::vector<std::string> > pfls;
2124 std::vector< std::vector<std::string> > locs;
2125 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2127 PyObject *ret2=PyList_New(sz);
2128 for(int i=0;i<sz;i++)
2130 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2131 const std::vector<TypeOfField>& typesFI=typesF[i];
2132 const std::vector<std::string>& pflsI=pfls[i];
2133 const std::vector<std::string>& locsI=locs[i];
2134 PyObject *elt=PyTuple_New(2);
2135 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2136 int sz2=ret[i].size();
2137 PyObject *elt2=PyList_New(sz2);
2138 for(int j=0;j<sz2;j++)
2140 PyObject *elt3=PyTuple_New(4);
2141 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2142 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2143 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2144 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2145 PyList_SetItem(elt2,j,elt3);
2147 PyTuple_SetItem(elt,1,elt2);
2148 PyList_SetItem(ret2,i,elt);
2153 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2155 DataArrayDouble *ret=self->getUndergroundDataArray();
2161 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2163 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2164 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2167 PyObject *ret=PyTuple_New(2);
2168 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2169 std::size_t sz=elt1Cpp.size();
2170 PyObject *elt=PyList_New(sz);
2171 for(std::size_t i=0;i<sz;i++)
2173 PyObject *elt1=PyTuple_New(2);
2174 PyObject *elt2=PyTuple_New(2);
2175 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2176 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2177 PyObject *elt3=PyTuple_New(2);
2178 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2179 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2180 PyTuple_SetItem(elt1,0,elt2);
2181 PyTuple_SetItem(elt1,1,elt3);
2182 PyList_SetItem(elt,i,elt1);
2184 PyTuple_SetItem(ret,1,elt);
2190 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2193 static MEDFileIntField1TS *New();
2194 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2195 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2196 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2197 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2199 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2200 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2201 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2202 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2203 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2204 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2205 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2206 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2209 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2211 return MEDFileIntField1TS::New();
2214 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2216 return MEDFileIntField1TS::New(fileName,loadAll);
2219 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2221 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2224 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2226 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2229 std::string __str__() const throw(INTERP_KERNEL::Exception)
2231 return self->simpleRepr();
2234 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2236 DataArrayInt *ret1=0;
2237 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2238 PyObject *ret=PyTuple_New(2);
2239 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2240 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2244 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2246 DataArrayInt *ret=self->getUndergroundDataArray();
2254 class MEDFileAnyTypeFieldMultiTSIterator
2259 PyObject *next() throw(INTERP_KERNEL::Exception)
2261 MEDFileAnyTypeField1TS *ret=self->nextt();
2263 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2266 PyErr_SetString(PyExc_StopIteration,"No more data.");
2273 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2276 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2277 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2278 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2279 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2280 std::string getName() const throw(INTERP_KERNEL::Exception);
2281 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2282 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2283 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2284 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2285 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2286 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2287 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2288 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2289 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2290 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2291 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2292 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2293 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2294 void loadArrays() throw(INTERP_KERNEL::Exception);
2295 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2296 void unloadArrays() throw(INTERP_KERNEL::Exception);
2297 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2299 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2300 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2301 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2302 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2303 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2304 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2307 int __len__() const throw(INTERP_KERNEL::Exception)
2309 return self->getNumberOfTS();
2312 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2314 if(elt0 && PyInt_Check(elt0))
2316 int pos=PyInt_AS_LONG(elt0);
2319 else if(elt0 && PyTuple_Check(elt0))
2321 if(PyTuple_Size(elt0)==2)
2323 PyObject *o0=PyTuple_GetItem(elt0,0);
2324 PyObject *o1=PyTuple_GetItem(elt0,1);
2325 if(PyInt_Check(o0) && PyInt_Check(o1))
2327 int iter=PyInt_AS_LONG(o0);
2328 int order=PyInt_AS_LONG(o1);
2329 return self->getPosOfTimeStep(iter,order);
2332 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 !");
2335 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 !");
2337 else if(elt0 && PyFloat_Check(elt0))
2339 double val=PyFloat_AS_DOUBLE(elt0);
2340 return self->getPosGivenTime(val);
2343 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2346 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2348 std::vector< std::pair<int,int> > res(self->getIterations());
2349 return convertVecPairIntToPy(res);
2352 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2354 std::vector<double> ret1;
2355 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2356 std::size_t sz=ret.size();
2357 PyObject *ret2=PyList_New(sz);
2358 for(std::size_t i=0;i<sz;i++)
2360 PyObject *elt=PyTuple_New(3);
2361 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2362 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2363 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2364 PyList_SetItem(ret2,i,elt);
2369 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2371 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2372 PyObject *ret2=PyList_New(ret.size());
2373 for(int i=0;i<(int)ret.size();i++)
2375 const std::vector<TypeOfField>& rett=ret[i];
2376 PyObject *ret3=PyList_New(rett.size());
2377 for(int j=0;j<(int)rett.size();j++)
2378 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2379 PyList_SetItem(ret2,i,ret3);
2384 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2386 std::vector<int> ret1;
2387 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2388 PyObject *elt=PyTuple_New(2);
2389 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2390 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2394 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2396 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2397 std::vector< std::vector<TypeOfField> > typesF;
2398 std::vector< std::vector<std::string> > pfls;
2399 std::vector< std::vector<std::string> > locs;
2400 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2402 PyObject *ret2=PyList_New(sz);
2403 for(int i=0;i<sz;i++)
2405 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2406 const std::vector<TypeOfField>& typesFI=typesF[i];
2407 const std::vector<std::string>& pflsI=pfls[i];
2408 const std::vector<std::string>& locsI=locs[i];
2409 PyObject *elt=PyTuple_New(2);
2410 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2411 int sz2=ret[i].size();
2412 PyObject *elt2=PyList_New(sz2);
2413 for(int j=0;j<sz2;j++)
2415 PyObject *elt3=PyTuple_New(4);
2416 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2417 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));
2418 PyTuple_SetItem(elt3,1,elt4);
2419 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2420 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2421 PyList_SetItem(elt2,j,elt3);
2423 PyTuple_SetItem(elt,1,elt2);
2424 PyList_SetItem(ret2,i,elt);
2429 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2431 if(PyList_Check(elts))
2433 int sz=PyList_Size(elts);
2434 std::vector<int> ret(sz);
2435 for(int i=0;i<sz;i++)
2437 PyObject *elt=PyList_GetItem(elts,i);
2438 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2444 std::vector<int> ret(1);
2445 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2450 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2452 if(PySlice_Check(elts))
2454 Py_ssize_t strt=2,stp=2,step=2;
2455 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2456 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2457 self->eraseTimeStepIds2(strt,stp,step);
2461 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2462 if(!idsToRemove.empty())
2463 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2467 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2471 std::vector<int> pos2;
2472 DataArrayInt *pos3=0;
2473 DataArrayIntTuple *pos4=0;
2474 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2479 self->eraseTimeStepIds(&pos1,&pos1+1);
2486 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2491 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2495 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2499 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2501 return self->iterator();
2504 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2506 if(elt0 && PyList_Check(elt0))
2508 int sz=PyList_Size(elt0);
2509 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2510 int *pt=da->getPointer();
2511 for(int i=0;i<sz;i++,pt++)
2513 PyObject *elt1=PyList_GetItem(elt0,i);
2514 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2516 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2518 else if(elt0 && PySlice_Check(elt0))
2520 Py_ssize_t strt=2,stp=2,step=2;
2521 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2522 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2523 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2526 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2529 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2531 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2532 return self->changeMeshNames(modifTab);
2535 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2537 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2538 std::size_t sz=ret.size();
2539 PyObject *retPy=PyList_New(sz);
2540 for(std::size_t i=0;i<sz;i++)
2541 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2545 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2547 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2548 std::size_t sz=ret.size();
2549 PyObject *retPy=PyList_New(sz);
2550 for(std::size_t i=0;i<sz;i++)
2551 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2555 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2557 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2558 std::size_t sz=ret.size();
2559 PyObject *retPy=PyList_New(sz);
2560 for(std::size_t i=0;i<sz;i++)
2561 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2565 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2568 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2569 if(SWIG_IsOK(status))
2571 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2575 std::vector<MEDFileAnyTypeField1TS *> tmp;
2576 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2577 self->pushBackTimeSteps(tmp);
2581 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2583 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2584 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2585 return self->extractPart(extractDefCpp,mm);
2588 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2590 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2591 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2592 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2593 std::size_t sz=ret.size();
2594 PyObject *retPy=PyList_New(sz);
2595 for(std::size_t i=0;i<sz;i++)
2597 std::size_t sz2=ret[i].size();
2598 PyObject *ret1Py=PyList_New(sz2);
2599 for(std::size_t j=0;j<sz2;j++)
2601 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2604 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2606 PyList_SetItem(retPy,i,ret1Py);
2611 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2613 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2614 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2615 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2616 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2617 if(ret2.size()!=ret.size())
2619 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2620 throw INTERP_KERNEL::Exception(oss.str().c_str());
2622 std::size_t sz=ret.size();
2623 PyObject *retPy=PyList_New(sz);
2624 for(std::size_t i=0;i<sz;i++)
2626 std::size_t sz2=ret[i].size();
2627 PyObject *ret0Py=PyTuple_New(2);
2628 PyObject *ret1Py=PyList_New(sz2);
2629 for(std::size_t j=0;j<sz2;j++)
2631 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2634 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2636 PyTuple_SetItem(ret0Py,0,ret1Py);
2637 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2638 PyList_SetItem(retPy,i,ret0Py);
2645 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2648 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2649 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2650 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2652 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2653 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2654 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2655 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2656 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2657 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2659 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2660 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2661 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2664 MEDFileFieldMultiTS()
2666 return MEDFileFieldMultiTS::New();
2669 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2671 return MEDFileFieldMultiTS::New(fileName,loadAll);
2674 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2676 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2679 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2681 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2682 std::size_t sz(tmp.size());
2683 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2684 for(std::size_t i=0;i<sz;i++)
2686 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2687 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2689 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2692 std::string __str__() const throw(INTERP_KERNEL::Exception)
2694 return self->simpleRepr();
2697 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2699 DataArrayInt *ret1=0;
2700 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2701 PyObject *ret=PyTuple_New(2);
2702 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2703 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2707 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2709 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2710 std::vector< std::vector<TypeOfField> > typesF;
2711 std::vector< std::vector<std::string> > pfls;
2712 std::vector< std::vector<std::string> > locs;
2713 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2715 PyObject *ret2=PyList_New(sz);
2716 for(int i=0;i<sz;i++)
2718 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2719 const std::vector<TypeOfField>& typesFI=typesF[i];
2720 const std::vector<std::string>& pflsI=pfls[i];
2721 const std::vector<std::string>& locsI=locs[i];
2722 PyObject *elt=PyTuple_New(2);
2723 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2724 int sz2=ret[i].size();
2725 PyObject *elt2=PyList_New(sz2);
2726 for(int j=0;j<sz2;j++)
2728 PyObject *elt3=PyTuple_New(4);
2729 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2730 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2731 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2732 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2733 PyList_SetItem(elt2,j,elt3);
2735 PyTuple_SetItem(elt,1,elt2);
2736 PyList_SetItem(ret2,i,elt);
2740 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2742 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2748 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2750 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2751 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2754 PyObject *ret=PyTuple_New(2);
2755 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2756 std::size_t sz=elt1Cpp.size();
2757 PyObject *elt=PyList_New(sz);
2758 for(std::size_t i=0;i<sz;i++)
2760 PyObject *elt1=PyTuple_New(2);
2761 PyObject *elt2=PyTuple_New(2);
2762 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2763 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2764 PyObject *elt3=PyTuple_New(2);
2765 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2766 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2767 PyTuple_SetItem(elt1,0,elt2);
2768 PyTuple_SetItem(elt1,1,elt3);
2769 PyList_SetItem(elt,i,elt1);
2771 PyTuple_SetItem(ret,1,elt);
2777 class MEDFileFieldsIterator
2782 PyObject *next() throw(INTERP_KERNEL::Exception)
2784 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2786 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2789 PyErr_SetString(PyExc_StopIteration,"No more data.");
2796 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2799 static MEDFileIntFieldMultiTS *New();
2800 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2801 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2803 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2804 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2805 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2806 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2807 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2808 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2809 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2810 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2811 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2814 MEDFileIntFieldMultiTS()
2816 return MEDFileIntFieldMultiTS::New();
2819 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2821 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2824 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2826 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2829 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2831 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2832 std::size_t sz(tmp.size());
2833 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2834 for(std::size_t i=0;i<sz;i++)
2836 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2837 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2839 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2842 std::string __str__() const throw(INTERP_KERNEL::Exception)
2844 return self->simpleRepr();
2847 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2849 DataArrayInt *ret1=0;
2850 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2851 PyObject *ret=PyTuple_New(2);
2852 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2853 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2857 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2859 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2867 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2870 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2871 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2872 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2873 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
2874 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2875 void loadArrays() throw(INTERP_KERNEL::Exception);
2876 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2877 void unloadArrays() throw(INTERP_KERNEL::Exception);
2878 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2879 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2880 int getNumberOfFields() const;
2881 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2882 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2884 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2885 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2886 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2887 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2888 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2889 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2890 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2891 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2892 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2897 return MEDFileFields::New();
2900 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2902 return MEDFileFields::New(fileName,loadAll);
2905 std::string __str__() const throw(INTERP_KERNEL::Exception)
2907 return self->simpleRepr();
2910 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2912 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2913 std::size_t sz(tmp.size());
2914 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2915 for(std::size_t i=0;i<sz;i++)
2917 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2918 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2920 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2923 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2926 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2927 PyObject *ret=PyTuple_New(2);
2928 PyObject *ret_0=PyList_New(ret0.size());
2930 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2932 PyObject *elt=PyTuple_New(2);
2933 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2934 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2935 PyList_SetItem(ret_0,rk,elt);
2937 PyTuple_SetItem(ret,0,ret_0);
2938 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2939 PyTuple_SetItem(ret,1,ret_1);
2943 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2945 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2946 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2949 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2951 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2952 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2955 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2957 if(obj && PyList_Check(obj))
2959 int sz=PyList_Size(obj);
2960 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2961 int *pt=da->getPointer();
2962 for(int i=0;i<sz;i++,pt++)
2964 PyObject *elt1=PyList_GetItem(obj,i);
2965 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2967 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
2970 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2973 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2975 self->setFieldAtPos(obj,field);
2979 int __len__() const throw(INTERP_KERNEL::Exception)
2981 return self->getNumberOfFields();
2984 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2986 return self->iterator();
2989 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2991 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2992 return self->changeMeshNames(modifTab);
2995 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2997 if(elt0 && PyInt_Check(elt0))
2999 return PyInt_AS_LONG(elt0);
3001 else if(elt0 && PyString_Check(elt0))
3002 return self->getPosFromFieldName(PyString_AsString(elt0));
3004 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3007 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3009 if(PyList_Check(elts))
3011 int sz=PyList_Size(elts);
3012 std::vector<int> ret(sz);
3013 for(int i=0;i<sz;i++)
3015 PyObject *elt=PyList_GetItem(elts,i);
3016 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3022 std::vector<int> ret(1);
3023 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3028 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3030 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3031 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3032 self->pushFields(tmp);
3035 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3037 if(elts && PySlice_Check(elts))
3039 Py_ssize_t strt=2,stp=2,step=2;
3040 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3041 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3042 self->destroyFieldsAtPos2(strt,stp,step);
3046 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3047 if(!idsToRemove.empty())
3048 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3052 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3054 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3055 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3056 return self->extractPart(extractDefCpp,mm);
3061 class MEDFileParameter1TS : public RefCountObject
3064 void setIteration(int it);
3065 int getIteration() const;
3066 void setOrder(int order);
3067 int getOrder() const;
3068 void setTimeValue(double time);
3069 void setTime(int dt, int it, double time);
3070 double getTime(int& dt, int& it);
3071 double getTimeValue() const;
3074 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3077 void setValue(double val) throw(INTERP_KERNEL::Exception);
3078 double getValue() const throw(INTERP_KERNEL::Exception);
3079 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3082 std::string __str__() const throw(INTERP_KERNEL::Exception)
3084 return self->simpleRepr();
3089 class MEDFileParameterTinyInfo : public MEDFileWritable
3092 void setDescription(const std::string& name);
3093 std::string getDescription() const;
3094 void setTimeUnit(const std::string& unit);
3095 std::string getTimeUnit() const;
3098 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3101 static MEDFileParameterDouble1TS *New();
3102 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3103 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3104 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3105 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3106 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3107 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3108 std::string getName() const throw(INTERP_KERNEL::Exception);
3109 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3112 MEDFileParameterDouble1TS()
3114 return MEDFileParameterDouble1TS::New();
3117 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3119 return MEDFileParameterDouble1TS::New(fileName);
3122 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3124 return MEDFileParameterDouble1TS::New(fileName,paramName);
3127 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3129 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3132 std::string __str__() const throw(INTERP_KERNEL::Exception)
3134 return self->simpleRepr();
3137 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3140 bool ret0=self->isEqual(other,eps,what);
3141 PyObject *res=PyList_New(2);
3142 PyObject *ret0Py=ret0?Py_True:Py_False;
3144 PyList_SetItem(res,0,ret0Py);
3145 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3151 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3154 static MEDFileParameterMultiTS *New();
3155 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3156 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3157 std::string getName() const;
3158 void setName(const std::string& name);
3159 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3160 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3161 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3162 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3163 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3164 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3165 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3166 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3169 MEDFileParameterMultiTS()
3171 return MEDFileParameterMultiTS::New();
3174 MEDFileParameterMultiTS(const std::string& fileName)
3176 return MEDFileParameterMultiTS::New(fileName);
3179 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3181 return MEDFileParameterMultiTS::New(fileName,paramName);
3184 std::string __str__() const throw(INTERP_KERNEL::Exception)
3186 return self->simpleRepr();
3189 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3192 bool ret0=self->isEqual(other,eps,what);
3193 PyObject *res=PyList_New(2);
3194 PyObject *ret0Py=ret0?Py_True:Py_False;
3196 PyList_SetItem(res,0,ret0Py);
3197 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3201 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3205 std::vector<int> pos2;
3206 DataArrayInt *pos3=0;
3207 DataArrayIntTuple *pos4=0;
3208 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3213 self->eraseTimeStepIds(&pos1,&pos1+1);
3220 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3225 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3229 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3233 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3235 if(elt0 && PyInt_Check(elt0))
3237 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3240 else if(elt0 && PyTuple_Check(elt0))
3242 if(PyTuple_Size(elt0)==2)
3244 PyObject *o0=PyTuple_GetItem(elt0,0);
3245 PyObject *o1=PyTuple_GetItem(elt0,1);
3246 if(PyInt_Check(o0) && PyInt_Check(o1))
3248 int iter=PyInt_AS_LONG(o0);
3249 int order=PyInt_AS_LONG(o1);
3250 return self->getPosOfTimeStep(iter,order);
3253 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 !");
3256 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 !");
3258 else if(elt0 && PyFloat_Check(elt0))
3260 double val=PyFloat_AS_DOUBLE(elt0);
3261 return self->getPosGivenTime(val);
3264 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3267 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3269 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3275 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3277 if(PyList_Check(elts))
3279 int sz=PyList_Size(elts);
3280 std::vector<int> ret(sz);
3281 for(int i=0;i<sz;i++)
3283 PyObject *elt=PyList_GetItem(elts,i);
3284 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3290 std::vector<int> ret(1);
3291 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3296 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3298 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3299 if(!idsToRemove.empty())
3300 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3303 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3305 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3311 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3313 std::vector< std::pair<int,int> > res=self->getIterations();
3314 PyObject *ret=PyList_New(res.size());
3316 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3318 PyObject *elt=PyTuple_New(2);
3319 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3320 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3321 PyList_SetItem(ret,rk,elt);
3326 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3328 std::vector<double> res2;
3329 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3330 PyObject *ret=PyList_New(res.size());
3332 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3334 PyObject *elt=PyTuple_New(3);
3335 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3336 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3337 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3338 PyList_SetItem(ret,rk,elt);
3345 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3348 static MEDFileParameters *New();
3349 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3350 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3351 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3352 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3353 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3354 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3355 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3356 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3357 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3358 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3359 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3364 return MEDFileParameters::New();
3367 MEDFileParameters(const std::string& fileName)
3369 return MEDFileParameters::New(fileName);
3372 std::string __str__() const throw(INTERP_KERNEL::Exception)
3374 return self->simpleRepr();
3377 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3379 if(PyInt_Check(obj))
3381 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3386 else if(PyString_Check(obj))
3388 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3394 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3397 int __len__() const throw(INTERP_KERNEL::Exception)
3399 return self->getNumberOfParams();
3402 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3404 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3410 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3412 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3418 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3421 bool ret0=self->isEqual(other,eps,what);
3422 PyObject *res=PyList_New(2);
3423 PyObject *ret0Py=ret0?Py_True:Py_False;
3425 PyList_SetItem(res,0,ret0Py);
3426 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3432 class MEDFileData : public RefCountObject, public MEDFileWritable
3435 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3436 static MEDFileData *New();
3437 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3438 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3439 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3440 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3441 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3442 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3443 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3445 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3446 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3448 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3451 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3453 return MEDFileData::New(fileName);
3458 return MEDFileData::New();
3461 std::string __str__() const throw(INTERP_KERNEL::Exception)
3463 return self->simpleRepr();
3466 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3468 MEDFileMeshes *ret=self->getMeshes();
3474 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3476 MEDFileParameters *ret=self->getParams();
3482 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3484 MEDFileFields *ret=self->getFields();
3490 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3492 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3493 return self->changeMeshNames(modifTab);
3496 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3498 std::vector<const MEDFileData *> mfdsCpp;
3499 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3500 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3506 class SauvReader : public RefCountObject
3509 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3510 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3513 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3515 return SauvReader::New(fileName);
3520 class SauvWriter : public RefCountObject
3523 static SauvWriter * New();
3524 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3525 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3526 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3527 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3530 SauvWriter() throw(INTERP_KERNEL::Exception)
3532 return SauvWriter::New();
3539 class MEDFileMeshStruct;
3541 class MEDFileField1TSStructItem
3544 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3547 class MEDFileMeshStruct : public RefCountObject
3550 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3552 ~MEDFileMeshStruct();
3555 class MEDMeshMultiLev : public RefCountObject
3558 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3559 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3560 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3566 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3568 DataArrayInt *famIds(0);
3569 bool isWithoutCopy(false);
3570 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3571 PyObject *ret=PyTuple_New(2);
3572 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3574 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3575 PyTuple_SetItem(ret,1,ret1Py);
3579 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3581 DataArrayInt *numIds(0);
3582 bool isWithoutCopy(false);
3583 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3584 PyObject *ret=PyTuple_New(2);
3585 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3587 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3588 PyTuple_SetItem(ret,1,ret1Py);
3592 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3594 DataArrayInt *famIds(0);
3595 bool isWithoutCopy(false);
3596 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3597 PyObject *ret=PyTuple_New(2);
3598 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3600 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3601 PyTuple_SetItem(ret,1,ret1Py);
3605 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3607 DataArrayInt *numIds(0);
3608 bool isWithoutCopy(false);
3609 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3610 PyObject *ret=PyTuple_New(2);
3611 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3613 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3614 PyTuple_SetItem(ret,1,ret1Py);
3618 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3620 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3621 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3622 PyObject *res(PyList_New(result.size()));
3623 for(int i=0;iL!=result.end(); i++, iL++)
3624 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3630 class MEDUMeshMultiLev : public MEDMeshMultiLev
3633 ~MEDUMeshMultiLev();
3637 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3639 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3640 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3641 PyObject *ret0Py=ncc?Py_True:Py_False;
3643 PyObject *ret=PyTuple_New(7);
3644 PyTuple_SetItem(ret,0,ret0Py);
3645 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3646 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3647 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3648 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3649 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3650 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3656 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3659 ~MEDStructuredMeshMultiLev();
3662 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3665 ~MEDCMeshMultiLev();
3669 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3672 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3673 std::size_t sz(objs.size());
3674 PyObject *ret(PyTuple_New(2));
3675 PyObject *ret0=PyList_New(sz);
3676 for(std::size_t i=0;i<sz;i++)
3677 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3678 PyTuple_SetItem(ret,0,ret0);
3679 PyObject *ret1Py(isInternal?Py_True:Py_False);
3681 PyTuple_SetItem(ret,1,ret1Py);
3687 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3690 ~MEDCurveLinearMeshMultiLev();
3694 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3696 DataArrayDouble *ret0(0);
3697 std::vector<int> ret1;
3699 self->buildVTUArrays(ret0,ret1,ret2);
3700 std::size_t sz(ret1.size());
3701 PyObject *ret=PyTuple_New(3);
3702 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3703 PyObject *ret1Py=PyList_New(sz);
3704 for(std::size_t i=0;i<sz;i++)
3705 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3706 PyTuple_SetItem(ret,1,ret1Py);
3707 PyObject *ret2Py(ret2?Py_True:Py_False);
3709 PyTuple_SetItem(ret,2,ret2Py);
3715 class MEDFileFastCellSupportComparator : public RefCountObject
3718 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3719 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3720 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3721 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3723 ~MEDFileFastCellSupportComparator();
3727 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3729 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3730 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3731 PyObject *res(PyList_New(result.size()));
3732 for(int i=0;iL!=result.end(); i++, iL++)
3733 PyList_SetItem(res,i,PyInt_FromLong(*iL));