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 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
304 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
305 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
306 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
307 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
308 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
309 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
310 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
311 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
312 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
313 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
314 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
315 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
316 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
317 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
318 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
319 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
320 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
321 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
322 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
323 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
324 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
325 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);
326 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);
327 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);
328 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);
329 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);
330 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
331 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
332 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
333 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
334 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
335 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
338 %rename (MEDFileVersion) MEDFileVersionSwig;
339 %rename (GetFieldIterations) GetFieldIterationsSwig;
340 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
341 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
342 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
343 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
344 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
345 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
346 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
347 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
348 %rename (WriteUMeshes) WriteUMeshesSwig;
349 %rename (GetTypesOfField) GetTypesOfFieldSwig;
350 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
351 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
355 PyObject *MEDFileVersionSwig()
357 int major,minor,release;
358 MEDCoupling::MEDFileVersion(major,minor,release);
359 PyObject *ret(PyTuple_New(3));
360 PyTuple_SetItem(ret,0,SWIG_From_int(major));
361 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
362 PyTuple_SetItem(ret,2,SWIG_From_int(release));
366 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
368 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
369 PyObject *ret=PyList_New(res.size());
371 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
373 PyObject *elt=PyTuple_New(2);
374 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
375 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
376 PyList_SetItem(ret,rk,elt);
381 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
383 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
384 PyObject *ret=PyList_New(res.size());
386 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
388 PyObject *elt=PyTuple_New(3);
389 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
390 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
391 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
392 PyList_SetItem(ret,rk,elt);
397 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
399 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
400 PyObject *ret=PyList_New(res.size());
402 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
404 PyObject *elt=PyTuple_New(2);
405 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
406 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
407 PyList_SetItem(ret,rk,elt);
412 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
414 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
415 PyObject *ret=PyList_New(res.size());
417 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
419 PyObject *elt=PyTuple_New(2);
420 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
421 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
422 PyList_SetItem(ret,rk,elt);
427 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
429 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
430 PyObject *ret=PyList_New(res.size());
432 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
434 PyObject *elt=PyTuple_New(2);
435 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
436 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
437 PyList_SetItem(ret,rk,elt);
442 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
444 int meshDim,spaceDim,numberOfNodes;
445 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
446 PyObject *ret=PyTuple_New(4);
447 PyObject *elt0=PyList_New(res.size());
449 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
451 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
453 PyObject *elt1=PyList_New(obj2.size());
454 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
456 PyObject *elt2=PyTuple_New(2);
457 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
458 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
459 PyList_SetItem(elt1,j,elt2);
461 PyList_SetItem(elt0,i,elt1);
463 PyTuple_SetItem(ret,0,elt0);
464 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
465 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
466 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
470 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
471 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
473 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
474 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
475 return convertFieldDoubleVecToPy(res);
478 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
480 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
481 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
482 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
485 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
487 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
488 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
489 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
492 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
494 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
495 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
496 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
499 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
501 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
503 PyObject *ret=PyList_New(size);
504 for(int i=0;i<size;i++)
505 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
509 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
511 std::vector<std::string> grps;
512 converPyListToVecString(li,grps);
513 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
516 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
518 std::vector<std::string> fams;
519 converPyListToVecString(li,fams);
520 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
524 namespace MEDCoupling
526 class MEDFileWritable
529 void copyOptionsFrom(const MEDFileWritable& other) const;
530 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
531 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
532 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
533 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
536 class MEDFileWritableStandAlone : public MEDFileWritable
539 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
540 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
543 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
545 MCAuto<DataArrayByte> ret(self->serialize());
551 class MEDFileMeshReadSelector
554 MEDFileMeshReadSelector();
555 MEDFileMeshReadSelector(unsigned int code);
556 unsigned int getCode() const;
557 void setCode(unsigned int newCode);
558 bool isCellFamilyFieldReading() const;
559 bool isNodeFamilyFieldReading() const;
560 bool isCellNameFieldReading() const;
561 bool isNodeNameFieldReading() const;
562 bool isCellNumFieldReading() const;
563 bool isNodeNumFieldReading() const;
564 void setCellFamilyFieldReading(bool b);
565 void setNodeFamilyFieldReading(bool b);
566 void setCellNameFieldReading(bool b);
567 void setNodeNameFieldReading(bool b);
568 void setCellNumFieldReading(bool b);
569 void setNodeNumFieldReading(bool b);
572 std::string __str__() const throw(INTERP_KERNEL::Exception)
574 std::ostringstream oss;
579 std::string __repr__() const throw(INTERP_KERNEL::Exception)
581 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
587 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
590 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
591 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
592 throw(INTERP_KERNEL::Exception);
593 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
594 INTERP_KERNEL::NormalizedCellType loc_geo_type,
595 INTERP_KERNEL::NormalizedCellType rem_geo_type)
596 throw(INTERP_KERNEL::Exception);
597 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
598 MEDFileJointCorrespondence *deepCopy() const;
599 MEDFileJointCorrespondence *shallowCpy() const;
600 void setIsNodal(bool isNodal);
601 bool getIsNodal() const;
602 bool isEqual(const MEDFileJointCorrespondence *other) const;
603 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
604 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
605 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
606 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
607 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
608 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
609 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);
610 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
613 MEDFileJointCorrespondence()
615 return MEDFileJointCorrespondence::New();
617 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
619 return MEDFileJointCorrespondence::New(correspondence);
621 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
622 INTERP_KERNEL::NormalizedCellType loc_geo_type,
623 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
625 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
628 std::string __str__() const throw(INTERP_KERNEL::Exception)
630 return self->simpleRepr();
635 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
638 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
639 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
640 MEDFileJointOneStep *deepCopy() const;
641 MEDFileJointOneStep *shallowCpy() const;
642 bool isEqual(const MEDFileJointOneStep *other) const;
643 void setOrder(int order);
644 int getOrder() const;
645 void setIteration(int it);
646 int getIteration() const;
647 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
648 int getNumberOfCorrespondences() const;
649 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
650 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
651 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
654 MEDFileJointOneStep()
656 return MEDFileJointOneStep::New();
659 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
661 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
664 std::string __str__() const throw(INTERP_KERNEL::Exception)
666 return self->simpleRepr();
671 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
674 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
675 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
676 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
677 MEDFileJoint *deepCopy() const;
678 MEDFileJoint *shallowCpy() const;
679 bool isEqual(const MEDFileJoint *other) const;
680 void setLocalMeshName(const std::string& name);
681 std::string getLocalMeshName() const;
682 void setRemoteMeshName(const std::string& name);
683 std::string getRemoteMeshName() const;
684 void setDescription(const std::string& name);
685 std::string getDescription() const;
686 void setJointName(const std::string& name);
687 std::string getJointName() const;
688 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
689 void setDomainNumber(const int& number);
690 int getDomainNumber() const;
691 void pushStep(MEDFileJointOneStep* step);
692 int getNumberOfSteps() const;
693 MEDFileJointOneStep *getStepAtPos(int i) const;
694 std::string simpleRepr() const;
699 return MEDFileJoint::New();
702 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
704 return MEDFileJoint::New(fileName,mName,num);
707 std::string __str__() const throw(INTERP_KERNEL::Exception)
709 return self->simpleRepr();
714 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
717 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
718 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
719 MEDFileJoints *deepCopy() const;
720 std::string simpleRepr() const;
721 std::string getMeshName() const;
722 int getNumberOfJoints() const;
723 std::vector<std::string> getJointsNames() const;
724 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
725 void resize(int newSize) throw(INTERP_KERNEL::Exception);
726 void pushJoint(MEDFileJoint *joint);
727 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
728 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
733 return MEDFileJoints::New();
736 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
738 return MEDFileJoints::New(fileName,meshName);
741 std::string __str__() const throw(INTERP_KERNEL::Exception)
743 return self->simpleRepr();
746 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
750 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
755 else if(PyString_Check(obj))
757 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
763 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
766 int __len__() const throw(INTERP_KERNEL::Exception)
768 return self->getNumberOfJoints();
771 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
773 MEDFileJoint *ret=self->getJointAtPos(i);
779 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
781 MEDFileJoint *ret=self->getJointWithName(paramName);
789 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
792 MEDFileEquivalenceBase();
795 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
798 MEDFileEquivalenceData();
800 void setArray(DataArrayInt *data);
803 DataArrayInt *getArray()
805 DataArrayInt *ret(self->getArray());
806 if(ret) ret->incrRef();
812 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
815 MEDFileEquivalenceNode();
818 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
821 MEDFileEquivalenceCell();
824 std::size_t size() const;
825 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
826 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
829 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
831 DataArrayInt *ret(self->getArray(type));
832 if(ret) ret->incrRef();
836 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
838 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
839 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
840 PyObject *res=PyList_New(result.size());
841 for(int i=0;iL!=result.end(); i++, iL++)
842 PyList_SetItem(res,i,PyInt_FromLong(*iL));
848 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
851 MEDFileEquivalencePair();
853 std::string getName() const;
854 void setName(const std::string& name);
855 std::string getDescription() const;
856 void setDescription(const std::string& descr);
857 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
860 MEDFileEquivalenceCell *initCell()
862 MEDFileEquivalenceCell *ret(self->initCell());
863 if(ret) ret->incrRef();
867 MEDFileEquivalenceNode *initNode()
869 MEDFileEquivalenceNode *ret(self->initNode());
870 if(ret) ret->incrRef();
874 MEDFileEquivalenceCell *getCell()
876 MEDFileEquivalenceCell *ret(self->getCell());
877 if(ret) ret->incrRef();
881 MEDFileEquivalenceNode *getNode()
883 MEDFileEquivalenceNode *ret(self->getNode());
884 if(ret) ret->incrRef();
890 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
893 MEDFileEquivalences();
896 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
897 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
898 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
902 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
904 MEDFileEquivalencePair *ret(self->getEquivalence(i));
905 if(ret) ret->incrRef();
908 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
910 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
911 if(ret) ret->incrRef();
915 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
917 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
918 if(ret) ret->incrRef();
924 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
927 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
928 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
929 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
930 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
931 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
932 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
933 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
934 void setName(const std::string& name);
935 std::string getName();
936 std::string getUnivName() const;
937 bool getUnivNameWrStatus() const;
938 void setUnivNameWrStatus(bool newStatus);
939 void setDescription(const std::string& name);
940 std::string getDescription() const;
941 void setOrder(int order);
942 int getOrder() const;
943 void setIteration(int it);
945 void setTimeValue(double time);
946 void setTime(int dt, int it, double time);
947 double getTimeValue() const;
948 void setTimeUnit(const std::string& unit);
949 std::string getTimeUnit() const;
950 void setAxisType(MEDCouplingAxisType at);
951 MEDCouplingAxisType getAxisType() const;
952 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
953 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
954 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
955 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
956 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
957 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
958 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
959 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
960 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
961 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
962 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
963 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
964 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
965 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
967 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
968 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
969 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
970 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
971 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
972 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
973 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
974 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
975 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
976 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
977 void clearGrpMap() throw(INTERP_KERNEL::Exception);
978 void clearFamMap() throw(INTERP_KERNEL::Exception);
979 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
980 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
981 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
982 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
983 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
984 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
985 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
986 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
987 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
988 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
989 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
990 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
991 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
992 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
993 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
994 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
995 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
996 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
997 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
998 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
999 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1000 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1001 static std::string GetMagicFamilyStr();
1002 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1003 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1004 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1005 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1006 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1007 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1008 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1009 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1010 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1011 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1012 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1013 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1014 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1015 void setFamilyInfo(const std::map<std::string,int>& info);
1016 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1017 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1018 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1019 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1020 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1021 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1022 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1023 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1024 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1025 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1026 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1027 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1028 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1029 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1030 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1031 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1032 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1033 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1034 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1035 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1036 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1038 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1039 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1040 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1041 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1042 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1043 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1044 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1045 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1046 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1047 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1048 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1049 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1050 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1051 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1052 int getNumberOfJoints();
1053 MEDFileJoints *getJoints();
1054 void setJoints( MEDFileJoints* joints );
1055 void initializeEquivalences();
1056 void killEquivalences();
1059 std::string __str__() const throw(INTERP_KERNEL::Exception)
1061 return self->simpleRepr();
1064 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1066 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1069 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1072 double tmp0=self->getTime(tmp1,tmp2);
1073 PyObject *res = PyList_New(3);
1074 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1075 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1076 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1080 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1083 bool ret0=self->isEqual(other,eps,what);
1084 PyObject *res=PyList_New(2);
1085 PyObject *ret0Py=ret0?Py_True:Py_False;
1087 PyList_SetItem(res,0,ret0Py);
1088 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1092 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1094 std::vector<const DataArrayInt *> grps;
1095 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1096 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1099 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1102 bool ret0=self->areFamsEqual(other,what);
1103 PyObject *res=PyList_New(2);
1104 PyObject *ret0Py=ret0?Py_True:Py_False;
1106 PyList_SetItem(res,0,ret0Py);
1107 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1111 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1114 bool ret0=self->areGrpsEqual(other,what);
1115 PyObject *res=PyList_New(2);
1116 PyObject *ret0Py=ret0?Py_True:Py_False;
1118 PyList_SetItem(res,0,ret0Py);
1119 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1123 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1125 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1126 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1127 PyObject *res=PyList_New(result.size());
1128 for(int i=0;iL!=result.end(); i++, iL++)
1129 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1133 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1135 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1136 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1137 PyObject *res=PyList_New(result.size());
1138 for(int i=0;iL!=result.end(); i++, iL++)
1139 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1143 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1145 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1148 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1151 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1153 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1156 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1159 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1161 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1164 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1167 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1169 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1172 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1175 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1177 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1180 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1183 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1186 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1187 PyObject *ret=PyTuple_New(2);
1188 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1189 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1193 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1195 DataArrayInt *ret3=0;
1196 std::vector<int> ret1,ret2;
1197 bool ret0=self->unPolyze(ret1,ret2,ret3);
1198 PyObject *ret=PyTuple_New(4);
1199 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1201 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1202 for(int j=0;j<(int)ret1.size()/3;j++)
1204 PyObject *retLev2=PyList_New(3);
1205 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1206 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1207 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1208 PyList_SetItem(retLev1_0,j,retLev2);
1210 PyTuple_SetItem(ret,1,retLev1_0);
1212 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1213 for(int j=0;j<(int)ret2.size()/3;j++)
1215 PyObject *retLev2=PyList_New(3);
1216 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1217 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1218 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1219 PyList_SetItem(retLev1_1,j,retLev2);
1221 PyTuple_SetItem(ret,2,retLev1_1);
1223 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1227 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1229 MEDFileEquivalences *ret(self->getEquivalences());
1230 if(ret) ret->incrRef();
1236 class MEDFileUMesh : public MEDFileMesh
1239 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1240 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1241 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1242 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1243 static MEDFileUMesh *New();
1244 static const char *GetSpeStr4ExtMesh();
1246 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1247 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1248 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1249 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1250 void clearNodeAndCellNumbers();
1252 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1253 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1254 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1255 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1256 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1257 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1258 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1259 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1260 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1261 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1263 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1264 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1265 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1266 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1267 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1268 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1269 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1270 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1271 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1272 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1273 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1274 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1275 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1276 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1277 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1280 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1282 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1285 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1287 return MEDFileUMesh::New(fileName,mrs);
1290 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1292 return MEDFileUMesh::New(mem);
1295 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1297 return MEDFileUMesh::New(db);
1302 return MEDFileUMesh::New();
1306 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1308 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1311 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)
1313 std::vector<int> typesCpp1;
1314 convertPyToNewIntArr3(types,typesCpp1);
1315 std::size_t sz(typesCpp1.size());
1316 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1317 for(std::size_t ii=0;ii<sz;ii++)
1318 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1319 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1322 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1323 {// put an empty dict in input to say to __new__ to call __init__...
1324 PyObject *ret(PyTuple_New(1));
1325 PyObject *ret0(PyDict_New());
1326 PyTuple_SetItem(ret,0,ret0);
1330 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1332 std::vector<double> a0;
1333 std::vector<int> a1;
1334 std::vector<std::string> a2;
1335 std::vector< MCAuto<DataArrayInt> > a3;
1336 MCAuto<DataArrayDouble> a4;
1337 self->serialize(a0,a1,a2,a3,a4);
1338 PyObject *ret(PyTuple_New(5));
1339 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1340 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1342 PyObject *ret2(PyList_New(sz));
1343 for(int i=0;i<sz;i++)
1344 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1345 PyTuple_SetItem(ret,2,ret2);
1347 PyObject *ret3(PyList_New(sz));
1348 for(int i=0;i<sz;i++)
1350 DataArrayInt *elt(a3[i]);
1353 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1355 PyTuple_SetItem(ret,3,ret3);
1356 DataArrayDouble *ret4(a4);
1359 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1363 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1365 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1366 if(!PyTuple_Check(inp))
1367 throw INTERP_KERNEL::Exception(MSG);
1368 int sz(PyTuple_Size(inp));
1370 throw INTERP_KERNEL::Exception(MSG);
1371 std::vector<double> a0;
1372 std::vector<int> a1;
1373 std::vector<std::string> a2;
1374 std::vector< MCAuto<DataArrayInt> > a3;
1375 MCAuto<DataArrayDouble> a4;
1377 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1379 fillArrayWithPyListDbl3(a0py,tmp,a0);
1380 convertPyToNewIntArr3(a1py,a1);
1381 fillStringVector(a2py,a2);
1383 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1385 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1386 if(!SWIG_IsOK(status))
1387 throw INTERP_KERNEL::Exception(MSG);
1388 a4=reinterpret_cast<DataArrayDouble *>(argp);
1389 if((DataArrayDouble *)a4)
1392 std::vector< DataArrayInt * > a3Tmp;
1393 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1394 std::size_t sz(a3Tmp.size());
1396 for(std::size_t i=0;i<sz;i++)
1400 a3Tmp[i]->incrRef();
1402 self->unserialize(a0,a1,a2,a3,a4);
1406 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1409 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1410 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1413 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1416 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1419 self->setMeshAtLevel(meshDimRelToMax,m1);
1422 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1425 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1427 self->removeMeshAtLevel(meshDimRelToMax);
1430 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1432 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1434 DataArrayDouble *a,*a2;
1435 DataArrayDoubleTuple *aa,*aa2;
1436 std::vector<double> bb,bb2;
1438 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1439 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1440 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1444 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1446 std::vector<const MEDFileUMesh *> meshesCpp;
1447 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1448 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1452 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1454 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1455 return convertVecPairIntToPy(ret);
1458 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1460 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1461 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1462 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1465 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1467 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1468 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1469 return self->extractPart(extractDefCpp);
1472 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1474 std::vector<const MEDCouplingUMesh *> ms;
1475 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1476 self->setMeshes(ms,renum);
1479 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1481 std::vector<const MEDCouplingUMesh *> ms;
1482 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1483 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1486 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1488 std::vector<const MEDCouplingUMesh *> ms;
1489 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1490 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1493 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1495 DataArrayDouble *ret=self->getCoords();
1501 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1503 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1506 return const_cast<PartDefinition *>(ret);
1509 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1511 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1512 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1513 PyObject *ret=PyTuple_New(3);
1514 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1515 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1516 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1520 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1522 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1528 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1530 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1531 std::size_t sz(tmp.size());
1532 PyObject *ret=PyList_New(sz);
1533 for(std::size_t i=0;i<sz;i++)
1537 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1544 class MEDFileStructuredMesh : public MEDFileMesh
1549 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1551 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1559 class MEDFileCMesh : public MEDFileStructuredMesh
1562 static MEDFileCMesh *New();
1563 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1564 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1565 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1566 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1567 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1572 return MEDFileCMesh::New();
1575 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1577 return MEDFileCMesh::New(fileName,mrs);
1580 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1582 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1585 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1587 return MEDFileCMesh::New(db);
1590 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1592 const MEDCouplingCMesh *tmp=self->getMesh();
1595 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1600 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1603 static MEDFileCurveLinearMesh *New();
1604 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1605 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1606 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1607 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1610 MEDFileCurveLinearMesh()
1612 return MEDFileCurveLinearMesh::New();
1615 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1617 return MEDFileCurveLinearMesh::New(fileName,mrs);
1620 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1622 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1625 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1627 return MEDFileCurveLinearMesh::New(db);
1630 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1632 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1635 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1640 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1643 static MEDFileMeshMultiTS *New();
1644 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1645 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1646 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1647 std::string getName() const throw(INTERP_KERNEL::Exception);
1648 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1649 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1652 MEDFileMeshMultiTS()
1654 return MEDFileMeshMultiTS::New();
1657 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1659 return MEDFileMeshMultiTS::New(fileName);
1662 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1664 return MEDFileMeshMultiTS::New(fileName,mName);
1667 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1669 MEDFileMesh *ret=self->getOneTimeStep();
1677 class MEDFileMeshesIterator
1682 PyObject *next() throw(INTERP_KERNEL::Exception)
1684 MEDFileMesh *ret=self->nextt();
1688 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1692 PyErr_SetString(PyExc_StopIteration,"No more data.");
1699 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1702 static MEDFileMeshes *New();
1703 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1704 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1705 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1706 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1708 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1709 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1710 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1711 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1712 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1717 return MEDFileMeshes::New();
1720 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1722 return MEDFileMeshes::New(fileName);
1725 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1727 return MEDFileMeshes::New(db);
1730 std::string __str__() const throw(INTERP_KERNEL::Exception)
1732 return self->simpleRepr();
1735 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1737 if(PyInt_Check(obj))
1739 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1744 else if(PyString_Check(obj))
1746 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1752 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1755 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1757 self->setMeshAtPos(obj,mesh);
1761 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1763 return self->iterator();
1766 int __len__() const throw(INTERP_KERNEL::Exception)
1768 return self->getNumberOfMeshes();
1771 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1773 MEDFileMesh *ret=self->getMeshAtPos(i);
1778 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1780 MEDFileMesh *ret=self->getMeshWithName(mname);
1788 class MEDFileFieldLoc : public RefCountObject
1791 std::string getName() const;
1792 int getDimension() const;
1793 int getNumberOfGaussPoints() const;
1794 int getNumberOfPointsInCells() const;
1795 const std::vector<double>& getRefCoords() const;
1796 const std::vector<double>& getGaussCoords() const;
1797 const std::vector<double>& getGaussWeights() const;
1798 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1801 std::string __str__() const throw(INTERP_KERNEL::Exception)
1803 return self->repr();
1808 class MEDFileFieldGlobsReal
1811 void resetContent();
1812 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1813 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1814 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1815 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1816 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1817 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1818 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1819 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1820 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1821 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1822 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1823 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1824 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1825 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1826 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1827 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1828 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1829 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1830 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1831 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1832 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1833 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1834 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1835 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1836 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1837 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1840 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1842 const DataArrayInt *ret=self->getProfile(pflName);
1845 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1848 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1850 const DataArrayInt *ret=self->getProfileFromId(pflId);
1853 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1856 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1858 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1861 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1864 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1866 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1869 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1872 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1874 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1875 return convertVecPairVecStToPy(ret);
1878 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1880 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1881 return convertVecPairVecStToPy(ret);
1884 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1886 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1887 self->changePflsNames(v);
1890 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1892 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1893 self->changePflsRefsNamesGen(v);
1896 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1898 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1899 self->changePflsNamesInStruct(v);
1902 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1904 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1905 self->changeLocsNames(v);
1908 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1910 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1911 self->changeLocsRefsNamesGen(v);
1914 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1916 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1917 self->changeLocsNamesInStruct(v);
1920 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1922 std::ostringstream oss;
1923 self->simpleReprGlobs(oss);
1929 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
1932 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1933 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1934 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1935 void loadArrays() throw(INTERP_KERNEL::Exception);
1936 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1937 void unloadArrays() throw(INTERP_KERNEL::Exception);
1938 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1939 int getDimension() const throw(INTERP_KERNEL::Exception);
1940 int getIteration() const throw(INTERP_KERNEL::Exception);
1941 int getOrder() const throw(INTERP_KERNEL::Exception);
1942 std::string getName() throw(INTERP_KERNEL::Exception);
1943 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1944 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1945 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1946 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1947 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1948 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1949 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1950 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1951 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1952 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1953 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1954 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1955 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
1956 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1957 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1960 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1963 double tmp0=self->getTime(tmp1,tmp2);
1964 PyObject *res = PyList_New(3);
1965 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1966 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1967 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1971 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1973 std::pair<int,int> res=self->getDtIt();
1974 PyObject *elt=PyTuple_New(2);
1975 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1976 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1980 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1982 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1985 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1987 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1990 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1992 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1993 return self->changeMeshNames(modifTab);
1996 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1998 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1999 PyObject *ret2=PyList_New(ret.size());
2000 for(int i=0;i<(int)ret.size();i++)
2001 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2005 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2007 std::vector<int> ret1;
2008 int ret0=self->getNonEmptyLevels(mname,ret1);
2009 PyObject *elt=PyTuple_New(2);
2010 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2011 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2015 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2017 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2018 std::vector< std::vector<TypeOfField> > typesF;
2019 std::vector< std::vector<std::string> > pfls;
2020 std::vector< std::vector<std::string> > locs;
2021 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2023 PyObject *ret2=PyList_New(sz);
2024 for(int i=0;i<sz;i++)
2026 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2027 const std::vector<TypeOfField>& typesFI=typesF[i];
2028 const std::vector<std::string>& pflsI=pfls[i];
2029 const std::vector<std::string>& locsI=locs[i];
2030 PyObject *elt=PyTuple_New(2);
2031 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2032 int sz2=ret[i].size();
2033 PyObject *elt2=PyList_New(sz2);
2034 for(int j=0;j<sz2;j++)
2036 PyObject *elt3=PyTuple_New(4);
2037 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2038 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));
2039 PyTuple_SetItem(elt3,1,elt4);
2040 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2041 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2042 PyList_SetItem(elt2,j,elt3);
2044 PyTuple_SetItem(elt,1,elt2);
2045 PyList_SetItem(ret2,i,elt);
2050 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2052 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2053 std::size_t sz=ret.size();
2054 PyObject *retPy=PyList_New(sz);
2055 for(std::size_t i=0;i<sz;i++)
2056 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2060 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2062 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2063 std::size_t sz=ret.size();
2064 PyObject *retPy=PyList_New(sz);
2065 for(std::size_t i=0;i<sz;i++)
2066 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2070 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2072 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2073 std::size_t sz=ret.size();
2074 PyObject *retPy=PyList_New(sz);
2075 for(std::size_t i=0;i<sz;i++)
2076 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2080 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2082 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2083 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2084 return self->extractPart(extractDefCpp,mm);
2089 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2092 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2093 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2094 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2095 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2096 static MEDFileField1TS *New();
2097 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2098 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2099 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2100 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2101 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2102 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2103 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2105 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2106 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2107 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2108 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2111 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2113 return MEDFileField1TS::New(fileName,loadAll);
2116 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2118 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2121 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2123 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2126 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2128 return MEDFileField1TS::New(db);
2133 return MEDFileField1TS::New();
2136 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2138 const DataArrayDouble *arr=0;
2140 arr=field->getArray();
2141 self->copyTinyInfoFrom(field,arr);
2144 std::string __str__() const throw(INTERP_KERNEL::Exception)
2146 return self->simpleRepr();
2149 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2151 DataArrayInt *ret1=0;
2152 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2153 PyObject *ret=PyTuple_New(2);
2154 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2155 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2159 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2161 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2162 std::vector< std::vector<TypeOfField> > typesF;
2163 std::vector< std::vector<std::string> > pfls;
2164 std::vector< std::vector<std::string> > locs;
2165 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2167 PyObject *ret2=PyList_New(sz);
2168 for(int i=0;i<sz;i++)
2170 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2171 const std::vector<TypeOfField>& typesFI=typesF[i];
2172 const std::vector<std::string>& pflsI=pfls[i];
2173 const std::vector<std::string>& locsI=locs[i];
2174 PyObject *elt=PyTuple_New(2);
2175 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2176 int sz2=ret[i].size();
2177 PyObject *elt2=PyList_New(sz2);
2178 for(int j=0;j<sz2;j++)
2180 PyObject *elt3=PyTuple_New(4);
2181 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2182 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2183 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2184 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2185 PyList_SetItem(elt2,j,elt3);
2187 PyTuple_SetItem(elt,1,elt2);
2188 PyList_SetItem(ret2,i,elt);
2193 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2195 DataArrayDouble *ret=self->getUndergroundDataArray();
2201 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2203 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2204 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2207 PyObject *ret=PyTuple_New(2);
2208 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2209 std::size_t sz=elt1Cpp.size();
2210 PyObject *elt=PyList_New(sz);
2211 for(std::size_t i=0;i<sz;i++)
2213 PyObject *elt1=PyTuple_New(2);
2214 PyObject *elt2=PyTuple_New(2);
2215 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2216 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2217 PyObject *elt3=PyTuple_New(2);
2218 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2219 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2220 PyTuple_SetItem(elt1,0,elt2);
2221 PyTuple_SetItem(elt1,1,elt3);
2222 PyList_SetItem(elt,i,elt1);
2224 PyTuple_SetItem(ret,1,elt);
2230 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2233 static MEDFileIntField1TS *New();
2234 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2235 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2236 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2237 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2238 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2240 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2241 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2242 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2243 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2244 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2245 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2246 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2247 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2250 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2252 return MEDFileIntField1TS::New();
2255 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2257 return MEDFileIntField1TS::New(fileName,loadAll);
2260 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2262 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2265 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2267 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2270 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2272 return MEDFileIntField1TS::New(db);
2275 std::string __str__() const throw(INTERP_KERNEL::Exception)
2277 return self->simpleRepr();
2280 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2282 DataArrayInt *ret1=0;
2283 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2284 PyObject *ret=PyTuple_New(2);
2285 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2286 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2290 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2292 DataArrayInt *ret=self->getUndergroundDataArray();
2300 class MEDFileAnyTypeFieldMultiTSIterator
2305 PyObject *next() throw(INTERP_KERNEL::Exception)
2307 MEDFileAnyTypeField1TS *ret=self->nextt();
2309 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2312 PyErr_SetString(PyExc_StopIteration,"No more data.");
2319 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2322 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2323 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2324 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2325 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2326 std::string getName() const throw(INTERP_KERNEL::Exception);
2327 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2328 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2329 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2330 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2331 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2332 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2333 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2334 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2335 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2336 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2337 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2338 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2339 void loadArrays() throw(INTERP_KERNEL::Exception);
2340 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2341 void unloadArrays() throw(INTERP_KERNEL::Exception);
2342 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2344 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2345 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2346 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2347 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2348 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2349 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2352 int __len__() const throw(INTERP_KERNEL::Exception)
2354 return self->getNumberOfTS();
2357 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2359 if(elt0 && PyInt_Check(elt0))
2361 int pos=PyInt_AS_LONG(elt0);
2364 else if(elt0 && PyTuple_Check(elt0))
2366 if(PyTuple_Size(elt0)==2)
2368 PyObject *o0=PyTuple_GetItem(elt0,0);
2369 PyObject *o1=PyTuple_GetItem(elt0,1);
2370 if(PyInt_Check(o0) && PyInt_Check(o1))
2372 int iter=PyInt_AS_LONG(o0);
2373 int order=PyInt_AS_LONG(o1);
2374 return self->getPosOfTimeStep(iter,order);
2377 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 !");
2380 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 !");
2382 else if(elt0 && PyFloat_Check(elt0))
2384 double val=PyFloat_AS_DOUBLE(elt0);
2385 return self->getPosGivenTime(val);
2388 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2391 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2393 std::vector< std::pair<int,int> > res(self->getIterations());
2394 return convertVecPairIntToPy(res);
2397 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2399 std::vector<double> ret1;
2400 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2401 std::size_t sz=ret.size();
2402 PyObject *ret2=PyList_New(sz);
2403 for(std::size_t i=0;i<sz;i++)
2405 PyObject *elt=PyTuple_New(3);
2406 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2407 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2408 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2409 PyList_SetItem(ret2,i,elt);
2414 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2416 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2417 PyObject *ret2=PyList_New(ret.size());
2418 for(int i=0;i<(int)ret.size();i++)
2420 const std::vector<TypeOfField>& rett=ret[i];
2421 PyObject *ret3=PyList_New(rett.size());
2422 for(int j=0;j<(int)rett.size();j++)
2423 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2424 PyList_SetItem(ret2,i,ret3);
2429 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2431 std::vector<int> ret1;
2432 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2433 PyObject *elt=PyTuple_New(2);
2434 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2435 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2439 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2441 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2442 std::vector< std::vector<TypeOfField> > typesF;
2443 std::vector< std::vector<std::string> > pfls;
2444 std::vector< std::vector<std::string> > locs;
2445 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2447 PyObject *ret2=PyList_New(sz);
2448 for(int i=0;i<sz;i++)
2450 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2451 const std::vector<TypeOfField>& typesFI=typesF[i];
2452 const std::vector<std::string>& pflsI=pfls[i];
2453 const std::vector<std::string>& locsI=locs[i];
2454 PyObject *elt=PyTuple_New(2);
2455 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2456 int sz2=ret[i].size();
2457 PyObject *elt2=PyList_New(sz2);
2458 for(int j=0;j<sz2;j++)
2460 PyObject *elt3=PyTuple_New(4);
2461 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2462 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));
2463 PyTuple_SetItem(elt3,1,elt4);
2464 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2465 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2466 PyList_SetItem(elt2,j,elt3);
2468 PyTuple_SetItem(elt,1,elt2);
2469 PyList_SetItem(ret2,i,elt);
2474 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2476 if(PyList_Check(elts))
2478 int sz=PyList_Size(elts);
2479 std::vector<int> ret(sz);
2480 for(int i=0;i<sz;i++)
2482 PyObject *elt=PyList_GetItem(elts,i);
2483 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2489 std::vector<int> ret(1);
2490 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2495 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2497 if(PySlice_Check(elts))
2499 Py_ssize_t strt=2,stp=2,step=2;
2500 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2501 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2502 self->eraseTimeStepIds2(strt,stp,step);
2506 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2507 if(!idsToRemove.empty())
2508 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2512 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2516 std::vector<int> pos2;
2517 DataArrayInt *pos3=0;
2518 DataArrayIntTuple *pos4=0;
2519 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2524 self->eraseTimeStepIds(&pos1,&pos1+1);
2531 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2536 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2540 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2544 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2546 return self->iterator();
2549 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2551 if(elt0 && PyList_Check(elt0))
2553 int sz=PyList_Size(elt0);
2554 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2555 int *pt=da->getPointer();
2556 for(int i=0;i<sz;i++,pt++)
2558 PyObject *elt1=PyList_GetItem(elt0,i);
2559 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2561 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2563 else if(elt0 && PySlice_Check(elt0))
2565 Py_ssize_t strt=2,stp=2,step=2;
2566 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2567 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2568 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2571 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2574 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2576 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2577 return self->changeMeshNames(modifTab);
2580 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2582 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2583 std::size_t sz=ret.size();
2584 PyObject *retPy=PyList_New(sz);
2585 for(std::size_t i=0;i<sz;i++)
2586 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2590 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2592 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2593 std::size_t sz=ret.size();
2594 PyObject *retPy=PyList_New(sz);
2595 for(std::size_t i=0;i<sz;i++)
2596 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2600 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2602 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2603 std::size_t sz=ret.size();
2604 PyObject *retPy=PyList_New(sz);
2605 for(std::size_t i=0;i<sz;i++)
2606 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2610 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2613 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2614 if(SWIG_IsOK(status))
2616 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2620 std::vector<MEDFileAnyTypeField1TS *> tmp;
2621 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2622 self->pushBackTimeSteps(tmp);
2626 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2628 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2629 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2630 return self->extractPart(extractDefCpp,mm);
2633 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2635 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2636 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2637 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2638 std::size_t sz=ret.size();
2639 PyObject *retPy=PyList_New(sz);
2640 for(std::size_t i=0;i<sz;i++)
2642 std::size_t sz2=ret[i].size();
2643 PyObject *ret1Py=PyList_New(sz2);
2644 for(std::size_t j=0;j<sz2;j++)
2646 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2649 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2651 PyList_SetItem(retPy,i,ret1Py);
2656 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2658 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2659 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2660 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2661 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2662 if(ret2.size()!=ret.size())
2664 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2665 throw INTERP_KERNEL::Exception(oss.str().c_str());
2667 std::size_t sz=ret.size();
2668 PyObject *retPy=PyList_New(sz);
2669 for(std::size_t i=0;i<sz;i++)
2671 std::size_t sz2=ret[i].size();
2672 PyObject *ret0Py=PyTuple_New(2);
2673 PyObject *ret1Py=PyList_New(sz2);
2674 for(std::size_t j=0;j<sz2;j++)
2676 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2679 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2681 PyTuple_SetItem(ret0Py,0,ret1Py);
2682 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2683 PyList_SetItem(retPy,i,ret0Py);
2690 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2693 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2694 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2695 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2697 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2698 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2699 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2700 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2701 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2702 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2704 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2705 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2706 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2709 MEDFileFieldMultiTS()
2711 return MEDFileFieldMultiTS::New();
2714 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2716 return MEDFileFieldMultiTS::New(fileName,loadAll);
2719 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2721 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2724 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2726 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2727 std::size_t sz(tmp.size());
2728 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2729 for(std::size_t i=0;i<sz;i++)
2731 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2732 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2734 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2737 std::string __str__() const throw(INTERP_KERNEL::Exception)
2739 return self->simpleRepr();
2742 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2744 DataArrayInt *ret1=0;
2745 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2746 PyObject *ret=PyTuple_New(2);
2747 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2748 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2752 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2754 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2755 std::vector< std::vector<TypeOfField> > typesF;
2756 std::vector< std::vector<std::string> > pfls;
2757 std::vector< std::vector<std::string> > locs;
2758 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2760 PyObject *ret2=PyList_New(sz);
2761 for(int i=0;i<sz;i++)
2763 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2764 const std::vector<TypeOfField>& typesFI=typesF[i];
2765 const std::vector<std::string>& pflsI=pfls[i];
2766 const std::vector<std::string>& locsI=locs[i];
2767 PyObject *elt=PyTuple_New(2);
2768 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2769 int sz2=ret[i].size();
2770 PyObject *elt2=PyList_New(sz2);
2771 for(int j=0;j<sz2;j++)
2773 PyObject *elt3=PyTuple_New(4);
2774 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2775 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2776 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2777 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2778 PyList_SetItem(elt2,j,elt3);
2780 PyTuple_SetItem(elt,1,elt2);
2781 PyList_SetItem(ret2,i,elt);
2785 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2787 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2793 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2795 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2796 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2799 PyObject *ret=PyTuple_New(2);
2800 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2801 std::size_t sz=elt1Cpp.size();
2802 PyObject *elt=PyList_New(sz);
2803 for(std::size_t i=0;i<sz;i++)
2805 PyObject *elt1=PyTuple_New(2);
2806 PyObject *elt2=PyTuple_New(2);
2807 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2808 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2809 PyObject *elt3=PyTuple_New(2);
2810 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2811 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2812 PyTuple_SetItem(elt1,0,elt2);
2813 PyTuple_SetItem(elt1,1,elt3);
2814 PyList_SetItem(elt,i,elt1);
2816 PyTuple_SetItem(ret,1,elt);
2822 class MEDFileFieldsIterator
2827 PyObject *next() throw(INTERP_KERNEL::Exception)
2829 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2831 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2834 PyErr_SetString(PyExc_StopIteration,"No more data.");
2841 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2844 static MEDFileIntFieldMultiTS *New();
2845 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2846 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2847 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2849 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2850 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2851 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2852 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2853 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2854 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2855 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2856 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2857 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2860 MEDFileIntFieldMultiTS()
2862 return MEDFileIntFieldMultiTS::New();
2865 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2867 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2870 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2872 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2875 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2877 return MEDFileIntFieldMultiTS::New(db);
2880 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2882 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2883 std::size_t sz(tmp.size());
2884 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2885 for(std::size_t i=0;i<sz;i++)
2887 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2888 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2890 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2893 std::string __str__() const throw(INTERP_KERNEL::Exception)
2895 return self->simpleRepr();
2898 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2900 DataArrayInt *ret1=0;
2901 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2902 PyObject *ret=PyTuple_New(2);
2903 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2904 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2908 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2910 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2918 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2921 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2922 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2923 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2924 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2925 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
2926 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2927 void loadArrays() throw(INTERP_KERNEL::Exception);
2928 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2929 void unloadArrays() throw(INTERP_KERNEL::Exception);
2930 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2931 int getNumberOfFields() const;
2932 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2933 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2935 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2936 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2937 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2938 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2939 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2940 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2941 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2942 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2943 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2948 return MEDFileFields::New();
2951 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2953 return MEDFileFields::New(fileName,loadAll);
2956 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2958 return MEDFileFields::New(db);
2961 std::string __str__() const throw(INTERP_KERNEL::Exception)
2963 return self->simpleRepr();
2966 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2968 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2969 std::size_t sz(tmp.size());
2970 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2971 for(std::size_t i=0;i<sz;i++)
2973 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2974 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2976 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2979 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2982 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2983 PyObject *ret=PyTuple_New(2);
2984 PyObject *ret_0=PyList_New(ret0.size());
2986 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2988 PyObject *elt=PyTuple_New(2);
2989 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2990 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2991 PyList_SetItem(ret_0,rk,elt);
2993 PyTuple_SetItem(ret,0,ret_0);
2994 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2995 PyTuple_SetItem(ret,1,ret_1);
2999 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3001 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3002 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3005 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3007 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3008 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3011 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3013 if(obj && PyList_Check(obj))
3015 int sz=PyList_Size(obj);
3016 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3017 int *pt=da->getPointer();
3018 for(int i=0;i<sz;i++,pt++)
3020 PyObject *elt1=PyList_GetItem(obj,i);
3021 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3023 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3026 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3029 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3031 self->setFieldAtPos(obj,field);
3035 int __len__() const throw(INTERP_KERNEL::Exception)
3037 return self->getNumberOfFields();
3040 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3042 return self->iterator();
3045 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3047 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3048 return self->changeMeshNames(modifTab);
3051 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3053 if(elt0 && PyInt_Check(elt0))
3055 return PyInt_AS_LONG(elt0);
3057 else if(elt0 && PyString_Check(elt0))
3058 return self->getPosFromFieldName(PyString_AsString(elt0));
3060 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3063 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3065 if(PyList_Check(elts))
3067 int sz=PyList_Size(elts);
3068 std::vector<int> ret(sz);
3069 for(int i=0;i<sz;i++)
3071 PyObject *elt=PyList_GetItem(elts,i);
3072 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3078 std::vector<int> ret(1);
3079 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3084 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3086 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3087 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3088 self->pushFields(tmp);
3091 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3093 if(elts && PySlice_Check(elts))
3095 Py_ssize_t strt=2,stp=2,step=2;
3096 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3097 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3098 self->destroyFieldsAtPos2(strt,stp,step);
3102 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3103 if(!idsToRemove.empty())
3104 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3108 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3110 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3111 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3112 return self->extractPart(extractDefCpp,mm);
3117 class MEDFileParameter1TS : public RefCountObject
3120 void setIteration(int it);
3121 int getIteration() const;
3122 void setOrder(int order);
3123 int getOrder() const;
3124 void setTimeValue(double time);
3125 void setTime(int dt, int it, double time);
3126 double getTime(int& dt, int& it);
3127 double getTimeValue() const;
3130 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3133 void setValue(double val) throw(INTERP_KERNEL::Exception);
3134 double getValue() const throw(INTERP_KERNEL::Exception);
3135 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3138 std::string __str__() const throw(INTERP_KERNEL::Exception)
3140 return self->simpleRepr();
3145 class MEDFileParameterTinyInfo : public MEDFileWritable
3148 void setDescription(const std::string& name);
3149 std::string getDescription() const;
3150 void setTimeUnit(const std::string& unit);
3151 std::string getTimeUnit() const;
3154 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3157 static MEDFileParameterDouble1TS *New();
3158 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3159 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3160 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3161 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3162 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3163 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3164 std::string getName() const throw(INTERP_KERNEL::Exception);
3165 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3168 MEDFileParameterDouble1TS()
3170 return MEDFileParameterDouble1TS::New();
3173 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3175 return MEDFileParameterDouble1TS::New(fileName);
3178 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3180 return MEDFileParameterDouble1TS::New(fileName,paramName);
3183 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3185 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3188 std::string __str__() const throw(INTERP_KERNEL::Exception)
3190 return self->simpleRepr();
3193 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3196 bool ret0=self->isEqual(other,eps,what);
3197 PyObject *res=PyList_New(2);
3198 PyObject *ret0Py=ret0?Py_True:Py_False;
3200 PyList_SetItem(res,0,ret0Py);
3201 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3207 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3210 static MEDFileParameterMultiTS *New();
3211 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3212 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3213 std::string getName() const;
3214 void setName(const std::string& name);
3215 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3216 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3217 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3218 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3219 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3220 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3221 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3222 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3225 MEDFileParameterMultiTS()
3227 return MEDFileParameterMultiTS::New();
3230 MEDFileParameterMultiTS(const std::string& fileName)
3232 return MEDFileParameterMultiTS::New(fileName);
3235 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3237 return MEDFileParameterMultiTS::New(fileName,paramName);
3240 std::string __str__() const throw(INTERP_KERNEL::Exception)
3242 return self->simpleRepr();
3245 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3248 bool ret0=self->isEqual(other,eps,what);
3249 PyObject *res=PyList_New(2);
3250 PyObject *ret0Py=ret0?Py_True:Py_False;
3252 PyList_SetItem(res,0,ret0Py);
3253 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3257 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3261 std::vector<int> pos2;
3262 DataArrayInt *pos3=0;
3263 DataArrayIntTuple *pos4=0;
3264 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3269 self->eraseTimeStepIds(&pos1,&pos1+1);
3276 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3281 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3285 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3289 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3291 if(elt0 && PyInt_Check(elt0))
3293 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3296 else if(elt0 && PyTuple_Check(elt0))
3298 if(PyTuple_Size(elt0)==2)
3300 PyObject *o0=PyTuple_GetItem(elt0,0);
3301 PyObject *o1=PyTuple_GetItem(elt0,1);
3302 if(PyInt_Check(o0) && PyInt_Check(o1))
3304 int iter=PyInt_AS_LONG(o0);
3305 int order=PyInt_AS_LONG(o1);
3306 return self->getPosOfTimeStep(iter,order);
3309 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 !");
3312 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 !");
3314 else if(elt0 && PyFloat_Check(elt0))
3316 double val=PyFloat_AS_DOUBLE(elt0);
3317 return self->getPosGivenTime(val);
3320 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3323 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3325 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3331 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3333 if(PyList_Check(elts))
3335 int sz=PyList_Size(elts);
3336 std::vector<int> ret(sz);
3337 for(int i=0;i<sz;i++)
3339 PyObject *elt=PyList_GetItem(elts,i);
3340 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3346 std::vector<int> ret(1);
3347 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3352 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3354 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3355 if(!idsToRemove.empty())
3356 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3359 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3361 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3367 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3369 std::vector< std::pair<int,int> > res=self->getIterations();
3370 PyObject *ret=PyList_New(res.size());
3372 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3374 PyObject *elt=PyTuple_New(2);
3375 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3376 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3377 PyList_SetItem(ret,rk,elt);
3382 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3384 std::vector<double> res2;
3385 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3386 PyObject *ret=PyList_New(res.size());
3388 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3390 PyObject *elt=PyTuple_New(3);
3391 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3392 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3393 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3394 PyList_SetItem(ret,rk,elt);
3401 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3404 static MEDFileParameters *New();
3405 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3406 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3407 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3408 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3409 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3410 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3411 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3412 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3413 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3414 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3415 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3420 return MEDFileParameters::New();
3423 MEDFileParameters(const std::string& fileName)
3425 return MEDFileParameters::New(fileName);
3428 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3430 return MEDFileParameters::New(db);
3433 std::string __str__() const throw(INTERP_KERNEL::Exception)
3435 return self->simpleRepr();
3438 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3440 if(PyInt_Check(obj))
3442 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3447 else if(PyString_Check(obj))
3449 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3455 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3458 int __len__() const throw(INTERP_KERNEL::Exception)
3460 return self->getNumberOfParams();
3463 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3465 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3471 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3473 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3479 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3482 bool ret0=self->isEqual(other,eps,what);
3483 PyObject *res=PyList_New(2);
3484 PyObject *ret0Py=ret0?Py_True:Py_False;
3486 PyList_SetItem(res,0,ret0Py);
3487 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3493 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3496 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3497 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3498 static MEDFileData *New();
3499 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3500 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3501 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3502 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3503 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3504 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3505 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3507 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3508 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3512 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3514 return MEDFileData::New(fileName);
3517 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3519 return MEDFileData::New(db);
3524 return MEDFileData::New();
3527 std::string __str__() const throw(INTERP_KERNEL::Exception)
3529 return self->simpleRepr();
3532 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3534 MEDFileMeshes *ret=self->getMeshes();
3540 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3542 MEDFileParameters *ret=self->getParams();
3548 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3550 MEDFileFields *ret=self->getFields();
3556 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3558 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3559 return self->changeMeshNames(modifTab);
3562 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3564 std::vector<const MEDFileData *> mfdsCpp;
3565 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3566 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3572 class SauvReader : public RefCountObject
3575 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3576 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3579 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3581 return SauvReader::New(fileName);
3586 class SauvWriter : public RefCountObject
3589 static SauvWriter * New();
3590 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3591 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3592 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3593 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3596 SauvWriter() throw(INTERP_KERNEL::Exception)
3598 return SauvWriter::New();
3605 class MEDFileMeshStruct;
3607 class MEDFileField1TSStructItem
3610 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3613 class MEDFileMeshStruct : public RefCountObject
3616 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3618 ~MEDFileMeshStruct();
3621 class MEDMeshMultiLev : public RefCountObject
3624 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3625 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3626 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3632 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3634 DataArrayInt *famIds(0);
3635 bool isWithoutCopy(false);
3636 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3637 PyObject *ret=PyTuple_New(2);
3638 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3640 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3641 PyTuple_SetItem(ret,1,ret1Py);
3645 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3647 DataArrayInt *numIds(0);
3648 bool isWithoutCopy(false);
3649 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3650 PyObject *ret=PyTuple_New(2);
3651 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3653 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3654 PyTuple_SetItem(ret,1,ret1Py);
3658 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3660 DataArrayInt *famIds(0);
3661 bool isWithoutCopy(false);
3662 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3663 PyObject *ret=PyTuple_New(2);
3664 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3666 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3667 PyTuple_SetItem(ret,1,ret1Py);
3671 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3673 DataArrayInt *numIds(0);
3674 bool isWithoutCopy(false);
3675 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3676 PyObject *ret=PyTuple_New(2);
3677 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3679 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3680 PyTuple_SetItem(ret,1,ret1Py);
3684 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3686 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3687 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3688 PyObject *res(PyList_New(result.size()));
3689 for(int i=0;iL!=result.end(); i++, iL++)
3690 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3696 class MEDUMeshMultiLev : public MEDMeshMultiLev
3699 ~MEDUMeshMultiLev();
3703 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3705 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3706 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3707 PyObject *ret0Py=ncc?Py_True:Py_False;
3709 PyObject *ret=PyTuple_New(7);
3710 PyTuple_SetItem(ret,0,ret0Py);
3711 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3712 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3713 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3714 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3715 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3716 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3722 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3725 ~MEDStructuredMeshMultiLev();
3728 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3731 ~MEDCMeshMultiLev();
3735 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3738 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3739 std::size_t sz(objs.size());
3740 PyObject *ret(PyTuple_New(2));
3741 PyObject *ret0=PyList_New(sz);
3742 for(std::size_t i=0;i<sz;i++)
3743 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3744 PyTuple_SetItem(ret,0,ret0);
3745 PyObject *ret1Py(isInternal?Py_True:Py_False);
3747 PyTuple_SetItem(ret,1,ret1Py);
3753 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3756 ~MEDCurveLinearMeshMultiLev();
3760 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3762 DataArrayDouble *ret0(0);
3763 std::vector<int> ret1;
3765 self->buildVTUArrays(ret0,ret1,ret2);
3766 std::size_t sz(ret1.size());
3767 PyObject *ret=PyTuple_New(3);
3768 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3769 PyObject *ret1Py=PyList_New(sz);
3770 for(std::size_t i=0;i<sz;i++)
3771 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3772 PyTuple_SetItem(ret,1,ret1Py);
3773 PyObject *ret2Py(ret2?Py_True:Py_False);
3775 PyTuple_SetItem(ret,2,ret2Py);
3781 class MEDFileFastCellSupportComparator : public RefCountObject
3784 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3785 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3786 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3787 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3789 ~MEDFileFastCellSupportComparator();
3793 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3795 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3796 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3797 PyObject *res(PyList_New(result.size()));
3798 for(int i=0;iL!=result.end(); i++, iL++)
3799 PyList_SetItem(res,i,PyInt_FromLong(*iL));