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::MEDFileCMesh::New;
131 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
132 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
133 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
134 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
135 %newobject MEDCoupling::MEDFileMeshes::New;
136 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
137 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
138 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
139 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
140 %newobject MEDCoupling::MEDFileMeshes::__iter__;
142 %newobject MEDCoupling::MEDFileFields::New;
143 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
144 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
145 %newobject MEDCoupling::MEDFileFields::deepCopy;
146 %newobject MEDCoupling::MEDFileFields::shallowCpy;
147 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
148 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
149 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
150 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
151 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
152 %newobject MEDCoupling::MEDFileFields::__iter__;
153 %newobject MEDCoupling::MEDFileFields::extractPart;
155 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
156 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
157 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
158 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
159 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
160 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
161 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
162 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
163 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
164 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
165 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
166 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
167 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
168 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
169 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
170 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
171 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
172 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
173 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
174 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
175 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
176 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
177 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
178 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
179 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
180 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
181 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
183 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
184 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
185 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
186 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
187 %newobject MEDCoupling::MEDFileField1TS::New;
188 %newobject MEDCoupling::MEDFileField1TS::field;
189 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
190 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
191 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
192 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
193 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
194 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
196 %newobject MEDCoupling::MEDFileIntField1TS::New;
197 %newobject MEDCoupling::MEDFileIntField1TS::field;
198 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
199 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
200 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
201 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
202 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
203 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
205 %newobject MEDCoupling::MEDFileData::New;
206 %newobject MEDCoupling::MEDFileData::deepCopy;
207 %newobject MEDCoupling::MEDFileData::getMeshes;
208 %newobject MEDCoupling::MEDFileData::getFields;
209 %newobject MEDCoupling::MEDFileData::getParams;
210 %newobject MEDCoupling::MEDFileData::Aggregate;
212 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
213 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
214 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
215 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
216 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
217 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
218 %newobject MEDCoupling::MEDFileParameters::New;
219 %newobject MEDCoupling::MEDFileParameters::deepCopy;
220 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
221 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
222 %newobject MEDCoupling::MEDFileParameters::__getitem__;
224 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
225 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
226 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
227 %newobject MEDCoupling::MEDFileJointOneStep::New;
228 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
229 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
230 %newobject MEDCoupling::MEDFileJoint::New;
231 %newobject MEDCoupling::MEDFileJoint::deepCopy;
232 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
233 %newobject MEDCoupling::MEDFileJoints::New;
234 %newobject MEDCoupling::MEDFileJoints::deepCopy;
235 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
236 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
237 %newobject MEDCoupling::MEDFileJoints::__getitem__;
238 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
239 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
240 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
241 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
242 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
243 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
244 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
245 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
246 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
248 %newobject MEDCoupling::SauvWriter::New;
249 %newobject MEDCoupling::SauvReader::New;
250 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
252 %newobject MEDCoupling::MEDFileMeshStruct::New;
253 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
254 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
255 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
256 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
257 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
259 %feature("unref") MEDFileMesh "$this->decrRef();"
260 %feature("unref") MEDFileUMesh "$this->decrRef();"
261 %feature("unref") MEDFileCMesh "$this->decrRef();"
262 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
263 %feature("unref") MEDFileMeshes "$this->decrRef();"
264 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
265 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
266 %feature("unref") MEDFileField1TS "$this->decrRef();"
267 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
268 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
269 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
270 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
271 %feature("unref") MEDFileFields "$this->decrRef();"
272 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
273 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
274 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
275 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
276 %feature("unref") MEDFileParameters "$this->decrRef();"
277 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
278 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
279 %feature("unref") MEDFileJoint "$this->decrRef();"
280 %feature("unref") MEDFileJoints "$this->decrRef();"
281 %feature("unref") MEDFileEquivalences "$this->decrRef();"
282 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
283 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
284 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
285 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
286 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
287 %feature("unref") MEDFileData "$this->decrRef();"
288 %feature("unref") SauvReader "$this->decrRef();"
289 %feature("unref") SauvWriter "$this->decrRef();"
290 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
291 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
292 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
293 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
294 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
295 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
297 namespace MEDCoupling
300 std::string MEDFileVersionStr();
301 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
302 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
303 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
304 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
305 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
306 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
307 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
308 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
309 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
310 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
311 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
312 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
313 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
314 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
315 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
316 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
317 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
318 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
319 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
320 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
321 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
322 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
323 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);
324 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);
325 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);
326 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);
327 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);
328 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
329 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
330 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
331 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
332 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
333 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
336 %rename (MEDFileVersion) MEDFileVersionSwig;
337 %rename (GetFieldIterations) GetFieldIterationsSwig;
338 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
339 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
340 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
341 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
342 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
343 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
344 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
345 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
346 %rename (WriteUMeshes) WriteUMeshesSwig;
347 %rename (GetTypesOfField) GetTypesOfFieldSwig;
348 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
349 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
353 PyObject *MEDFileVersionSwig()
355 int major,minor,release;
356 MEDCoupling::MEDFileVersion(major,minor,release);
357 PyObject *ret(PyTuple_New(3));
358 PyTuple_SetItem(ret,0,SWIG_From_int(major));
359 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
360 PyTuple_SetItem(ret,2,SWIG_From_int(release));
364 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
366 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
367 PyObject *ret=PyList_New(res.size());
369 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
371 PyObject *elt=PyTuple_New(2);
372 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
373 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
374 PyList_SetItem(ret,rk,elt);
379 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
381 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
382 PyObject *ret=PyList_New(res.size());
384 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
386 PyObject *elt=PyTuple_New(3);
387 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
388 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
389 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
390 PyList_SetItem(ret,rk,elt);
395 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
397 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
398 PyObject *ret=PyList_New(res.size());
400 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
402 PyObject *elt=PyTuple_New(2);
403 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
404 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
405 PyList_SetItem(ret,rk,elt);
410 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
412 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
413 PyObject *ret=PyList_New(res.size());
415 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
417 PyObject *elt=PyTuple_New(2);
418 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
419 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
420 PyList_SetItem(ret,rk,elt);
425 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
427 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
428 PyObject *ret=PyList_New(res.size());
430 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
432 PyObject *elt=PyTuple_New(2);
433 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
434 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
435 PyList_SetItem(ret,rk,elt);
440 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
442 int meshDim,spaceDim,numberOfNodes;
443 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
444 PyObject *ret=PyTuple_New(4);
445 PyObject *elt0=PyList_New(res.size());
447 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
449 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
451 PyObject *elt1=PyList_New(obj2.size());
452 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
454 PyObject *elt2=PyTuple_New(2);
455 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
456 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
457 PyList_SetItem(elt1,j,elt2);
459 PyList_SetItem(elt0,i,elt1);
461 PyTuple_SetItem(ret,0,elt0);
462 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
463 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
464 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
468 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
469 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
471 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
472 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
473 return convertFieldDoubleVecToPy(res);
476 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
478 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
479 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
480 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
483 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
485 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
486 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
487 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
490 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
492 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
493 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
494 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
497 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
499 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
501 PyObject *ret=PyList_New(size);
502 for(int i=0;i<size;i++)
503 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
507 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
509 std::vector<std::string> grps;
510 converPyListToVecString(li,grps);
511 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
514 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
516 std::vector<std::string> fams;
517 converPyListToVecString(li,fams);
518 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
522 namespace MEDCoupling
524 class MEDFileWritable
527 void copyOptionsFrom(const MEDFileWritable& other) const;
528 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
529 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
530 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
531 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
534 class MEDFileMeshReadSelector
537 MEDFileMeshReadSelector();
538 MEDFileMeshReadSelector(unsigned int code);
539 unsigned int getCode() const;
540 void setCode(unsigned int newCode);
541 bool isCellFamilyFieldReading() const;
542 bool isNodeFamilyFieldReading() const;
543 bool isCellNameFieldReading() const;
544 bool isNodeNameFieldReading() const;
545 bool isCellNumFieldReading() const;
546 bool isNodeNumFieldReading() const;
547 void setCellFamilyFieldReading(bool b);
548 void setNodeFamilyFieldReading(bool b);
549 void setCellNameFieldReading(bool b);
550 void setNodeNameFieldReading(bool b);
551 void setCellNumFieldReading(bool b);
552 void setNodeNumFieldReading(bool b);
555 std::string __str__() const throw(INTERP_KERNEL::Exception)
557 std::ostringstream oss;
562 std::string __repr__() const throw(INTERP_KERNEL::Exception)
564 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
570 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
573 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
574 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
575 throw(INTERP_KERNEL::Exception);
576 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
577 INTERP_KERNEL::NormalizedCellType loc_geo_type,
578 INTERP_KERNEL::NormalizedCellType rem_geo_type)
579 throw(INTERP_KERNEL::Exception);
580 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
581 MEDFileJointCorrespondence *deepCopy() const;
582 MEDFileJointCorrespondence *shallowCpy() const;
583 void setIsNodal(bool isNodal);
584 bool getIsNodal() const;
585 bool isEqual(const MEDFileJointCorrespondence *other) const;
586 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
587 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
588 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
589 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
590 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
591 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
592 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);
593 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
596 MEDFileJointCorrespondence()
598 return MEDFileJointCorrespondence::New();
600 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
602 return MEDFileJointCorrespondence::New(correspondence);
604 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
605 INTERP_KERNEL::NormalizedCellType loc_geo_type,
606 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
608 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
611 std::string __str__() const throw(INTERP_KERNEL::Exception)
613 return self->simpleRepr();
618 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
621 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
622 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
623 MEDFileJointOneStep *deepCopy() const;
624 MEDFileJointOneStep *shallowCpy() const;
625 bool isEqual(const MEDFileJointOneStep *other) const;
626 void setOrder(int order);
627 int getOrder() const;
628 void setIteration(int it);
629 int getIteration() const;
630 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
631 int getNumberOfCorrespondences() const;
632 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
633 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
634 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
637 MEDFileJointOneStep()
639 return MEDFileJointOneStep::New();
642 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
644 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
647 std::string __str__() const throw(INTERP_KERNEL::Exception)
649 return self->simpleRepr();
654 class MEDFileJoint : public RefCountObject, public MEDFileWritable
657 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
658 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
659 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
660 MEDFileJoint *deepCopy() const;
661 MEDFileJoint *shallowCpy() const;
662 bool isEqual(const MEDFileJoint *other) const;
663 void setLocalMeshName(const std::string& name);
664 std::string getLocalMeshName() const;
665 void setRemoteMeshName(const std::string& name);
666 std::string getRemoteMeshName() const;
667 void setDescription(const std::string& name);
668 std::string getDescription() const;
669 void setJointName(const std::string& name);
670 std::string getJointName() const;
671 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
672 void setDomainNumber(const int& number);
673 int getDomainNumber() const;
674 void pushStep(MEDFileJointOneStep* step);
675 int getNumberOfSteps() const;
676 MEDFileJointOneStep *getStepAtPos(int i) const;
677 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
678 std::string simpleRepr() const;
683 return MEDFileJoint::New();
686 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
688 return MEDFileJoint::New(fileName,mName,num);
691 std::string __str__() const throw(INTERP_KERNEL::Exception)
693 return self->simpleRepr();
698 class MEDFileJoints : public RefCountObject, public MEDFileWritable
701 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
702 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
703 MEDFileJoints *deepCopy() const;
704 std::string simpleRepr() const;
705 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
706 std::string getMeshName() const;
707 int getNumberOfJoints() const;
708 std::vector<std::string> getJointsNames() const;
709 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
710 void resize(int newSize) throw(INTERP_KERNEL::Exception);
711 void pushJoint(MEDFileJoint *joint);
712 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
713 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
718 return MEDFileJoints::New();
721 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
723 return MEDFileJoints::New(fileName,meshName);
726 std::string __str__() const throw(INTERP_KERNEL::Exception)
728 return self->simpleRepr();
731 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
735 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
740 else if(PyString_Check(obj))
742 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
748 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
751 int __len__() const throw(INTERP_KERNEL::Exception)
753 return self->getNumberOfJoints();
756 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
758 MEDFileJoint *ret=self->getJointAtPos(i);
764 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
766 MEDFileJoint *ret=self->getJointWithName(paramName);
774 class MEDFileEquivalenceBase : public RefCountObject
777 MEDFileEquivalenceBase();
780 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
783 MEDFileEquivalenceData();
785 void setArray(DataArrayInt *data);
788 DataArrayInt *getArray()
790 DataArrayInt *ret(self->getArray());
791 if(ret) ret->incrRef();
797 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
800 MEDFileEquivalenceNode();
803 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
806 MEDFileEquivalenceCell();
809 std::size_t size() const;
810 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
811 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
814 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
816 DataArrayInt *ret(self->getArray(type));
817 if(ret) ret->incrRef();
821 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
823 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
824 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
825 PyObject *res=PyList_New(result.size());
826 for(int i=0;iL!=result.end(); i++, iL++)
827 PyList_SetItem(res,i,PyInt_FromLong(*iL));
833 class MEDFileEquivalencePair : public RefCountObject
836 MEDFileEquivalencePair();
838 std::string getName() const;
839 void setName(const std::string& name);
840 std::string getDescription() const;
841 void setDescription(const std::string& descr);
842 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
845 MEDFileEquivalenceCell *initCell()
847 MEDFileEquivalenceCell *ret(self->initCell());
848 if(ret) ret->incrRef();
852 MEDFileEquivalenceNode *initNode()
854 MEDFileEquivalenceNode *ret(self->initNode());
855 if(ret) ret->incrRef();
859 MEDFileEquivalenceCell *getCell()
861 MEDFileEquivalenceCell *ret(self->getCell());
862 if(ret) ret->incrRef();
866 MEDFileEquivalenceNode *getNode()
868 MEDFileEquivalenceNode *ret(self->getNode());
869 if(ret) ret->incrRef();
875 class MEDFileEquivalences : public RefCountObject
878 MEDFileEquivalences();
881 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
882 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
883 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
887 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
889 MEDFileEquivalencePair *ret(self->getEquivalence(i));
890 if(ret) ret->incrRef();
893 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
895 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
896 if(ret) ret->incrRef();
900 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
902 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
903 if(ret) ret->incrRef();
909 class MEDFileMesh : public RefCountObject, public MEDFileWritable
912 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
913 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
914 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
915 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
916 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
917 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
918 void setName(const std::string& name);
919 std::string getName();
920 std::string getUnivName() const;
921 bool getUnivNameWrStatus() const;
922 void setUnivNameWrStatus(bool newStatus);
923 void setDescription(const std::string& name);
924 std::string getDescription() const;
925 void setOrder(int order);
926 int getOrder() const;
927 void setIteration(int it);
929 void setTimeValue(double time);
930 void setTime(int dt, int it, double time);
931 double getTimeValue() const;
932 void setTimeUnit(const std::string& unit);
933 std::string getTimeUnit() const;
934 void setAxisType(MEDCouplingAxisType at);
935 MEDCouplingAxisType getAxisType() const;
936 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
937 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
938 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
939 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
940 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
941 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
942 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
943 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
944 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
945 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
946 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
947 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
948 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
949 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
950 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
952 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
953 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
954 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
955 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
956 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
957 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
958 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
959 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
960 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
961 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
962 void clearGrpMap() throw(INTERP_KERNEL::Exception);
963 void clearFamMap() throw(INTERP_KERNEL::Exception);
964 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
965 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
966 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
967 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
968 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
969 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
970 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
971 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
972 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
973 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
974 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
975 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
976 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
977 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
978 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
979 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
980 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
981 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
982 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
983 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
984 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
985 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
986 static std::string GetMagicFamilyStr();
987 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
988 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
989 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
990 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
991 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
992 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
993 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
994 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
995 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
996 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
997 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
998 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
999 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1000 void setFamilyInfo(const std::map<std::string,int>& info);
1001 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1002 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1003 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1004 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1005 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1006 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1007 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1008 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1009 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1010 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1011 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1012 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1013 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1014 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1015 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1016 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1017 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1018 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1019 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1020 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1021 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1023 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1024 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1025 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1026 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1027 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1028 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1029 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1030 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1031 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1032 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1033 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1034 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1035 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1036 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1037 int getNumberOfJoints();
1038 MEDFileJoints *getJoints();
1039 void setJoints( MEDFileJoints* joints );
1040 void initializeEquivalences();
1041 void killEquivalences();
1044 std::string __str__() const throw(INTERP_KERNEL::Exception)
1046 return self->simpleRepr();
1049 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1051 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1054 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1057 double tmp0=self->getTime(tmp1,tmp2);
1058 PyObject *res = PyList_New(3);
1059 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1060 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1061 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1065 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1068 bool ret0=self->isEqual(other,eps,what);
1069 PyObject *res=PyList_New(2);
1070 PyObject *ret0Py=ret0?Py_True:Py_False;
1072 PyList_SetItem(res,0,ret0Py);
1073 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1077 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1079 std::vector<const DataArrayInt *> grps;
1080 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1081 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1084 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1087 bool ret0=self->areFamsEqual(other,what);
1088 PyObject *res=PyList_New(2);
1089 PyObject *ret0Py=ret0?Py_True:Py_False;
1091 PyList_SetItem(res,0,ret0Py);
1092 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1096 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1099 bool ret0=self->areGrpsEqual(other,what);
1100 PyObject *res=PyList_New(2);
1101 PyObject *ret0Py=ret0?Py_True:Py_False;
1103 PyList_SetItem(res,0,ret0Py);
1104 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1108 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1110 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1111 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1112 PyObject *res=PyList_New(result.size());
1113 for(int i=0;iL!=result.end(); i++, iL++)
1114 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1118 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1120 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1121 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1122 PyObject *res=PyList_New(result.size());
1123 for(int i=0;iL!=result.end(); i++, iL++)
1124 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1128 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1130 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1133 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1136 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1138 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1141 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1144 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1146 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1149 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1152 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1154 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1157 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1160 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1162 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1165 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1168 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1171 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1172 PyObject *ret=PyTuple_New(2);
1173 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1174 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1178 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1180 DataArrayInt *ret3=0;
1181 std::vector<int> ret1,ret2;
1182 bool ret0=self->unPolyze(ret1,ret2,ret3);
1183 PyObject *ret=PyTuple_New(4);
1184 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1186 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1187 for(int j=0;j<(int)ret1.size()/3;j++)
1189 PyObject *retLev2=PyList_New(3);
1190 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1191 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1192 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1193 PyList_SetItem(retLev1_0,j,retLev2);
1195 PyTuple_SetItem(ret,1,retLev1_0);
1197 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1198 for(int j=0;j<(int)ret2.size()/3;j++)
1200 PyObject *retLev2=PyList_New(3);
1201 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1202 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1203 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1204 PyList_SetItem(retLev1_1,j,retLev2);
1206 PyTuple_SetItem(ret,2,retLev1_1);
1208 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1212 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1214 MEDFileEquivalences *ret(self->getEquivalences());
1215 if(ret) ret->incrRef();
1221 class MEDFileUMesh : public MEDFileMesh
1224 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1225 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1226 static MEDFileUMesh *New();
1228 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1229 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1230 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1231 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1232 void clearNodeAndCellNumbers();
1234 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1235 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1236 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1237 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1238 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1239 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1240 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1241 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1242 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1243 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1245 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1246 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1247 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1248 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1249 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1250 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1251 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1252 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1253 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1254 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1255 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1256 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1257 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1258 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1261 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1263 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1266 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1268 return MEDFileUMesh::New(fileName,mrs);
1273 return MEDFileUMesh::New();
1277 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1279 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1282 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)
1284 std::vector<int> typesCpp1;
1285 convertPyToNewIntArr3(types,typesCpp1);
1286 std::size_t sz(typesCpp1.size());
1287 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1288 for(std::size_t ii=0;ii<sz;ii++)
1289 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1290 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1293 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1294 {// put an empty dict in input to say to __new__ to call __init__...
1295 PyObject *ret(PyTuple_New(1));
1296 PyObject *ret0(PyDict_New());
1297 PyTuple_SetItem(ret,0,ret0);
1301 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1303 std::vector<double> a0;
1304 std::vector<int> a1;
1305 std::vector<std::string> a2;
1306 std::vector< MCAuto<DataArrayInt> > a3;
1307 MCAuto<DataArrayDouble> a4;
1308 self->serialize(a0,a1,a2,a3,a4);
1309 PyObject *ret(PyTuple_New(5));
1310 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1311 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1313 PyObject *ret2(PyList_New(sz));
1314 for(int i=0;i<sz;i++)
1315 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1316 PyTuple_SetItem(ret,2,ret2);
1318 PyObject *ret3(PyList_New(sz));
1319 for(int i=0;i<sz;i++)
1321 DataArrayInt *elt(a3[i]);
1324 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1326 PyTuple_SetItem(ret,3,ret3);
1327 DataArrayDouble *ret4(a4);
1330 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1334 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1336 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1337 if(!PyTuple_Check(inp))
1338 throw INTERP_KERNEL::Exception(MSG);
1339 int sz(PyTuple_Size(inp));
1341 throw INTERP_KERNEL::Exception(MSG);
1342 std::vector<double> a0;
1343 std::vector<int> a1;
1344 std::vector<std::string> a2;
1345 std::vector< MCAuto<DataArrayInt> > a3;
1346 MCAuto<DataArrayDouble> a4;
1348 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1350 fillArrayWithPyListDbl3(a0py,tmp,a0);
1351 convertPyToNewIntArr3(a1py,a1);
1352 fillStringVector(a2py,a2);
1354 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1356 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1357 if(!SWIG_IsOK(status))
1358 throw INTERP_KERNEL::Exception(MSG);
1359 a4=reinterpret_cast<DataArrayDouble *>(argp);
1360 if((DataArrayDouble *)a4)
1363 std::vector< DataArrayInt * > a3Tmp;
1364 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1365 std::size_t sz(a3Tmp.size());
1367 for(std::size_t i=0;i<sz;i++)
1371 a3Tmp[i]->incrRef();
1373 self->unserialize(a0,a1,a2,a3,a4);
1377 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1380 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1381 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1384 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1387 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1390 self->setMeshAtLevel(meshDimRelToMax,m1);
1393 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1396 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1398 self->removeMeshAtLevel(meshDimRelToMax);
1401 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1403 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1405 DataArrayDouble *a,*a2;
1406 DataArrayDoubleTuple *aa,*aa2;
1407 std::vector<double> bb,bb2;
1409 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1410 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1411 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1415 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1417 std::vector<const MEDFileUMesh *> meshesCpp;
1418 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1419 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1423 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1425 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1426 return convertVecPairIntToPy(ret);
1429 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1431 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1432 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1433 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1436 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1438 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1439 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1440 return self->extractPart(extractDefCpp);
1443 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1445 std::vector<const MEDCouplingUMesh *> ms;
1446 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1447 self->setMeshes(ms,renum);
1450 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1452 std::vector<const MEDCouplingUMesh *> ms;
1453 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1454 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1457 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1459 std::vector<const MEDCouplingUMesh *> ms;
1460 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1461 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1464 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1466 DataArrayDouble *ret=self->getCoords();
1472 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1474 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1477 return const_cast<PartDefinition *>(ret);
1480 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1482 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1483 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1484 PyObject *ret=PyTuple_New(3);
1485 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1486 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1487 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1491 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1493 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1499 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1501 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1502 std::size_t sz(tmp.size());
1503 PyObject *ret=PyList_New(sz);
1504 for(std::size_t i=0;i<sz;i++)
1508 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1515 class MEDFileStructuredMesh : public MEDFileMesh
1520 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1522 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1530 class MEDFileCMesh : public MEDFileStructuredMesh
1533 static MEDFileCMesh *New();
1534 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1535 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1536 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1537 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1542 return MEDFileCMesh::New();
1545 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1547 return MEDFileCMesh::New(fileName,mrs);
1550 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1552 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1555 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1557 const MEDCouplingCMesh *tmp=self->getMesh();
1560 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1565 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1568 static MEDFileCurveLinearMesh *New();
1569 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1570 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1571 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1574 MEDFileCurveLinearMesh()
1576 return MEDFileCurveLinearMesh::New();
1579 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1581 return MEDFileCurveLinearMesh::New(fileName,mrs);
1584 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1586 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1589 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1591 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1594 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1599 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1602 static MEDFileMeshMultiTS *New();
1603 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1604 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1605 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1606 std::string getName() const throw(INTERP_KERNEL::Exception);
1607 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1608 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1609 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1612 MEDFileMeshMultiTS()
1614 return MEDFileMeshMultiTS::New();
1617 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1619 return MEDFileMeshMultiTS::New(fileName);
1622 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1624 return MEDFileMeshMultiTS::New(fileName,mName);
1627 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1629 MEDFileMesh *ret=self->getOneTimeStep();
1637 class MEDFileMeshesIterator
1642 PyObject *next() throw(INTERP_KERNEL::Exception)
1644 MEDFileMesh *ret=self->nextt();
1648 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1652 PyErr_SetString(PyExc_StopIteration,"No more data.");
1659 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1662 static MEDFileMeshes *New();
1663 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1664 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1665 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1666 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1667 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1669 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1670 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1671 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1672 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1673 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1678 return MEDFileMeshes::New();
1681 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1683 return MEDFileMeshes::New(fileName);
1686 std::string __str__() const throw(INTERP_KERNEL::Exception)
1688 return self->simpleRepr();
1691 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1693 if(PyInt_Check(obj))
1695 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1700 else if(PyString_Check(obj))
1702 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1708 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1711 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1713 self->setMeshAtPos(obj,mesh);
1717 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1719 return self->iterator();
1722 int __len__() const throw(INTERP_KERNEL::Exception)
1724 return self->getNumberOfMeshes();
1727 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1729 MEDFileMesh *ret=self->getMeshAtPos(i);
1734 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1736 MEDFileMesh *ret=self->getMeshWithName(mname);
1744 class MEDFileFieldLoc : public RefCountObject
1747 std::string getName() const;
1748 int getDimension() const;
1749 int getNumberOfGaussPoints() const;
1750 int getNumberOfPointsInCells() const;
1751 const std::vector<double>& getRefCoords() const;
1752 const std::vector<double>& getGaussCoords() const;
1753 const std::vector<double>& getGaussWeights() const;
1754 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1757 std::string __str__() const throw(INTERP_KERNEL::Exception)
1759 return self->repr();
1764 class MEDFileFieldGlobsReal
1767 void resetContent();
1768 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1769 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1770 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1771 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1772 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1773 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1774 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1775 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1776 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1777 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1778 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1779 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1780 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1781 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1782 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1783 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1784 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1785 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1786 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1787 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1788 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1789 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1790 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1791 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1792 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1793 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1796 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1798 const DataArrayInt *ret=self->getProfile(pflName);
1801 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1804 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1806 const DataArrayInt *ret=self->getProfileFromId(pflId);
1809 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1812 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1814 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1817 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1820 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1822 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1825 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1828 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1830 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1831 return convertVecPairVecStToPy(ret);
1834 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1836 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1837 return convertVecPairVecStToPy(ret);
1840 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1842 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1843 self->changePflsNames(v);
1846 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1848 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1849 self->changePflsRefsNamesGen(v);
1852 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1854 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1855 self->changePflsNamesInStruct(v);
1858 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1860 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1861 self->changeLocsNames(v);
1864 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1866 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1867 self->changeLocsRefsNamesGen(v);
1870 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1872 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1873 self->changeLocsNamesInStruct(v);
1876 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1878 std::ostringstream oss;
1879 self->simpleReprGlobs(oss);
1885 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1888 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1889 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1890 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1891 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1892 void loadArrays() throw(INTERP_KERNEL::Exception);
1893 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1894 void unloadArrays() throw(INTERP_KERNEL::Exception);
1895 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1896 int getDimension() const throw(INTERP_KERNEL::Exception);
1897 int getIteration() const throw(INTERP_KERNEL::Exception);
1898 int getOrder() const throw(INTERP_KERNEL::Exception);
1899 std::string getName() throw(INTERP_KERNEL::Exception);
1900 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1901 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1902 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1903 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1904 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1905 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1906 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1907 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1908 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1909 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1910 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1911 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1912 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
1913 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1914 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1917 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1920 double tmp0=self->getTime(tmp1,tmp2);
1921 PyObject *res = PyList_New(3);
1922 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1923 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1924 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1928 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1930 std::pair<int,int> res=self->getDtIt();
1931 PyObject *elt=PyTuple_New(2);
1932 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1933 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1937 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1939 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1942 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1944 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1947 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1949 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1950 return self->changeMeshNames(modifTab);
1953 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1955 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1956 PyObject *ret2=PyList_New(ret.size());
1957 for(int i=0;i<(int)ret.size();i++)
1958 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1962 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1964 std::vector<int> ret1;
1965 int ret0=self->getNonEmptyLevels(mname,ret1);
1966 PyObject *elt=PyTuple_New(2);
1967 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1968 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1972 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1974 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1975 std::vector< std::vector<TypeOfField> > typesF;
1976 std::vector< std::vector<std::string> > pfls;
1977 std::vector< std::vector<std::string> > locs;
1978 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1980 PyObject *ret2=PyList_New(sz);
1981 for(int i=0;i<sz;i++)
1983 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1984 const std::vector<TypeOfField>& typesFI=typesF[i];
1985 const std::vector<std::string>& pflsI=pfls[i];
1986 const std::vector<std::string>& locsI=locs[i];
1987 PyObject *elt=PyTuple_New(2);
1988 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1989 int sz2=ret[i].size();
1990 PyObject *elt2=PyList_New(sz2);
1991 for(int j=0;j<sz2;j++)
1993 PyObject *elt3=PyTuple_New(4);
1994 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1995 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));
1996 PyTuple_SetItem(elt3,1,elt4);
1997 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1998 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1999 PyList_SetItem(elt2,j,elt3);
2001 PyTuple_SetItem(elt,1,elt2);
2002 PyList_SetItem(ret2,i,elt);
2007 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2009 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2010 std::size_t sz=ret.size();
2011 PyObject *retPy=PyList_New(sz);
2012 for(std::size_t i=0;i<sz;i++)
2013 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2017 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2019 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2020 std::size_t sz=ret.size();
2021 PyObject *retPy=PyList_New(sz);
2022 for(std::size_t i=0;i<sz;i++)
2023 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2027 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2029 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2030 std::size_t sz=ret.size();
2031 PyObject *retPy=PyList_New(sz);
2032 for(std::size_t i=0;i<sz;i++)
2033 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2037 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2039 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2040 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2041 return self->extractPart(extractDefCpp,mm);
2046 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2049 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2050 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2051 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2052 static MEDFileField1TS *New();
2053 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2054 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2055 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2056 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2057 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2058 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2059 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2061 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2062 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2063 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2064 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2067 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2069 return MEDFileField1TS::New(fileName,loadAll);
2072 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2074 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2077 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2079 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2084 return MEDFileField1TS::New();
2087 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2089 const DataArrayDouble *arr=0;
2091 arr=field->getArray();
2092 self->copyTinyInfoFrom(field,arr);
2095 std::string __str__() const throw(INTERP_KERNEL::Exception)
2097 return self->simpleRepr();
2100 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2102 DataArrayInt *ret1=0;
2103 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2104 PyObject *ret=PyTuple_New(2);
2105 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2106 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2110 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2112 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2113 std::vector< std::vector<TypeOfField> > typesF;
2114 std::vector< std::vector<std::string> > pfls;
2115 std::vector< std::vector<std::string> > locs;
2116 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2118 PyObject *ret2=PyList_New(sz);
2119 for(int i=0;i<sz;i++)
2121 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2122 const std::vector<TypeOfField>& typesFI=typesF[i];
2123 const std::vector<std::string>& pflsI=pfls[i];
2124 const std::vector<std::string>& locsI=locs[i];
2125 PyObject *elt=PyTuple_New(2);
2126 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2127 int sz2=ret[i].size();
2128 PyObject *elt2=PyList_New(sz2);
2129 for(int j=0;j<sz2;j++)
2131 PyObject *elt3=PyTuple_New(4);
2132 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2133 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2134 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2135 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2136 PyList_SetItem(elt2,j,elt3);
2138 PyTuple_SetItem(elt,1,elt2);
2139 PyList_SetItem(ret2,i,elt);
2144 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2146 DataArrayDouble *ret=self->getUndergroundDataArray();
2152 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2154 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2155 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2158 PyObject *ret=PyTuple_New(2);
2159 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2160 std::size_t sz=elt1Cpp.size();
2161 PyObject *elt=PyList_New(sz);
2162 for(std::size_t i=0;i<sz;i++)
2164 PyObject *elt1=PyTuple_New(2);
2165 PyObject *elt2=PyTuple_New(2);
2166 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2167 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2168 PyObject *elt3=PyTuple_New(2);
2169 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2170 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2171 PyTuple_SetItem(elt1,0,elt2);
2172 PyTuple_SetItem(elt1,1,elt3);
2173 PyList_SetItem(elt,i,elt1);
2175 PyTuple_SetItem(ret,1,elt);
2181 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2184 static MEDFileIntField1TS *New();
2185 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2186 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2187 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2188 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2190 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2191 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2192 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2193 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2194 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2195 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2196 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2197 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2200 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2202 return MEDFileIntField1TS::New();
2205 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2207 return MEDFileIntField1TS::New(fileName,loadAll);
2210 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2212 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2215 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2217 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2220 std::string __str__() const throw(INTERP_KERNEL::Exception)
2222 return self->simpleRepr();
2225 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2227 DataArrayInt *ret1=0;
2228 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2229 PyObject *ret=PyTuple_New(2);
2230 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2231 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2235 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2237 DataArrayInt *ret=self->getUndergroundDataArray();
2245 class MEDFileAnyTypeFieldMultiTSIterator
2250 PyObject *next() throw(INTERP_KERNEL::Exception)
2252 MEDFileAnyTypeField1TS *ret=self->nextt();
2254 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2257 PyErr_SetString(PyExc_StopIteration,"No more data.");
2264 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2267 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2268 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2269 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2270 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2271 std::string getName() const throw(INTERP_KERNEL::Exception);
2272 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2273 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2274 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2275 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2276 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2277 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2278 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2279 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2280 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2281 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2282 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2283 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2284 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2285 void loadArrays() throw(INTERP_KERNEL::Exception);
2286 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2287 void unloadArrays() throw(INTERP_KERNEL::Exception);
2288 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2290 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2291 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2292 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2293 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2294 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2295 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2298 int __len__() const throw(INTERP_KERNEL::Exception)
2300 return self->getNumberOfTS();
2303 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2305 if(elt0 && PyInt_Check(elt0))
2307 int pos=PyInt_AS_LONG(elt0);
2310 else if(elt0 && PyTuple_Check(elt0))
2312 if(PyTuple_Size(elt0)==2)
2314 PyObject *o0=PyTuple_GetItem(elt0,0);
2315 PyObject *o1=PyTuple_GetItem(elt0,1);
2316 if(PyInt_Check(o0) && PyInt_Check(o1))
2318 int iter=PyInt_AS_LONG(o0);
2319 int order=PyInt_AS_LONG(o1);
2320 return self->getPosOfTimeStep(iter,order);
2323 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 !");
2326 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 !");
2328 else if(elt0 && PyFloat_Check(elt0))
2330 double val=PyFloat_AS_DOUBLE(elt0);
2331 return self->getPosGivenTime(val);
2334 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2337 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2339 std::vector< std::pair<int,int> > res(self->getIterations());
2340 return convertVecPairIntToPy(res);
2343 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2345 std::vector<double> ret1;
2346 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2347 std::size_t sz=ret.size();
2348 PyObject *ret2=PyList_New(sz);
2349 for(std::size_t i=0;i<sz;i++)
2351 PyObject *elt=PyTuple_New(3);
2352 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2353 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2354 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2355 PyList_SetItem(ret2,i,elt);
2360 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2362 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2363 PyObject *ret2=PyList_New(ret.size());
2364 for(int i=0;i<(int)ret.size();i++)
2366 const std::vector<TypeOfField>& rett=ret[i];
2367 PyObject *ret3=PyList_New(rett.size());
2368 for(int j=0;j<(int)rett.size();j++)
2369 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2370 PyList_SetItem(ret2,i,ret3);
2375 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2377 std::vector<int> ret1;
2378 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2379 PyObject *elt=PyTuple_New(2);
2380 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2381 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2385 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2387 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2388 std::vector< std::vector<TypeOfField> > typesF;
2389 std::vector< std::vector<std::string> > pfls;
2390 std::vector< std::vector<std::string> > locs;
2391 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2393 PyObject *ret2=PyList_New(sz);
2394 for(int i=0;i<sz;i++)
2396 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2397 const std::vector<TypeOfField>& typesFI=typesF[i];
2398 const std::vector<std::string>& pflsI=pfls[i];
2399 const std::vector<std::string>& locsI=locs[i];
2400 PyObject *elt=PyTuple_New(2);
2401 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2402 int sz2=ret[i].size();
2403 PyObject *elt2=PyList_New(sz2);
2404 for(int j=0;j<sz2;j++)
2406 PyObject *elt3=PyTuple_New(4);
2407 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2408 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));
2409 PyTuple_SetItem(elt3,1,elt4);
2410 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2411 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2412 PyList_SetItem(elt2,j,elt3);
2414 PyTuple_SetItem(elt,1,elt2);
2415 PyList_SetItem(ret2,i,elt);
2420 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2422 if(PyList_Check(elts))
2424 int sz=PyList_Size(elts);
2425 std::vector<int> ret(sz);
2426 for(int i=0;i<sz;i++)
2428 PyObject *elt=PyList_GetItem(elts,i);
2429 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2435 std::vector<int> ret(1);
2436 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2441 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2443 if(PySlice_Check(elts))
2445 Py_ssize_t strt=2,stp=2,step=2;
2446 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2447 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2448 self->eraseTimeStepIds2(strt,stp,step);
2452 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2453 if(!idsToRemove.empty())
2454 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2458 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2462 std::vector<int> pos2;
2463 DataArrayInt *pos3=0;
2464 DataArrayIntTuple *pos4=0;
2465 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2470 self->eraseTimeStepIds(&pos1,&pos1+1);
2477 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2482 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2486 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2490 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2492 return self->iterator();
2495 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2497 if(elt0 && PyList_Check(elt0))
2499 int sz=PyList_Size(elt0);
2500 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2501 int *pt=da->getPointer();
2502 for(int i=0;i<sz;i++,pt++)
2504 PyObject *elt1=PyList_GetItem(elt0,i);
2505 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2507 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2509 else if(elt0 && PySlice_Check(elt0))
2511 Py_ssize_t strt=2,stp=2,step=2;
2512 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2513 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2514 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2517 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2520 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2522 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2523 return self->changeMeshNames(modifTab);
2526 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2528 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2529 std::size_t sz=ret.size();
2530 PyObject *retPy=PyList_New(sz);
2531 for(std::size_t i=0;i<sz;i++)
2532 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2536 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2538 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2539 std::size_t sz=ret.size();
2540 PyObject *retPy=PyList_New(sz);
2541 for(std::size_t i=0;i<sz;i++)
2542 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2546 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2548 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2549 std::size_t sz=ret.size();
2550 PyObject *retPy=PyList_New(sz);
2551 for(std::size_t i=0;i<sz;i++)
2552 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2556 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2559 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2560 if(SWIG_IsOK(status))
2562 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2566 std::vector<MEDFileAnyTypeField1TS *> tmp;
2567 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2568 self->pushBackTimeSteps(tmp);
2572 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2574 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2575 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2576 return self->extractPart(extractDefCpp,mm);
2579 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2581 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2582 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2583 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2584 std::size_t sz=ret.size();
2585 PyObject *retPy=PyList_New(sz);
2586 for(std::size_t i=0;i<sz;i++)
2588 std::size_t sz2=ret[i].size();
2589 PyObject *ret1Py=PyList_New(sz2);
2590 for(std::size_t j=0;j<sz2;j++)
2592 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2595 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2597 PyList_SetItem(retPy,i,ret1Py);
2602 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2604 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2605 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2606 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2607 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2608 if(ret2.size()!=ret.size())
2610 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2611 throw INTERP_KERNEL::Exception(oss.str().c_str());
2613 std::size_t sz=ret.size();
2614 PyObject *retPy=PyList_New(sz);
2615 for(std::size_t i=0;i<sz;i++)
2617 std::size_t sz2=ret[i].size();
2618 PyObject *ret0Py=PyTuple_New(2);
2619 PyObject *ret1Py=PyList_New(sz2);
2620 for(std::size_t j=0;j<sz2;j++)
2622 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2625 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2627 PyTuple_SetItem(ret0Py,0,ret1Py);
2628 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2629 PyList_SetItem(retPy,i,ret0Py);
2636 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2639 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2640 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2641 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2643 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2644 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2645 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2646 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2647 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2648 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2650 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2651 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2652 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2655 MEDFileFieldMultiTS()
2657 return MEDFileFieldMultiTS::New();
2660 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2662 return MEDFileFieldMultiTS::New(fileName,loadAll);
2665 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2667 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2670 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2672 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2673 std::size_t sz(tmp.size());
2674 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2675 for(std::size_t i=0;i<sz;i++)
2677 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2678 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2680 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2683 std::string __str__() const throw(INTERP_KERNEL::Exception)
2685 return self->simpleRepr();
2688 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2690 DataArrayInt *ret1=0;
2691 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2692 PyObject *ret=PyTuple_New(2);
2693 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2694 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2698 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2700 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2701 std::vector< std::vector<TypeOfField> > typesF;
2702 std::vector< std::vector<std::string> > pfls;
2703 std::vector< std::vector<std::string> > locs;
2704 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2706 PyObject *ret2=PyList_New(sz);
2707 for(int i=0;i<sz;i++)
2709 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2710 const std::vector<TypeOfField>& typesFI=typesF[i];
2711 const std::vector<std::string>& pflsI=pfls[i];
2712 const std::vector<std::string>& locsI=locs[i];
2713 PyObject *elt=PyTuple_New(2);
2714 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2715 int sz2=ret[i].size();
2716 PyObject *elt2=PyList_New(sz2);
2717 for(int j=0;j<sz2;j++)
2719 PyObject *elt3=PyTuple_New(4);
2720 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2721 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2722 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2723 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2724 PyList_SetItem(elt2,j,elt3);
2726 PyTuple_SetItem(elt,1,elt2);
2727 PyList_SetItem(ret2,i,elt);
2731 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2733 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2739 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2741 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2742 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2745 PyObject *ret=PyTuple_New(2);
2746 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2747 std::size_t sz=elt1Cpp.size();
2748 PyObject *elt=PyList_New(sz);
2749 for(std::size_t i=0;i<sz;i++)
2751 PyObject *elt1=PyTuple_New(2);
2752 PyObject *elt2=PyTuple_New(2);
2753 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2754 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2755 PyObject *elt3=PyTuple_New(2);
2756 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2757 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2758 PyTuple_SetItem(elt1,0,elt2);
2759 PyTuple_SetItem(elt1,1,elt3);
2760 PyList_SetItem(elt,i,elt1);
2762 PyTuple_SetItem(ret,1,elt);
2768 class MEDFileFieldsIterator
2773 PyObject *next() throw(INTERP_KERNEL::Exception)
2775 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2777 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2780 PyErr_SetString(PyExc_StopIteration,"No more data.");
2787 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2790 static MEDFileIntFieldMultiTS *New();
2791 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2792 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2794 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2795 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2796 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2797 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2798 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2799 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2800 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2801 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2802 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2805 MEDFileIntFieldMultiTS()
2807 return MEDFileIntFieldMultiTS::New();
2810 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2812 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2815 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2817 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2820 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2822 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2823 std::size_t sz(tmp.size());
2824 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2825 for(std::size_t i=0;i<sz;i++)
2827 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2828 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2830 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2833 std::string __str__() const throw(INTERP_KERNEL::Exception)
2835 return self->simpleRepr();
2838 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2840 DataArrayInt *ret1=0;
2841 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2842 PyObject *ret=PyTuple_New(2);
2843 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2844 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2848 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2850 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2858 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2861 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2862 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2863 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2864 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
2865 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2866 void loadArrays() throw(INTERP_KERNEL::Exception);
2867 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2868 void unloadArrays() throw(INTERP_KERNEL::Exception);
2869 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2870 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2871 int getNumberOfFields() const;
2872 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2873 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2875 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2876 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2877 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2878 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2879 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2880 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2881 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2882 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2883 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2888 return MEDFileFields::New();
2891 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2893 return MEDFileFields::New(fileName,loadAll);
2896 std::string __str__() const throw(INTERP_KERNEL::Exception)
2898 return self->simpleRepr();
2901 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2903 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2904 std::size_t sz(tmp.size());
2905 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2906 for(std::size_t i=0;i<sz;i++)
2908 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2909 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2911 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2914 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2917 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2918 PyObject *ret=PyTuple_New(2);
2919 PyObject *ret_0=PyList_New(ret0.size());
2921 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2923 PyObject *elt=PyTuple_New(2);
2924 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2925 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2926 PyList_SetItem(ret_0,rk,elt);
2928 PyTuple_SetItem(ret,0,ret_0);
2929 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2930 PyTuple_SetItem(ret,1,ret_1);
2934 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2936 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2937 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2940 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2942 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2943 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2946 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2948 if(obj && PyList_Check(obj))
2950 int sz=PyList_Size(obj);
2951 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2952 int *pt=da->getPointer();
2953 for(int i=0;i<sz;i++,pt++)
2955 PyObject *elt1=PyList_GetItem(obj,i);
2956 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2958 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
2961 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2964 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2966 self->setFieldAtPos(obj,field);
2970 int __len__() const throw(INTERP_KERNEL::Exception)
2972 return self->getNumberOfFields();
2975 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2977 return self->iterator();
2980 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2982 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2983 return self->changeMeshNames(modifTab);
2986 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2988 if(elt0 && PyInt_Check(elt0))
2990 return PyInt_AS_LONG(elt0);
2992 else if(elt0 && PyString_Check(elt0))
2993 return self->getPosFromFieldName(PyString_AsString(elt0));
2995 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2998 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3000 if(PyList_Check(elts))
3002 int sz=PyList_Size(elts);
3003 std::vector<int> ret(sz);
3004 for(int i=0;i<sz;i++)
3006 PyObject *elt=PyList_GetItem(elts,i);
3007 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3013 std::vector<int> ret(1);
3014 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3019 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3021 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3022 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3023 self->pushFields(tmp);
3026 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3028 if(elts && PySlice_Check(elts))
3030 Py_ssize_t strt=2,stp=2,step=2;
3031 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3032 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3033 self->destroyFieldsAtPos2(strt,stp,step);
3037 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3038 if(!idsToRemove.empty())
3039 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3043 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3045 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3046 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3047 return self->extractPart(extractDefCpp,mm);
3052 class MEDFileParameter1TS : public RefCountObject
3055 void setIteration(int it);
3056 int getIteration() const;
3057 void setOrder(int order);
3058 int getOrder() const;
3059 void setTimeValue(double time);
3060 void setTime(int dt, int it, double time);
3061 double getTime(int& dt, int& it);
3062 double getTimeValue() const;
3065 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3068 void setValue(double val) throw(INTERP_KERNEL::Exception);
3069 double getValue() const throw(INTERP_KERNEL::Exception);
3070 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3073 std::string __str__() const throw(INTERP_KERNEL::Exception)
3075 return self->simpleRepr();
3080 class MEDFileParameterTinyInfo : public MEDFileWritable
3083 void setDescription(const std::string& name);
3084 std::string getDescription() const;
3085 void setTimeUnit(const std::string& unit);
3086 std::string getTimeUnit() const;
3089 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3092 static MEDFileParameterDouble1TS *New();
3093 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3094 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3095 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3096 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3097 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3098 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3099 std::string getName() const throw(INTERP_KERNEL::Exception);
3100 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3103 MEDFileParameterDouble1TS()
3105 return MEDFileParameterDouble1TS::New();
3108 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3110 return MEDFileParameterDouble1TS::New(fileName);
3113 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3115 return MEDFileParameterDouble1TS::New(fileName,paramName);
3118 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3120 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3123 std::string __str__() const throw(INTERP_KERNEL::Exception)
3125 return self->simpleRepr();
3128 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3131 bool ret0=self->isEqual(other,eps,what);
3132 PyObject *res=PyList_New(2);
3133 PyObject *ret0Py=ret0?Py_True:Py_False;
3135 PyList_SetItem(res,0,ret0Py);
3136 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3142 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3145 static MEDFileParameterMultiTS *New();
3146 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3147 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3148 std::string getName() const;
3149 void setName(const std::string& name);
3150 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3151 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3152 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3153 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3154 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3155 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3156 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3157 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3160 MEDFileParameterMultiTS()
3162 return MEDFileParameterMultiTS::New();
3165 MEDFileParameterMultiTS(const std::string& fileName)
3167 return MEDFileParameterMultiTS::New(fileName);
3170 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3172 return MEDFileParameterMultiTS::New(fileName,paramName);
3175 std::string __str__() const throw(INTERP_KERNEL::Exception)
3177 return self->simpleRepr();
3180 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3183 bool ret0=self->isEqual(other,eps,what);
3184 PyObject *res=PyList_New(2);
3185 PyObject *ret0Py=ret0?Py_True:Py_False;
3187 PyList_SetItem(res,0,ret0Py);
3188 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3192 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3196 std::vector<int> pos2;
3197 DataArrayInt *pos3=0;
3198 DataArrayIntTuple *pos4=0;
3199 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3204 self->eraseTimeStepIds(&pos1,&pos1+1);
3211 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3216 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3220 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3224 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3226 if(elt0 && PyInt_Check(elt0))
3228 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3231 else if(elt0 && PyTuple_Check(elt0))
3233 if(PyTuple_Size(elt0)==2)
3235 PyObject *o0=PyTuple_GetItem(elt0,0);
3236 PyObject *o1=PyTuple_GetItem(elt0,1);
3237 if(PyInt_Check(o0) && PyInt_Check(o1))
3239 int iter=PyInt_AS_LONG(o0);
3240 int order=PyInt_AS_LONG(o1);
3241 return self->getPosOfTimeStep(iter,order);
3244 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 !");
3247 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 !");
3249 else if(elt0 && PyFloat_Check(elt0))
3251 double val=PyFloat_AS_DOUBLE(elt0);
3252 return self->getPosGivenTime(val);
3255 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3258 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3260 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3266 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3268 if(PyList_Check(elts))
3270 int sz=PyList_Size(elts);
3271 std::vector<int> ret(sz);
3272 for(int i=0;i<sz;i++)
3274 PyObject *elt=PyList_GetItem(elts,i);
3275 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3281 std::vector<int> ret(1);
3282 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3287 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3289 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3290 if(!idsToRemove.empty())
3291 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3294 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3296 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3302 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3304 std::vector< std::pair<int,int> > res=self->getIterations();
3305 PyObject *ret=PyList_New(res.size());
3307 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3309 PyObject *elt=PyTuple_New(2);
3310 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3311 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3312 PyList_SetItem(ret,rk,elt);
3317 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3319 std::vector<double> res2;
3320 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3321 PyObject *ret=PyList_New(res.size());
3323 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3325 PyObject *elt=PyTuple_New(3);
3326 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3327 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3328 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3329 PyList_SetItem(ret,rk,elt);
3336 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3339 static MEDFileParameters *New();
3340 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3341 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3342 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3343 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3344 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3345 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3346 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3347 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3348 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3349 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3350 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3355 return MEDFileParameters::New();
3358 MEDFileParameters(const std::string& fileName)
3360 return MEDFileParameters::New(fileName);
3363 std::string __str__() const throw(INTERP_KERNEL::Exception)
3365 return self->simpleRepr();
3368 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3370 if(PyInt_Check(obj))
3372 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3377 else if(PyString_Check(obj))
3379 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3385 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3388 int __len__() const throw(INTERP_KERNEL::Exception)
3390 return self->getNumberOfParams();
3393 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3395 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3401 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3403 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3409 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3412 bool ret0=self->isEqual(other,eps,what);
3413 PyObject *res=PyList_New(2);
3414 PyObject *ret0Py=ret0?Py_True:Py_False;
3416 PyList_SetItem(res,0,ret0Py);
3417 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3423 class MEDFileData : public RefCountObject, public MEDFileWritable
3426 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3427 static MEDFileData *New();
3428 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3429 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3430 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3431 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3432 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3433 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3434 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3436 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3437 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3439 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3442 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3444 return MEDFileData::New(fileName);
3449 return MEDFileData::New();
3452 std::string __str__() const throw(INTERP_KERNEL::Exception)
3454 return self->simpleRepr();
3457 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3459 MEDFileMeshes *ret=self->getMeshes();
3465 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3467 MEDFileParameters *ret=self->getParams();
3473 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3475 MEDFileFields *ret=self->getFields();
3481 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3483 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3484 return self->changeMeshNames(modifTab);
3487 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3489 std::vector<const MEDFileData *> mfdsCpp;
3490 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3491 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3497 class SauvReader : public RefCountObject
3500 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3501 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3504 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3506 return SauvReader::New(fileName);
3511 class SauvWriter : public RefCountObject
3514 static SauvWriter * New();
3515 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3516 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3517 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3518 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3521 SauvWriter() throw(INTERP_KERNEL::Exception)
3523 return SauvWriter::New();
3530 class MEDFileMeshStruct;
3532 class MEDFileField1TSStructItem
3535 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3538 class MEDFileMeshStruct : public RefCountObject
3541 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3543 ~MEDFileMeshStruct();
3546 class MEDMeshMultiLev : public RefCountObject
3549 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3550 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3551 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3557 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3559 DataArrayInt *famIds(0);
3560 bool isWithoutCopy(false);
3561 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3562 PyObject *ret=PyTuple_New(2);
3563 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3565 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3566 PyTuple_SetItem(ret,1,ret1Py);
3570 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3572 DataArrayInt *numIds(0);
3573 bool isWithoutCopy(false);
3574 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3575 PyObject *ret=PyTuple_New(2);
3576 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3578 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3579 PyTuple_SetItem(ret,1,ret1Py);
3583 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3585 DataArrayInt *famIds(0);
3586 bool isWithoutCopy(false);
3587 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3588 PyObject *ret=PyTuple_New(2);
3589 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3591 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3592 PyTuple_SetItem(ret,1,ret1Py);
3596 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3598 DataArrayInt *numIds(0);
3599 bool isWithoutCopy(false);
3600 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3601 PyObject *ret=PyTuple_New(2);
3602 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3604 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3605 PyTuple_SetItem(ret,1,ret1Py);
3609 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3611 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3612 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3613 PyObject *res(PyList_New(result.size()));
3614 for(int i=0;iL!=result.end(); i++, iL++)
3615 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3621 class MEDUMeshMultiLev : public MEDMeshMultiLev
3624 ~MEDUMeshMultiLev();
3628 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3630 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3631 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3632 PyObject *ret0Py=ncc?Py_True:Py_False;
3634 PyObject *ret=PyTuple_New(7);
3635 PyTuple_SetItem(ret,0,ret0Py);
3636 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3637 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3638 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3639 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3640 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3641 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3647 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3650 ~MEDStructuredMeshMultiLev();
3653 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3656 ~MEDCMeshMultiLev();
3660 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3663 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3664 std::size_t sz(objs.size());
3665 PyObject *ret(PyTuple_New(2));
3666 PyObject *ret0=PyList_New(sz);
3667 for(std::size_t i=0;i<sz;i++)
3668 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3669 PyTuple_SetItem(ret,0,ret0);
3670 PyObject *ret1Py(isInternal?Py_True:Py_False);
3672 PyTuple_SetItem(ret,1,ret1Py);
3678 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3681 ~MEDCurveLinearMeshMultiLev();
3685 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3687 DataArrayDouble *ret0(0);
3688 std::vector<int> ret1;
3690 self->buildVTUArrays(ret0,ret1,ret2);
3691 std::size_t sz(ret1.size());
3692 PyObject *ret=PyTuple_New(3);
3693 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3694 PyObject *ret1Py=PyList_New(sz);
3695 for(std::size_t i=0;i<sz;i++)
3696 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3697 PyTuple_SetItem(ret,1,ret1Py);
3698 PyObject *ret2Py(ret2?Py_True:Py_False);
3700 PyTuple_SetItem(ret,2,ret2Py);
3706 class MEDFileFastCellSupportComparator : public RefCountObject
3709 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3710 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3711 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3712 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3714 ~MEDFileFastCellSupportComparator();
3718 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3720 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3721 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3722 PyObject *res(PyList_New(result.size()));
3723 for(int i=0;iL!=result.end(); i++, iL++)
3724 PyList_SetItem(res,i,PyInt_FromLong(*iL));