1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
33 #include "MEDLoader.hxx"
34 #include "MEDFileJoint.hxx"
35 #include "MEDFileMesh.hxx"
36 #include "MEDFileField.hxx"
37 #include "MEDFileParameter.hxx"
38 #include "MEDFileData.hxx"
39 #include "MEDFileEquivalence.hxx"
40 #include "MEDFileMeshReadSelector.hxx"
41 #include "MEDFileFieldOverView.hxx"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
46 using namespace MEDCoupling;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) MEDCoupling::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) MEDCoupling::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) MEDCoupling::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject ReadUMeshFromFamiliesSwig;
79 %newobject ReadUMeshFromGroupsSwig;
80 %newobject MEDCoupling::ReadUMeshFromFile;
81 %newobject MEDCoupling::ReadMeshFromFile;
82 %newobject MEDCoupling::ReadField;
83 %newobject MEDCoupling::ReadFieldCell;
84 %newobject MEDCoupling::ReadFieldNode;
85 %newobject MEDCoupling::ReadFieldGauss;
86 %newobject MEDCoupling::ReadFieldGaussNE;
87 %newobject MEDCoupling::MEDFileMesh::New;
88 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
89 %newobject MEDCoupling::MEDFileMesh::deepCopy;
90 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
91 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
92 %newobject MEDCoupling::MEDFileMesh::__getitem__;
93 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
94 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
95 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
97 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
101 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
104 %newobject MEDCoupling::MEDFileMesh::cartesianize;
105 %newobject MEDCoupling::MEDFileData::getJoints;
106 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject MEDCoupling::MEDFileUMesh::New;
108 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
109 %newobject MEDCoupling::MEDFileUMesh::getCoords;
110 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
111 %newobject MEDCoupling::MEDFileUMesh::getGroup;
112 %newobject MEDCoupling::MEDFileUMesh::getGroups;
113 %newobject MEDCoupling::MEDFileUMesh::getFamily;
114 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
115 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
116 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
120 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
121 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
123 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
124 %newobject MEDCoupling::MEDFileUMesh::extractPart;
125 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
126 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
127 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
128 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
129 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
130 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
131 %newobject MEDCoupling::MEDFileCMesh::New;
132 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
133 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
134 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
136 %newobject MEDCoupling::MEDFileMeshes::New;
137 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
138 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
139 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
140 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
141 %newobject MEDCoupling::MEDFileMeshes::__iter__;
143 %newobject MEDCoupling::MEDFileFields::New;
144 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
145 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
146 %newobject MEDCoupling::MEDFileFields::deepCopy;
147 %newobject MEDCoupling::MEDFileFields::shallowCpy;
148 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
149 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
150 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
151 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
152 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
153 %newobject MEDCoupling::MEDFileFields::__iter__;
154 %newobject MEDCoupling::MEDFileFields::extractPart;
156 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
157 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
158 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
159 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
160 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
161 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
162 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
163 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
164 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
165 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
166 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
167 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
168 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
169 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
170 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
171 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
172 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
173 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
174 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
175 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
176 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
177 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
178 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
179 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
180 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
181 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
182 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
183 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
185 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
186 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
187 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
188 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
189 %newobject MEDCoupling::MEDFileField1TS::New;
190 %newobject MEDCoupling::MEDFileField1TS::field;
191 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
192 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
193 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
194 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
195 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
196 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
198 %newobject MEDCoupling::MEDFileIntField1TS::New;
199 %newobject MEDCoupling::MEDFileIntField1TS::field;
200 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
201 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
202 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
203 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
204 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
205 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
207 %newobject MEDCoupling::MEDFileData::New;
208 %newobject MEDCoupling::MEDFileData::deepCopy;
209 %newobject MEDCoupling::MEDFileData::getMeshes;
210 %newobject MEDCoupling::MEDFileData::getFields;
211 %newobject MEDCoupling::MEDFileData::getParams;
212 %newobject MEDCoupling::MEDFileData::Aggregate;
214 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
215 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
216 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
217 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
218 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
219 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
220 %newobject MEDCoupling::MEDFileParameters::New;
221 %newobject MEDCoupling::MEDFileParameters::deepCopy;
222 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
223 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
224 %newobject MEDCoupling::MEDFileParameters::__getitem__;
226 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
227 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
228 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
229 %newobject MEDCoupling::MEDFileJointOneStep::New;
230 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
231 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
232 %newobject MEDCoupling::MEDFileJoint::New;
233 %newobject MEDCoupling::MEDFileJoint::deepCopy;
234 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
235 %newobject MEDCoupling::MEDFileJoints::New;
236 %newobject MEDCoupling::MEDFileJoints::deepCopy;
237 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
238 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
239 %newobject MEDCoupling::MEDFileJoints::__getitem__;
240 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
241 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
242 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
243 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
244 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
245 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
246 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
247 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
248 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
250 %newobject MEDCoupling::SauvWriter::New;
251 %newobject MEDCoupling::SauvReader::New;
252 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
254 %newobject MEDCoupling::MEDFileMeshStruct::New;
255 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
256 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
257 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
258 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
259 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
261 %feature("unref") MEDFileMesh "$this->decrRef();"
262 %feature("unref") MEDFileUMesh "$this->decrRef();"
263 %feature("unref") MEDFileCMesh "$this->decrRef();"
264 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
265 %feature("unref") MEDFileMeshes "$this->decrRef();"
266 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
267 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
268 %feature("unref") MEDFileField1TS "$this->decrRef();"
269 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
270 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
271 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
272 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
273 %feature("unref") MEDFileFields "$this->decrRef();"
274 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
275 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
276 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
277 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
278 %feature("unref") MEDFileParameters "$this->decrRef();"
279 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
280 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
281 %feature("unref") MEDFileJoint "$this->decrRef();"
282 %feature("unref") MEDFileJoints "$this->decrRef();"
283 %feature("unref") MEDFileEquivalences "$this->decrRef();"
284 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
285 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
286 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
287 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
288 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
289 %feature("unref") MEDFileData "$this->decrRef();"
290 %feature("unref") SauvReader "$this->decrRef();"
291 %feature("unref") SauvWriter "$this->decrRef();"
292 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
293 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
294 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
295 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
296 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
297 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
299 namespace MEDCoupling
302 std::string MEDFileVersionStr();
303 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
304 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
305 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
306 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
307 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
308 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
309 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
310 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
311 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
312 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
313 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
314 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
315 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
316 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
317 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
318 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
319 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
320 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
321 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
322 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
323 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
324 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
325 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
326 MEDCoupling::MEDCouplingFieldDouble *ReadField(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
327 MEDCoupling::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
328 MEDCoupling::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
329 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
330 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
331 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
332 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
333 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
334 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
335 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
336 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
339 %rename (MEDFileVersion) MEDFileVersionSwig;
340 %rename (GetFieldIterations) GetFieldIterationsSwig;
341 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
342 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
343 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
344 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
345 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
346 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
347 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
348 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
349 %rename (WriteUMeshes) WriteUMeshesSwig;
350 %rename (GetTypesOfField) GetTypesOfFieldSwig;
351 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
352 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
356 PyObject *MEDFileVersionSwig()
358 int major,minor,release;
359 MEDCoupling::MEDFileVersion(major,minor,release);
360 PyObject *ret(PyTuple_New(3));
361 PyTuple_SetItem(ret,0,SWIG_From_int(major));
362 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
363 PyTuple_SetItem(ret,2,SWIG_From_int(release));
367 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
369 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
370 PyObject *ret=PyList_New(res.size());
372 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
374 PyObject *elt=PyTuple_New(2);
375 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
376 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
377 PyList_SetItem(ret,rk,elt);
382 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
384 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
385 PyObject *ret=PyList_New(res.size());
387 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
389 PyObject *elt=PyTuple_New(3);
390 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
391 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
392 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
393 PyList_SetItem(ret,rk,elt);
398 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
400 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
401 PyObject *ret=PyList_New(res.size());
403 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
405 PyObject *elt=PyTuple_New(2);
406 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
407 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
408 PyList_SetItem(ret,rk,elt);
413 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
415 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
416 PyObject *ret=PyList_New(res.size());
418 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
420 PyObject *elt=PyTuple_New(2);
421 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
422 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
423 PyList_SetItem(ret,rk,elt);
428 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
430 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
431 PyObject *ret=PyList_New(res.size());
433 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
435 PyObject *elt=PyTuple_New(2);
436 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
437 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
438 PyList_SetItem(ret,rk,elt);
443 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
445 int meshDim,spaceDim,numberOfNodes;
446 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
447 PyObject *ret=PyTuple_New(4);
448 PyObject *elt0=PyList_New(res.size());
450 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
452 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
454 PyObject *elt1=PyList_New(obj2.size());
455 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
457 PyObject *elt2=PyTuple_New(2);
458 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
459 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
460 PyList_SetItem(elt1,j,elt2);
462 PyList_SetItem(elt0,i,elt1);
464 PyTuple_SetItem(ret,0,elt0);
465 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
466 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
467 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
471 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
472 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
474 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
475 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
476 return convertFieldDoubleVecToPy(res);
479 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
481 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
482 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
483 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
486 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
488 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
489 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
490 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
493 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
495 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
496 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
497 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
500 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
502 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
504 PyObject *ret=PyList_New(size);
505 for(int i=0;i<size;i++)
506 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
510 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
512 std::vector<std::string> grps;
513 converPyListToVecString(li,grps);
514 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
517 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
519 std::vector<std::string> fams;
520 converPyListToVecString(li,fams);
521 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
525 namespace MEDCoupling
527 class MEDFileWritable
530 void copyOptionsFrom(const MEDFileWritable& other) const;
531 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
532 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
533 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
534 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
537 class MEDFileWritableStandAlone : public MEDFileWritable
540 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
541 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
544 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
546 MCAuto<DataArrayByte> ret(self->serialize());
552 class MEDFileMeshReadSelector
555 MEDFileMeshReadSelector();
556 MEDFileMeshReadSelector(unsigned int code);
557 unsigned int getCode() const;
558 void setCode(unsigned int newCode);
559 bool isCellFamilyFieldReading() const;
560 bool isNodeFamilyFieldReading() const;
561 bool isCellNameFieldReading() const;
562 bool isNodeNameFieldReading() const;
563 bool isCellNumFieldReading() const;
564 bool isNodeNumFieldReading() const;
565 void setCellFamilyFieldReading(bool b);
566 void setNodeFamilyFieldReading(bool b);
567 void setCellNameFieldReading(bool b);
568 void setNodeNameFieldReading(bool b);
569 void setCellNumFieldReading(bool b);
570 void setNodeNumFieldReading(bool b);
573 std::string __str__() const throw(INTERP_KERNEL::Exception)
575 std::ostringstream oss;
580 std::string __repr__() const throw(INTERP_KERNEL::Exception)
582 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
588 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
591 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
592 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
593 throw(INTERP_KERNEL::Exception);
594 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
595 INTERP_KERNEL::NormalizedCellType loc_geo_type,
596 INTERP_KERNEL::NormalizedCellType rem_geo_type)
597 throw(INTERP_KERNEL::Exception);
598 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
599 MEDFileJointCorrespondence *deepCopy() const;
600 MEDFileJointCorrespondence *shallowCpy() const;
601 void setIsNodal(bool isNodal);
602 bool getIsNodal() const;
603 bool isEqual(const MEDFileJointCorrespondence *other) const;
604 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
605 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
606 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
607 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
608 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
609 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
610 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);
611 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
614 MEDFileJointCorrespondence()
616 return MEDFileJointCorrespondence::New();
618 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
620 return MEDFileJointCorrespondence::New(correspondence);
622 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
623 INTERP_KERNEL::NormalizedCellType loc_geo_type,
624 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
626 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
629 std::string __str__() const throw(INTERP_KERNEL::Exception)
631 return self->simpleRepr();
636 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
639 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
640 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
641 MEDFileJointOneStep *deepCopy() const;
642 MEDFileJointOneStep *shallowCpy() const;
643 bool isEqual(const MEDFileJointOneStep *other) const;
644 void setOrder(int order);
645 int getOrder() const;
646 void setIteration(int it);
647 int getIteration() const;
648 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
649 int getNumberOfCorrespondences() const;
650 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
651 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
652 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
655 MEDFileJointOneStep()
657 return MEDFileJointOneStep::New();
660 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
662 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
665 std::string __str__() const throw(INTERP_KERNEL::Exception)
667 return self->simpleRepr();
672 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
675 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
676 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
677 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
678 MEDFileJoint *deepCopy() const;
679 MEDFileJoint *shallowCpy() const;
680 bool isEqual(const MEDFileJoint *other) const;
681 void setLocalMeshName(const std::string& name);
682 std::string getLocalMeshName() const;
683 void setRemoteMeshName(const std::string& name);
684 std::string getRemoteMeshName() const;
685 void setDescription(const std::string& name);
686 std::string getDescription() const;
687 void setJointName(const std::string& name);
688 std::string getJointName() const;
689 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
690 void setDomainNumber(const int& number);
691 int getDomainNumber() const;
692 void pushStep(MEDFileJointOneStep* step);
693 int getNumberOfSteps() const;
694 MEDFileJointOneStep *getStepAtPos(int i) const;
695 std::string simpleRepr() const;
700 return MEDFileJoint::New();
703 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
705 return MEDFileJoint::New(fileName,mName,num);
708 std::string __str__() const throw(INTERP_KERNEL::Exception)
710 return self->simpleRepr();
715 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
718 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
719 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
720 MEDFileJoints *deepCopy() const;
721 std::string simpleRepr() const;
722 std::string getMeshName() const;
723 int getNumberOfJoints() const;
724 std::vector<std::string> getJointsNames() const;
725 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
726 void resize(int newSize) throw(INTERP_KERNEL::Exception);
727 void pushJoint(MEDFileJoint *joint);
728 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
729 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
734 return MEDFileJoints::New();
737 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
739 return MEDFileJoints::New(fileName,meshName);
742 std::string __str__() const throw(INTERP_KERNEL::Exception)
744 return self->simpleRepr();
747 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
751 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
756 else if(PyString_Check(obj))
758 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
764 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
767 int __len__() const throw(INTERP_KERNEL::Exception)
769 return self->getNumberOfJoints();
772 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
774 MEDFileJoint *ret=self->getJointAtPos(i);
780 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
782 MEDFileJoint *ret=self->getJointWithName(paramName);
790 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
793 MEDFileEquivalenceBase();
796 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
799 MEDFileEquivalenceData();
801 void setArray(DataArrayInt *data);
804 DataArrayInt *getArray()
806 DataArrayInt *ret(self->getArray());
807 if(ret) ret->incrRef();
813 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
816 MEDFileEquivalenceNode();
819 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
822 MEDFileEquivalenceCell();
825 std::size_t size() const;
826 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
827 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
830 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
832 DataArrayInt *ret(self->getArray(type));
833 if(ret) ret->incrRef();
837 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
839 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
840 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
841 PyObject *res=PyList_New(result.size());
842 for(int i=0;iL!=result.end(); i++, iL++)
843 PyList_SetItem(res,i,PyInt_FromLong(*iL));
849 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
852 MEDFileEquivalencePair();
854 std::string getName() const;
855 void setName(const std::string& name);
856 std::string getDescription() const;
857 void setDescription(const std::string& descr);
858 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
861 MEDFileEquivalenceCell *initCell()
863 MEDFileEquivalenceCell *ret(self->initCell());
864 if(ret) ret->incrRef();
868 MEDFileEquivalenceNode *initNode()
870 MEDFileEquivalenceNode *ret(self->initNode());
871 if(ret) ret->incrRef();
875 MEDFileEquivalenceCell *getCell()
877 MEDFileEquivalenceCell *ret(self->getCell());
878 if(ret) ret->incrRef();
882 MEDFileEquivalenceNode *getNode()
884 MEDFileEquivalenceNode *ret(self->getNode());
885 if(ret) ret->incrRef();
891 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
894 MEDFileEquivalences();
897 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
898 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
899 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
903 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
905 MEDFileEquivalencePair *ret(self->getEquivalence(i));
906 if(ret) ret->incrRef();
909 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
911 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
912 if(ret) ret->incrRef();
916 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
918 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
919 if(ret) ret->incrRef();
925 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
928 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
929 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
930 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
931 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
932 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
933 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
934 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
935 void setName(const std::string& name);
936 std::string getName();
937 std::string getUnivName() const;
938 bool getUnivNameWrStatus() const;
939 void setUnivNameWrStatus(bool newStatus);
940 void setDescription(const std::string& name);
941 std::string getDescription() const;
942 void setOrder(int order);
943 int getOrder() const;
944 void setIteration(int it);
946 void setTimeValue(double time);
947 void setTime(int dt, int it, double time);
948 double getTimeValue() const;
949 void setTimeUnit(const std::string& unit);
950 std::string getTimeUnit() const;
951 void setAxisType(MEDCouplingAxisType at);
952 MEDCouplingAxisType getAxisType() const;
953 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
954 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
955 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
956 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
957 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
958 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
959 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
960 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
961 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
962 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
963 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
964 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
965 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
966 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
968 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
969 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
970 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
971 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
972 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
973 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
974 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
975 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
976 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
977 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
978 void clearGrpMap() throw(INTERP_KERNEL::Exception);
979 void clearFamMap() throw(INTERP_KERNEL::Exception);
980 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
981 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
982 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
983 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
984 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
985 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
986 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
987 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
988 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
989 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
990 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
991 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
992 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
993 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
994 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
995 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
996 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
997 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
998 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
999 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1000 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1001 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1002 static std::string GetMagicFamilyStr();
1003 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1004 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1005 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1006 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1007 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1008 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1009 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1010 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1011 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1012 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1013 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1014 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1015 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1016 void setFamilyInfo(const std::map<std::string,int>& info);
1017 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1018 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1019 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1020 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1021 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1022 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1023 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1024 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1025 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1026 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1027 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1028 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1029 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1030 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1031 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1032 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1033 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1034 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1035 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1036 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1037 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1039 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1040 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1041 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1042 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1043 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1044 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1045 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1046 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1047 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1048 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1049 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1050 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1051 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1052 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1053 int getNumberOfJoints();
1054 MEDFileJoints *getJoints();
1055 void setJoints( MEDFileJoints* joints );
1056 void initializeEquivalences();
1057 void killEquivalences();
1060 std::string __str__() const throw(INTERP_KERNEL::Exception)
1062 return self->simpleRepr();
1065 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1067 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1070 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1073 double tmp0=self->getTime(tmp1,tmp2);
1074 PyObject *res = PyList_New(3);
1075 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1076 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1077 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1081 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1084 bool ret0=self->isEqual(other,eps,what);
1085 PyObject *res=PyList_New(2);
1086 PyObject *ret0Py=ret0?Py_True:Py_False;
1088 PyList_SetItem(res,0,ret0Py);
1089 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1093 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1095 std::vector<const DataArrayInt *> grps;
1096 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1097 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1100 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1103 bool ret0=self->areFamsEqual(other,what);
1104 PyObject *res=PyList_New(2);
1105 PyObject *ret0Py=ret0?Py_True:Py_False;
1107 PyList_SetItem(res,0,ret0Py);
1108 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1112 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1115 bool ret0=self->areGrpsEqual(other,what);
1116 PyObject *res=PyList_New(2);
1117 PyObject *ret0Py=ret0?Py_True:Py_False;
1119 PyList_SetItem(res,0,ret0Py);
1120 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1124 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1126 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1127 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1128 PyObject *res=PyList_New(result.size());
1129 for(int i=0;iL!=result.end(); i++, iL++)
1130 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1134 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1136 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1137 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1138 PyObject *res=PyList_New(result.size());
1139 for(int i=0;iL!=result.end(); i++, iL++)
1140 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1144 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1146 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1149 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1152 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1154 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1157 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1160 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1162 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1165 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1168 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1170 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1173 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1176 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1178 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1181 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1184 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1187 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1188 PyObject *ret=PyTuple_New(2);
1189 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1190 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1194 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1196 DataArrayInt *ret3=0;
1197 std::vector<int> ret1,ret2;
1198 bool ret0=self->unPolyze(ret1,ret2,ret3);
1199 PyObject *ret=PyTuple_New(4);
1200 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1202 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1203 for(int j=0;j<(int)ret1.size()/3;j++)
1205 PyObject *retLev2=PyList_New(3);
1206 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1207 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1208 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1209 PyList_SetItem(retLev1_0,j,retLev2);
1211 PyTuple_SetItem(ret,1,retLev1_0);
1213 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1214 for(int j=0;j<(int)ret2.size()/3;j++)
1216 PyObject *retLev2=PyList_New(3);
1217 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1218 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1219 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1220 PyList_SetItem(retLev1_1,j,retLev2);
1222 PyTuple_SetItem(ret,2,retLev1_1);
1224 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1228 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1230 MEDFileEquivalences *ret(self->getEquivalences());
1231 if(ret) ret->incrRef();
1237 class MEDFileUMesh : public MEDFileMesh
1240 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1241 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1242 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1243 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1244 static MEDFileUMesh *New();
1245 static const char *GetSpeStr4ExtMesh();
1247 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1248 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1249 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1250 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1251 void clearNodeAndCellNumbers();
1253 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1254 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1255 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1256 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1257 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1258 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1259 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1260 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1261 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1262 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1264 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1265 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1266 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1267 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1268 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1269 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1270 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1271 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1272 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1273 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1274 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1275 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1276 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1277 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1278 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1281 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1283 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1286 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1288 return MEDFileUMesh::New(fileName,mrs);
1291 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1293 return MEDFileUMesh::New(mem);
1296 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1298 return MEDFileUMesh::New(db);
1303 return MEDFileUMesh::New();
1307 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1309 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1312 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)
1314 std::vector<int> typesCpp1;
1315 convertPyToNewIntArr3(types,typesCpp1);
1316 std::size_t sz(typesCpp1.size());
1317 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1318 for(std::size_t ii=0;ii<sz;ii++)
1319 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1320 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1323 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1324 {// put an empty dict in input to say to __new__ to call __init__...
1325 PyObject *ret(PyTuple_New(1));
1326 PyObject *ret0(PyDict_New());
1327 PyTuple_SetItem(ret,0,ret0);
1331 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1333 std::vector<double> a0;
1334 std::vector<int> a1;
1335 std::vector<std::string> a2;
1336 std::vector< MCAuto<DataArrayInt> > a3;
1337 MCAuto<DataArrayDouble> a4;
1338 self->serialize(a0,a1,a2,a3,a4);
1339 PyObject *ret(PyTuple_New(5));
1340 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1341 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1343 PyObject *ret2(PyList_New(sz));
1344 for(int i=0;i<sz;i++)
1345 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1346 PyTuple_SetItem(ret,2,ret2);
1348 PyObject *ret3(PyList_New(sz));
1349 for(int i=0;i<sz;i++)
1351 DataArrayInt *elt(a3[i]);
1354 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1356 PyTuple_SetItem(ret,3,ret3);
1357 DataArrayDouble *ret4(a4);
1360 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1364 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1366 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1367 if(!PyTuple_Check(inp))
1368 throw INTERP_KERNEL::Exception(MSG);
1369 int sz(PyTuple_Size(inp));
1371 throw INTERP_KERNEL::Exception(MSG);
1372 std::vector<double> a0;
1373 std::vector<int> a1;
1374 std::vector<std::string> a2;
1375 std::vector< MCAuto<DataArrayInt> > a3;
1376 MCAuto<DataArrayDouble> a4;
1378 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1380 fillArrayWithPyListDbl3(a0py,tmp,a0);
1381 convertPyToNewIntArr3(a1py,a1);
1382 fillStringVector(a2py,a2);
1384 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1386 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1387 if(!SWIG_IsOK(status))
1388 throw INTERP_KERNEL::Exception(MSG);
1389 a4=reinterpret_cast<DataArrayDouble *>(argp);
1390 if((DataArrayDouble *)a4)
1393 std::vector< DataArrayInt * > a3Tmp;
1394 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1395 std::size_t sz(a3Tmp.size());
1397 for(std::size_t i=0;i<sz;i++)
1401 a3Tmp[i]->incrRef();
1403 self->unserialize(a0,a1,a2,a3,a4);
1407 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1410 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1411 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1414 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1417 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1420 self->setMeshAtLevel(meshDimRelToMax,m1);
1423 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1426 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1428 self->removeMeshAtLevel(meshDimRelToMax);
1431 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1433 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1435 DataArrayDouble *a,*a2;
1436 DataArrayDoubleTuple *aa,*aa2;
1437 std::vector<double> bb,bb2;
1439 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1440 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1441 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1445 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1447 std::vector<const MEDFileUMesh *> meshesCpp;
1448 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1449 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1453 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1455 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1456 return convertVecPairIntToPy(ret);
1459 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1461 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1462 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1463 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1466 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1468 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1469 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1470 return self->extractPart(extractDefCpp);
1473 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1475 std::vector<const MEDCouplingUMesh *> ms;
1476 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1477 self->setMeshes(ms,renum);
1480 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1482 std::vector<const MEDCouplingUMesh *> ms;
1483 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1484 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1487 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1489 std::vector<const MEDCouplingUMesh *> ms;
1490 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1491 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1494 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1496 DataArrayDouble *ret=self->getCoords();
1502 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1504 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1507 return const_cast<PartDefinition *>(ret);
1510 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1512 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1513 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1514 PyObject *ret=PyTuple_New(3);
1515 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1516 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1517 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1521 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1523 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1529 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1531 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1532 std::size_t sz(tmp.size());
1533 PyObject *ret=PyList_New(sz);
1534 for(std::size_t i=0;i<sz;i++)
1538 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1545 class MEDFileStructuredMesh : public MEDFileMesh
1550 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1552 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1560 class MEDFileCMesh : public MEDFileStructuredMesh
1563 static MEDFileCMesh *New();
1564 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1565 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1566 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1567 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1568 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1573 return MEDFileCMesh::New();
1576 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1578 return MEDFileCMesh::New(fileName,mrs);
1581 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1583 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1586 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1588 return MEDFileCMesh::New(db);
1591 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1593 const MEDCouplingCMesh *tmp=self->getMesh();
1596 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1601 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1604 static MEDFileCurveLinearMesh *New();
1605 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1606 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1607 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1608 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1611 MEDFileCurveLinearMesh()
1613 return MEDFileCurveLinearMesh::New();
1616 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1618 return MEDFileCurveLinearMesh::New(fileName,mrs);
1621 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1623 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1626 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1628 return MEDFileCurveLinearMesh::New(db);
1631 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1633 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1636 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1641 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1644 static MEDFileMeshMultiTS *New();
1645 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1646 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1647 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1648 std::string getName() const throw(INTERP_KERNEL::Exception);
1649 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1650 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1653 MEDFileMeshMultiTS()
1655 return MEDFileMeshMultiTS::New();
1658 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1660 return MEDFileMeshMultiTS::New(fileName);
1663 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1665 return MEDFileMeshMultiTS::New(fileName,mName);
1668 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1670 MEDFileMesh *ret=self->getOneTimeStep();
1678 class MEDFileMeshesIterator
1683 PyObject *next() throw(INTERP_KERNEL::Exception)
1685 MEDFileMesh *ret=self->nextt();
1689 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1693 PyErr_SetString(PyExc_StopIteration,"No more data.");
1700 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1703 static MEDFileMeshes *New();
1704 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1705 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1706 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1707 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1709 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1710 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1711 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1712 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1713 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1718 return MEDFileMeshes::New();
1721 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1723 return MEDFileMeshes::New(fileName);
1726 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1728 return MEDFileMeshes::New(db);
1731 std::string __str__() const throw(INTERP_KERNEL::Exception)
1733 return self->simpleRepr();
1736 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1738 if(PyInt_Check(obj))
1740 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1745 else if(PyString_Check(obj))
1747 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1753 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1756 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1758 self->setMeshAtPos(obj,mesh);
1762 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1764 return self->iterator();
1767 int __len__() const throw(INTERP_KERNEL::Exception)
1769 return self->getNumberOfMeshes();
1772 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1774 MEDFileMesh *ret=self->getMeshAtPos(i);
1779 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1781 MEDFileMesh *ret=self->getMeshWithName(mname);
1789 class MEDFileFieldLoc : public RefCountObject
1792 std::string getName() const;
1793 int getDimension() const;
1794 int getNumberOfGaussPoints() const;
1795 int getNumberOfPointsInCells() const;
1796 const std::vector<double>& getRefCoords() const;
1797 const std::vector<double>& getGaussCoords() const;
1798 const std::vector<double>& getGaussWeights() const;
1799 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1802 std::string __str__() const throw(INTERP_KERNEL::Exception)
1804 return self->repr();
1809 class MEDFileFieldGlobsReal
1812 void resetContent();
1813 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1814 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1815 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1816 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1817 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1818 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1819 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1820 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1821 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1822 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1823 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1824 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1825 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1826 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1827 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1828 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1829 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1830 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1831 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1832 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1833 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1834 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1835 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1836 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1837 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1838 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1841 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1843 const DataArrayInt *ret=self->getProfile(pflName);
1846 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1849 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1851 const DataArrayInt *ret=self->getProfileFromId(pflId);
1854 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1857 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1859 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1862 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1865 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1867 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1870 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1873 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1875 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1876 return convertVecPairVecStToPy(ret);
1879 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1881 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1882 return convertVecPairVecStToPy(ret);
1885 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1887 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1888 self->changePflsNames(v);
1891 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1893 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1894 self->changePflsRefsNamesGen(v);
1897 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1899 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1900 self->changePflsNamesInStruct(v);
1903 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1905 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1906 self->changeLocsNames(v);
1909 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1911 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1912 self->changeLocsRefsNamesGen(v);
1915 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1917 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1918 self->changeLocsNamesInStruct(v);
1921 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1923 std::ostringstream oss;
1924 self->simpleReprGlobs(oss);
1930 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
1933 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1934 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1935 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1936 void loadArrays() throw(INTERP_KERNEL::Exception);
1937 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1938 void unloadArrays() throw(INTERP_KERNEL::Exception);
1939 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1940 int getDimension() const throw(INTERP_KERNEL::Exception);
1941 int getIteration() const throw(INTERP_KERNEL::Exception);
1942 int getOrder() const throw(INTERP_KERNEL::Exception);
1943 std::string getName() throw(INTERP_KERNEL::Exception);
1944 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1945 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1946 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1947 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1948 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1949 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1950 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1951 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1952 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1953 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1954 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1955 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1956 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
1957 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1958 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1961 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1964 double tmp0=self->getTime(tmp1,tmp2);
1965 PyObject *res = PyList_New(3);
1966 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1967 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1968 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1972 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1974 std::pair<int,int> res=self->getDtIt();
1975 PyObject *elt=PyTuple_New(2);
1976 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1977 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1981 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1983 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1986 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1988 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1991 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1993 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1994 return self->changeMeshNames(modifTab);
1997 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1999 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2000 PyObject *ret2=PyList_New(ret.size());
2001 for(int i=0;i<(int)ret.size();i++)
2002 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2006 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2008 std::vector<int> ret1;
2009 int ret0=self->getNonEmptyLevels(mname,ret1);
2010 PyObject *elt=PyTuple_New(2);
2011 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2012 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2016 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2018 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2019 std::vector< std::vector<TypeOfField> > typesF;
2020 std::vector< std::vector<std::string> > pfls;
2021 std::vector< std::vector<std::string> > locs;
2022 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2024 PyObject *ret2=PyList_New(sz);
2025 for(int i=0;i<sz;i++)
2027 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2028 const std::vector<TypeOfField>& typesFI=typesF[i];
2029 const std::vector<std::string>& pflsI=pfls[i];
2030 const std::vector<std::string>& locsI=locs[i];
2031 PyObject *elt=PyTuple_New(2);
2032 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2033 int sz2=ret[i].size();
2034 PyObject *elt2=PyList_New(sz2);
2035 for(int j=0;j<sz2;j++)
2037 PyObject *elt3=PyTuple_New(4);
2038 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2039 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));
2040 PyTuple_SetItem(elt3,1,elt4);
2041 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2042 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2043 PyList_SetItem(elt2,j,elt3);
2045 PyTuple_SetItem(elt,1,elt2);
2046 PyList_SetItem(ret2,i,elt);
2051 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2053 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2054 std::size_t sz=ret.size();
2055 PyObject *retPy=PyList_New(sz);
2056 for(std::size_t i=0;i<sz;i++)
2057 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2061 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2063 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2064 std::size_t sz=ret.size();
2065 PyObject *retPy=PyList_New(sz);
2066 for(std::size_t i=0;i<sz;i++)
2067 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2071 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2073 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2074 std::size_t sz=ret.size();
2075 PyObject *retPy=PyList_New(sz);
2076 for(std::size_t i=0;i<sz;i++)
2077 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2081 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2083 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2084 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2085 return self->extractPart(extractDefCpp,mm);
2090 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2093 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2094 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2095 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2096 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2097 static MEDFileField1TS *New();
2098 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2099 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2100 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2101 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2102 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2103 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2104 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2106 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2107 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2108 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2109 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2112 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2114 return MEDFileField1TS::New(fileName,loadAll);
2117 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2119 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2122 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2124 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2127 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2129 return MEDFileField1TS::New(db);
2134 return MEDFileField1TS::New();
2137 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2139 const DataArrayDouble *arr=0;
2141 arr=field->getArray();
2142 self->copyTinyInfoFrom(field,arr);
2145 std::string __str__() const throw(INTERP_KERNEL::Exception)
2147 return self->simpleRepr();
2150 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2152 DataArrayInt *ret1=0;
2153 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2154 PyObject *ret=PyTuple_New(2);
2155 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2156 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2160 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2162 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2163 std::vector< std::vector<TypeOfField> > typesF;
2164 std::vector< std::vector<std::string> > pfls;
2165 std::vector< std::vector<std::string> > locs;
2166 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2168 PyObject *ret2=PyList_New(sz);
2169 for(int i=0;i<sz;i++)
2171 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2172 const std::vector<TypeOfField>& typesFI=typesF[i];
2173 const std::vector<std::string>& pflsI=pfls[i];
2174 const std::vector<std::string>& locsI=locs[i];
2175 PyObject *elt=PyTuple_New(2);
2176 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2177 int sz2=ret[i].size();
2178 PyObject *elt2=PyList_New(sz2);
2179 for(int j=0;j<sz2;j++)
2181 PyObject *elt3=PyTuple_New(4);
2182 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2183 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2184 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2185 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2186 PyList_SetItem(elt2,j,elt3);
2188 PyTuple_SetItem(elt,1,elt2);
2189 PyList_SetItem(ret2,i,elt);
2194 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2196 DataArrayDouble *ret=self->getUndergroundDataArray();
2202 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2204 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2205 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2208 PyObject *ret=PyTuple_New(2);
2209 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2210 std::size_t sz=elt1Cpp.size();
2211 PyObject *elt=PyList_New(sz);
2212 for(std::size_t i=0;i<sz;i++)
2214 PyObject *elt1=PyTuple_New(2);
2215 PyObject *elt2=PyTuple_New(2);
2216 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2217 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2218 PyObject *elt3=PyTuple_New(2);
2219 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2220 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2221 PyTuple_SetItem(elt1,0,elt2);
2222 PyTuple_SetItem(elt1,1,elt3);
2223 PyList_SetItem(elt,i,elt1);
2225 PyTuple_SetItem(ret,1,elt);
2231 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2234 static MEDFileIntField1TS *New();
2235 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2236 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2237 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2238 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2239 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2241 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2242 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2243 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2244 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2245 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2246 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2247 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2248 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2251 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2253 return MEDFileIntField1TS::New();
2256 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2258 return MEDFileIntField1TS::New(fileName,loadAll);
2261 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2263 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2266 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2268 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2271 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2273 return MEDFileIntField1TS::New(db);
2276 std::string __str__() const throw(INTERP_KERNEL::Exception)
2278 return self->simpleRepr();
2281 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2283 DataArrayInt *ret1=0;
2284 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2285 PyObject *ret=PyTuple_New(2);
2286 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2287 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2291 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2293 DataArrayInt *ret=self->getUndergroundDataArray();
2301 class MEDFileAnyTypeFieldMultiTSIterator
2306 PyObject *next() throw(INTERP_KERNEL::Exception)
2308 MEDFileAnyTypeField1TS *ret=self->nextt();
2310 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2313 PyErr_SetString(PyExc_StopIteration,"No more data.");
2320 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2323 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2324 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2325 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2326 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2327 std::string getName() const throw(INTERP_KERNEL::Exception);
2328 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2329 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2330 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2331 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2332 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2333 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2334 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2335 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2336 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2337 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2338 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2339 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2340 void loadArrays() throw(INTERP_KERNEL::Exception);
2341 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2342 void unloadArrays() throw(INTERP_KERNEL::Exception);
2343 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2345 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2346 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2347 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2348 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2349 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2350 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2353 int __len__() const throw(INTERP_KERNEL::Exception)
2355 return self->getNumberOfTS();
2358 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2360 if(elt0 && PyInt_Check(elt0))
2362 int pos=PyInt_AS_LONG(elt0);
2365 else if(elt0 && PyTuple_Check(elt0))
2367 if(PyTuple_Size(elt0)==2)
2369 PyObject *o0=PyTuple_GetItem(elt0,0);
2370 PyObject *o1=PyTuple_GetItem(elt0,1);
2371 if(PyInt_Check(o0) && PyInt_Check(o1))
2373 int iter=PyInt_AS_LONG(o0);
2374 int order=PyInt_AS_LONG(o1);
2375 return self->getPosOfTimeStep(iter,order);
2378 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 !");
2381 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 !");
2383 else if(elt0 && PyFloat_Check(elt0))
2385 double val=PyFloat_AS_DOUBLE(elt0);
2386 return self->getPosGivenTime(val);
2389 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2392 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2394 std::vector< std::pair<int,int> > res(self->getIterations());
2395 return convertVecPairIntToPy(res);
2398 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2400 std::vector<double> ret1;
2401 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2402 std::size_t sz=ret.size();
2403 PyObject *ret2=PyList_New(sz);
2404 for(std::size_t i=0;i<sz;i++)
2406 PyObject *elt=PyTuple_New(3);
2407 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2408 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2409 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2410 PyList_SetItem(ret2,i,elt);
2415 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2417 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2418 PyObject *ret2=PyList_New(ret.size());
2419 for(int i=0;i<(int)ret.size();i++)
2421 const std::vector<TypeOfField>& rett=ret[i];
2422 PyObject *ret3=PyList_New(rett.size());
2423 for(int j=0;j<(int)rett.size();j++)
2424 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2425 PyList_SetItem(ret2,i,ret3);
2430 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2432 std::vector<int> ret1;
2433 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2434 PyObject *elt=PyTuple_New(2);
2435 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2436 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2440 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2442 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2443 std::vector< std::vector<TypeOfField> > typesF;
2444 std::vector< std::vector<std::string> > pfls;
2445 std::vector< std::vector<std::string> > locs;
2446 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2448 PyObject *ret2=PyList_New(sz);
2449 for(int i=0;i<sz;i++)
2451 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2452 const std::vector<TypeOfField>& typesFI=typesF[i];
2453 const std::vector<std::string>& pflsI=pfls[i];
2454 const std::vector<std::string>& locsI=locs[i];
2455 PyObject *elt=PyTuple_New(2);
2456 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2457 int sz2=ret[i].size();
2458 PyObject *elt2=PyList_New(sz2);
2459 for(int j=0;j<sz2;j++)
2461 PyObject *elt3=PyTuple_New(4);
2462 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2463 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));
2464 PyTuple_SetItem(elt3,1,elt4);
2465 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2466 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2467 PyList_SetItem(elt2,j,elt3);
2469 PyTuple_SetItem(elt,1,elt2);
2470 PyList_SetItem(ret2,i,elt);
2475 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2477 if(PyList_Check(elts))
2479 int sz=PyList_Size(elts);
2480 std::vector<int> ret(sz);
2481 for(int i=0;i<sz;i++)
2483 PyObject *elt=PyList_GetItem(elts,i);
2484 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2490 std::vector<int> ret(1);
2491 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2496 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2498 if(PySlice_Check(elts))
2500 Py_ssize_t strt=2,stp=2,step=2;
2501 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2502 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2503 self->eraseTimeStepIds2(strt,stp,step);
2507 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2508 if(!idsToRemove.empty())
2509 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2513 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2517 std::vector<int> pos2;
2518 DataArrayInt *pos3=0;
2519 DataArrayIntTuple *pos4=0;
2520 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2525 self->eraseTimeStepIds(&pos1,&pos1+1);
2532 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2537 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2541 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2545 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2547 return self->iterator();
2550 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2552 if(elt0 && PyList_Check(elt0))
2554 int sz=PyList_Size(elt0);
2555 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2556 int *pt=da->getPointer();
2557 for(int i=0;i<sz;i++,pt++)
2559 PyObject *elt1=PyList_GetItem(elt0,i);
2560 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2562 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2564 else if(elt0 && PySlice_Check(elt0))
2566 Py_ssize_t strt=2,stp=2,step=2;
2567 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2568 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2569 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2572 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2575 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2577 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2578 return self->changeMeshNames(modifTab);
2581 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2583 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2584 std::size_t sz=ret.size();
2585 PyObject *retPy=PyList_New(sz);
2586 for(std::size_t i=0;i<sz;i++)
2587 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2591 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2593 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2594 std::size_t sz=ret.size();
2595 PyObject *retPy=PyList_New(sz);
2596 for(std::size_t i=0;i<sz;i++)
2597 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2601 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2603 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2604 std::size_t sz=ret.size();
2605 PyObject *retPy=PyList_New(sz);
2606 for(std::size_t i=0;i<sz;i++)
2607 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2611 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2614 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2615 if(SWIG_IsOK(status))
2617 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2621 std::vector<MEDFileAnyTypeField1TS *> tmp;
2622 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2623 self->pushBackTimeSteps(tmp);
2627 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2629 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2630 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2631 return self->extractPart(extractDefCpp,mm);
2634 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2636 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2637 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2638 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2639 std::size_t sz=ret.size();
2640 PyObject *retPy=PyList_New(sz);
2641 for(std::size_t i=0;i<sz;i++)
2643 std::size_t sz2=ret[i].size();
2644 PyObject *ret1Py=PyList_New(sz2);
2645 for(std::size_t j=0;j<sz2;j++)
2647 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2650 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2652 PyList_SetItem(retPy,i,ret1Py);
2657 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2659 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2660 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2661 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2662 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2663 if(ret2.size()!=ret.size())
2665 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2666 throw INTERP_KERNEL::Exception(oss.str().c_str());
2668 std::size_t sz=ret.size();
2669 PyObject *retPy=PyList_New(sz);
2670 for(std::size_t i=0;i<sz;i++)
2672 std::size_t sz2=ret[i].size();
2673 PyObject *ret0Py=PyTuple_New(2);
2674 PyObject *ret1Py=PyList_New(sz2);
2675 for(std::size_t j=0;j<sz2;j++)
2677 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2680 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2682 PyTuple_SetItem(ret0Py,0,ret1Py);
2683 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2684 PyList_SetItem(retPy,i,ret0Py);
2691 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2694 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2695 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2696 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2698 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2699 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2700 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2701 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2702 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2703 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2705 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2706 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2707 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2710 MEDFileFieldMultiTS()
2712 return MEDFileFieldMultiTS::New();
2715 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2717 return MEDFileFieldMultiTS::New(fileName,loadAll);
2720 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2722 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2725 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2727 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2728 std::size_t sz(tmp.size());
2729 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2730 for(std::size_t i=0;i<sz;i++)
2732 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2733 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2735 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2738 std::string __str__() const throw(INTERP_KERNEL::Exception)
2740 return self->simpleRepr();
2743 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2745 DataArrayInt *ret1=0;
2746 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2747 PyObject *ret=PyTuple_New(2);
2748 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2749 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2753 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2755 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2756 std::vector< std::vector<TypeOfField> > typesF;
2757 std::vector< std::vector<std::string> > pfls;
2758 std::vector< std::vector<std::string> > locs;
2759 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2761 PyObject *ret2=PyList_New(sz);
2762 for(int i=0;i<sz;i++)
2764 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2765 const std::vector<TypeOfField>& typesFI=typesF[i];
2766 const std::vector<std::string>& pflsI=pfls[i];
2767 const std::vector<std::string>& locsI=locs[i];
2768 PyObject *elt=PyTuple_New(2);
2769 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2770 int sz2=ret[i].size();
2771 PyObject *elt2=PyList_New(sz2);
2772 for(int j=0;j<sz2;j++)
2774 PyObject *elt3=PyTuple_New(4);
2775 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2776 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2777 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2778 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2779 PyList_SetItem(elt2,j,elt3);
2781 PyTuple_SetItem(elt,1,elt2);
2782 PyList_SetItem(ret2,i,elt);
2786 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2788 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2794 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2796 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2797 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2800 PyObject *ret=PyTuple_New(2);
2801 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2802 std::size_t sz=elt1Cpp.size();
2803 PyObject *elt=PyList_New(sz);
2804 for(std::size_t i=0;i<sz;i++)
2806 PyObject *elt1=PyTuple_New(2);
2807 PyObject *elt2=PyTuple_New(2);
2808 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2809 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2810 PyObject *elt3=PyTuple_New(2);
2811 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2812 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2813 PyTuple_SetItem(elt1,0,elt2);
2814 PyTuple_SetItem(elt1,1,elt3);
2815 PyList_SetItem(elt,i,elt1);
2817 PyTuple_SetItem(ret,1,elt);
2823 class MEDFileFieldsIterator
2828 PyObject *next() throw(INTERP_KERNEL::Exception)
2830 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2832 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2835 PyErr_SetString(PyExc_StopIteration,"No more data.");
2842 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2845 static MEDFileIntFieldMultiTS *New();
2846 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2847 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2848 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2850 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2851 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2852 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2853 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2854 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2855 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2856 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2857 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2858 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2861 MEDFileIntFieldMultiTS()
2863 return MEDFileIntFieldMultiTS::New();
2866 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2868 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2871 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2873 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2876 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2878 return MEDFileIntFieldMultiTS::New(db);
2881 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2883 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2884 std::size_t sz(tmp.size());
2885 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2886 for(std::size_t i=0;i<sz;i++)
2888 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2889 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2891 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2894 std::string __str__() const throw(INTERP_KERNEL::Exception)
2896 return self->simpleRepr();
2899 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2901 DataArrayInt *ret1=0;
2902 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2903 PyObject *ret=PyTuple_New(2);
2904 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2905 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2909 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2911 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2919 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2922 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2923 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2924 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2925 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2926 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
2927 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2928 void loadArrays() throw(INTERP_KERNEL::Exception);
2929 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2930 void unloadArrays() throw(INTERP_KERNEL::Exception);
2931 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2932 int getNumberOfFields() const;
2933 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2934 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2936 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2937 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2938 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2939 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2940 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2941 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2942 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2943 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2944 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2949 return MEDFileFields::New();
2952 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2954 return MEDFileFields::New(fileName,loadAll);
2957 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2959 return MEDFileFields::New(db);
2962 std::string __str__() const throw(INTERP_KERNEL::Exception)
2964 return self->simpleRepr();
2967 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2969 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2970 std::size_t sz(tmp.size());
2971 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2972 for(std::size_t i=0;i<sz;i++)
2974 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2975 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2977 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2980 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2983 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2984 PyObject *ret=PyTuple_New(2);
2985 PyObject *ret_0=PyList_New(ret0.size());
2987 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2989 PyObject *elt=PyTuple_New(2);
2990 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2991 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2992 PyList_SetItem(ret_0,rk,elt);
2994 PyTuple_SetItem(ret,0,ret_0);
2995 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2996 PyTuple_SetItem(ret,1,ret_1);
3000 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3002 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3003 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3006 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3008 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3009 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3012 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3014 if(obj && PyList_Check(obj))
3016 int sz=PyList_Size(obj);
3017 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3018 int *pt=da->getPointer();
3019 for(int i=0;i<sz;i++,pt++)
3021 PyObject *elt1=PyList_GetItem(obj,i);
3022 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3024 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3027 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3030 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3032 self->setFieldAtPos(obj,field);
3036 int __len__() const throw(INTERP_KERNEL::Exception)
3038 return self->getNumberOfFields();
3041 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3043 return self->iterator();
3046 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3048 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3049 return self->changeMeshNames(modifTab);
3052 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3054 if(elt0 && PyInt_Check(elt0))
3056 return PyInt_AS_LONG(elt0);
3058 else if(elt0 && PyString_Check(elt0))
3059 return self->getPosFromFieldName(PyString_AsString(elt0));
3061 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3064 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3066 if(PyList_Check(elts))
3068 int sz=PyList_Size(elts);
3069 std::vector<int> ret(sz);
3070 for(int i=0;i<sz;i++)
3072 PyObject *elt=PyList_GetItem(elts,i);
3073 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3079 std::vector<int> ret(1);
3080 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3085 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3087 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3088 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3089 self->pushFields(tmp);
3092 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3094 if(elts && PySlice_Check(elts))
3096 Py_ssize_t strt=2,stp=2,step=2;
3097 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3098 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3099 self->destroyFieldsAtPos2(strt,stp,step);
3103 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3104 if(!idsToRemove.empty())
3105 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3109 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3111 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3112 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3113 return self->extractPart(extractDefCpp,mm);
3118 class MEDFileParameter1TS : public RefCountObject
3121 void setIteration(int it);
3122 int getIteration() const;
3123 void setOrder(int order);
3124 int getOrder() const;
3125 void setTimeValue(double time);
3126 void setTime(int dt, int it, double time);
3127 double getTime(int& dt, int& it);
3128 double getTimeValue() const;
3131 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3134 void setValue(double val) throw(INTERP_KERNEL::Exception);
3135 double getValue() const throw(INTERP_KERNEL::Exception);
3136 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3139 std::string __str__() const throw(INTERP_KERNEL::Exception)
3141 return self->simpleRepr();
3146 class MEDFileParameterTinyInfo : public MEDFileWritable
3149 void setDescription(const std::string& name);
3150 std::string getDescription() const;
3151 void setTimeUnit(const std::string& unit);
3152 std::string getTimeUnit() const;
3155 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3158 static MEDFileParameterDouble1TS *New();
3159 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3160 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3161 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3162 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3163 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3164 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3165 std::string getName() const throw(INTERP_KERNEL::Exception);
3166 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3169 MEDFileParameterDouble1TS()
3171 return MEDFileParameterDouble1TS::New();
3174 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3176 return MEDFileParameterDouble1TS::New(fileName);
3179 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3181 return MEDFileParameterDouble1TS::New(fileName,paramName);
3184 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3186 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3189 std::string __str__() const throw(INTERP_KERNEL::Exception)
3191 return self->simpleRepr();
3194 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3197 bool ret0=self->isEqual(other,eps,what);
3198 PyObject *res=PyList_New(2);
3199 PyObject *ret0Py=ret0?Py_True:Py_False;
3201 PyList_SetItem(res,0,ret0Py);
3202 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3208 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3211 static MEDFileParameterMultiTS *New();
3212 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3213 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3214 std::string getName() const;
3215 void setName(const std::string& name);
3216 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3217 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3218 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3219 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3220 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3221 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3222 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3223 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3226 MEDFileParameterMultiTS()
3228 return MEDFileParameterMultiTS::New();
3231 MEDFileParameterMultiTS(const std::string& fileName)
3233 return MEDFileParameterMultiTS::New(fileName);
3236 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3238 return MEDFileParameterMultiTS::New(fileName,paramName);
3241 std::string __str__() const throw(INTERP_KERNEL::Exception)
3243 return self->simpleRepr();
3246 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3249 bool ret0=self->isEqual(other,eps,what);
3250 PyObject *res=PyList_New(2);
3251 PyObject *ret0Py=ret0?Py_True:Py_False;
3253 PyList_SetItem(res,0,ret0Py);
3254 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3258 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3262 std::vector<int> pos2;
3263 DataArrayInt *pos3=0;
3264 DataArrayIntTuple *pos4=0;
3265 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3270 self->eraseTimeStepIds(&pos1,&pos1+1);
3277 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3282 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3286 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3290 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3292 if(elt0 && PyInt_Check(elt0))
3294 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3297 else if(elt0 && PyTuple_Check(elt0))
3299 if(PyTuple_Size(elt0)==2)
3301 PyObject *o0=PyTuple_GetItem(elt0,0);
3302 PyObject *o1=PyTuple_GetItem(elt0,1);
3303 if(PyInt_Check(o0) && PyInt_Check(o1))
3305 int iter=PyInt_AS_LONG(o0);
3306 int order=PyInt_AS_LONG(o1);
3307 return self->getPosOfTimeStep(iter,order);
3310 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 !");
3313 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 !");
3315 else if(elt0 && PyFloat_Check(elt0))
3317 double val=PyFloat_AS_DOUBLE(elt0);
3318 return self->getPosGivenTime(val);
3321 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3324 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3326 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3332 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3334 if(PyList_Check(elts))
3336 int sz=PyList_Size(elts);
3337 std::vector<int> ret(sz);
3338 for(int i=0;i<sz;i++)
3340 PyObject *elt=PyList_GetItem(elts,i);
3341 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3347 std::vector<int> ret(1);
3348 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3353 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3355 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3356 if(!idsToRemove.empty())
3357 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3360 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3362 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3368 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3370 std::vector< std::pair<int,int> > res=self->getIterations();
3371 PyObject *ret=PyList_New(res.size());
3373 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3375 PyObject *elt=PyTuple_New(2);
3376 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3377 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3378 PyList_SetItem(ret,rk,elt);
3383 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3385 std::vector<double> res2;
3386 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3387 PyObject *ret=PyList_New(res.size());
3389 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3391 PyObject *elt=PyTuple_New(3);
3392 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3393 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3394 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3395 PyList_SetItem(ret,rk,elt);
3402 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3405 static MEDFileParameters *New();
3406 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3407 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3408 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3409 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3410 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3411 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3412 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3413 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3414 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3415 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3416 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3421 return MEDFileParameters::New();
3424 MEDFileParameters(const std::string& fileName)
3426 return MEDFileParameters::New(fileName);
3429 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3431 return MEDFileParameters::New(db);
3434 std::string __str__() const throw(INTERP_KERNEL::Exception)
3436 return self->simpleRepr();
3439 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3441 if(PyInt_Check(obj))
3443 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3448 else if(PyString_Check(obj))
3450 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3456 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3459 int __len__() const throw(INTERP_KERNEL::Exception)
3461 return self->getNumberOfParams();
3464 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3466 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3472 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3474 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3480 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3483 bool ret0=self->isEqual(other,eps,what);
3484 PyObject *res=PyList_New(2);
3485 PyObject *ret0Py=ret0?Py_True:Py_False;
3487 PyList_SetItem(res,0,ret0Py);
3488 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3494 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3497 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3498 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3499 static MEDFileData *New();
3500 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3501 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3502 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3503 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3504 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3505 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3506 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3508 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3509 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3513 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3515 return MEDFileData::New(fileName);
3518 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3520 return MEDFileData::New(db);
3525 return MEDFileData::New();
3528 std::string __str__() const throw(INTERP_KERNEL::Exception)
3530 return self->simpleRepr();
3533 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3535 MEDFileMeshes *ret=self->getMeshes();
3541 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3543 MEDFileParameters *ret=self->getParams();
3549 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3551 MEDFileFields *ret=self->getFields();
3557 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3559 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3560 return self->changeMeshNames(modifTab);
3563 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3565 std::vector<const MEDFileData *> mfdsCpp;
3566 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3567 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3573 class SauvReader : public RefCountObject
3576 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3577 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3580 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3582 return SauvReader::New(fileName);
3587 class SauvWriter : public RefCountObject
3590 static SauvWriter * New();
3591 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3592 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3593 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3594 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3597 SauvWriter() throw(INTERP_KERNEL::Exception)
3599 return SauvWriter::New();
3606 class MEDFileMeshStruct;
3608 class MEDFileField1TSStructItem
3611 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3614 class MEDFileMeshStruct : public RefCountObject
3617 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3619 ~MEDFileMeshStruct();
3622 class MEDMeshMultiLev : public RefCountObject
3625 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3626 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3627 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3633 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3635 DataArrayInt *famIds(0);
3636 bool isWithoutCopy(false);
3637 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3638 PyObject *ret=PyTuple_New(2);
3639 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3641 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3642 PyTuple_SetItem(ret,1,ret1Py);
3646 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3648 DataArrayInt *numIds(0);
3649 bool isWithoutCopy(false);
3650 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3651 PyObject *ret=PyTuple_New(2);
3652 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3654 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3655 PyTuple_SetItem(ret,1,ret1Py);
3659 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3661 DataArrayInt *famIds(0);
3662 bool isWithoutCopy(false);
3663 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3664 PyObject *ret=PyTuple_New(2);
3665 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3667 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3668 PyTuple_SetItem(ret,1,ret1Py);
3672 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3674 DataArrayInt *numIds(0);
3675 bool isWithoutCopy(false);
3676 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3677 PyObject *ret=PyTuple_New(2);
3678 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3680 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3681 PyTuple_SetItem(ret,1,ret1Py);
3685 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3687 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3688 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3689 PyObject *res(PyList_New(result.size()));
3690 for(int i=0;iL!=result.end(); i++, iL++)
3691 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3697 class MEDUMeshMultiLev : public MEDMeshMultiLev
3700 ~MEDUMeshMultiLev();
3704 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3706 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3707 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3708 PyObject *ret0Py=ncc?Py_True:Py_False;
3710 PyObject *ret=PyTuple_New(7);
3711 PyTuple_SetItem(ret,0,ret0Py);
3712 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3713 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3714 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3715 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3716 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3717 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3723 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3726 ~MEDStructuredMeshMultiLev();
3729 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3732 ~MEDCMeshMultiLev();
3736 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3739 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3740 std::size_t sz(objs.size());
3741 PyObject *ret(PyTuple_New(2));
3742 PyObject *ret0=PyList_New(sz);
3743 for(std::size_t i=0;i<sz;i++)
3744 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3745 PyTuple_SetItem(ret,0,ret0);
3746 PyObject *ret1Py(isInternal?Py_True:Py_False);
3748 PyTuple_SetItem(ret,1,ret1Py);
3754 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3757 ~MEDCurveLinearMeshMultiLev();
3761 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3763 DataArrayDouble *ret0(0);
3764 std::vector<int> ret1;
3766 self->buildVTUArrays(ret0,ret1,ret2);
3767 std::size_t sz(ret1.size());
3768 PyObject *ret=PyTuple_New(3);
3769 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3770 PyObject *ret1Py=PyList_New(sz);
3771 for(std::size_t i=0;i<sz;i++)
3772 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3773 PyTuple_SetItem(ret,1,ret1Py);
3774 PyObject *ret2Py(ret2?Py_True:Py_False);
3776 PyTuple_SetItem(ret,2,ret2Py);
3782 class MEDFileFastCellSupportComparator : public RefCountObject
3785 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3786 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3787 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3788 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3790 ~MEDFileFastCellSupportComparator();
3794 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3796 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3797 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3798 PyObject *res(PyList_New(result.size()));
3799 for(int i=0;iL!=result.end(); i++, iL++)
3800 PyList_SetItem(res,i,PyInt_FromLong(*iL));