1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
33 #include "MEDLoader.hxx"
34 #include "MEDFileJoint.hxx"
35 #include "MEDFileMesh.hxx"
36 #include "MEDFileField.hxx"
37 #include "MEDFileParameter.hxx"
38 #include "MEDFileData.hxx"
39 #include "MEDFileEquivalence.hxx"
40 #include "MEDFileMeshReadSelector.hxx"
41 #include "MEDFileFieldOverView.hxx"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
46 using namespace MEDCoupling;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) MEDCoupling::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) MEDCoupling::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) MEDCoupling::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject ReadUMeshFromFamiliesSwig;
79 %newobject ReadUMeshFromGroupsSwig;
80 %newobject MEDCoupling::ReadUMeshFromFile;
81 %newobject MEDCoupling::ReadMeshFromFile;
82 %newobject MEDCoupling::ReadField;
83 %newobject MEDCoupling::ReadFieldCell;
84 %newobject MEDCoupling::ReadFieldNode;
85 %newobject MEDCoupling::ReadFieldGauss;
86 %newobject MEDCoupling::ReadFieldGaussNE;
87 %newobject MEDCoupling::MEDFileMesh::New;
88 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
89 %newobject MEDCoupling::MEDFileMesh::deepCopy;
90 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
91 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
92 %newobject MEDCoupling::MEDFileMesh::__getitem__;
93 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
94 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
95 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
97 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
101 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
104 %newobject MEDCoupling::MEDFileMesh::cartesianize;
105 %newobject MEDCoupling::MEDFileData::getJoints;
106 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject MEDCoupling::MEDFileUMesh::New;
108 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
109 %newobject MEDCoupling::MEDFileUMesh::getCoords;
110 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
111 %newobject MEDCoupling::MEDFileUMesh::getGroup;
112 %newobject MEDCoupling::MEDFileUMesh::getGroups;
113 %newobject MEDCoupling::MEDFileUMesh::getFamily;
114 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
115 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
116 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
120 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
121 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
123 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
124 %newobject MEDCoupling::MEDFileUMesh::extractPart;
125 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
126 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
127 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
128 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
129 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
130 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
131 %newobject MEDCoupling::MEDFileCMesh::New;
132 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
133 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
134 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
136 %newobject MEDCoupling::MEDFileMeshes::New;
137 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
138 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
139 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
140 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
141 %newobject MEDCoupling::MEDFileMeshes::__iter__;
143 %newobject MEDCoupling::MEDFileFields::New;
144 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
145 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
146 %newobject MEDCoupling::MEDFileFields::deepCopy;
147 %newobject MEDCoupling::MEDFileFields::shallowCpy;
148 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
149 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
150 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
151 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
152 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
153 %newobject MEDCoupling::MEDFileFields::__iter__;
154 %newobject MEDCoupling::MEDFileFields::extractPart;
156 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
157 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
158 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
159 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
160 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
161 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
162 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
163 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
164 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
165 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
166 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
167 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
168 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
169 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
170 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
171 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
172 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
173 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
174 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
175 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
176 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
177 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
178 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
179 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
180 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
181 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
182 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
184 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
185 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
186 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
187 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
188 %newobject MEDCoupling::MEDFileField1TS::New;
189 %newobject MEDCoupling::MEDFileField1TS::field;
190 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
191 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
192 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
193 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
194 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
195 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
197 %newobject MEDCoupling::MEDFileIntField1TS::New;
198 %newobject MEDCoupling::MEDFileIntField1TS::field;
199 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
200 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
201 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
202 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
203 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
204 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
206 %newobject MEDCoupling::MEDFileData::New;
207 %newobject MEDCoupling::MEDFileData::deepCopy;
208 %newobject MEDCoupling::MEDFileData::getMeshes;
209 %newobject MEDCoupling::MEDFileData::getFields;
210 %newobject MEDCoupling::MEDFileData::getParams;
211 %newobject MEDCoupling::MEDFileData::Aggregate;
213 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
214 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
215 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
216 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
217 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
218 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
219 %newobject MEDCoupling::MEDFileParameters::New;
220 %newobject MEDCoupling::MEDFileParameters::deepCopy;
221 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
222 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
223 %newobject MEDCoupling::MEDFileParameters::__getitem__;
225 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
226 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
227 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
228 %newobject MEDCoupling::MEDFileJointOneStep::New;
229 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
230 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
231 %newobject MEDCoupling::MEDFileJoint::New;
232 %newobject MEDCoupling::MEDFileJoint::deepCopy;
233 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
234 %newobject MEDCoupling::MEDFileJoints::New;
235 %newobject MEDCoupling::MEDFileJoints::deepCopy;
236 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
237 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
238 %newobject MEDCoupling::MEDFileJoints::__getitem__;
239 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
240 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
241 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
242 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
243 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
244 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
245 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
246 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
247 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
249 %newobject MEDCoupling::SauvWriter::New;
250 %newobject MEDCoupling::SauvReader::New;
251 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
253 %newobject MEDCoupling::MEDFileMeshStruct::New;
254 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
255 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
256 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
257 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
258 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
260 %feature("unref") MEDFileMesh "$this->decrRef();"
261 %feature("unref") MEDFileUMesh "$this->decrRef();"
262 %feature("unref") MEDFileCMesh "$this->decrRef();"
263 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
264 %feature("unref") MEDFileMeshes "$this->decrRef();"
265 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
266 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
267 %feature("unref") MEDFileField1TS "$this->decrRef();"
268 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
269 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
270 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
271 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
272 %feature("unref") MEDFileFields "$this->decrRef();"
273 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
274 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
275 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
276 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
277 %feature("unref") MEDFileParameters "$this->decrRef();"
278 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
279 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
280 %feature("unref") MEDFileJoint "$this->decrRef();"
281 %feature("unref") MEDFileJoints "$this->decrRef();"
282 %feature("unref") MEDFileEquivalences "$this->decrRef();"
283 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
284 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
285 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
286 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
287 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
288 %feature("unref") MEDFileData "$this->decrRef();"
289 %feature("unref") SauvReader "$this->decrRef();"
290 %feature("unref") SauvWriter "$this->decrRef();"
291 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
292 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
293 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
294 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
295 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
296 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
298 namespace MEDCoupling
301 std::string MEDFileVersionStr();
302 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
303 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
304 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
305 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
306 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
307 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
308 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
309 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
310 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
311 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
312 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
313 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
314 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
315 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
316 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
317 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
318 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
319 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
320 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
321 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
322 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
323 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
324 MEDCoupling::MEDCouplingFieldDouble *ReadField(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
325 MEDCoupling::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
326 MEDCoupling::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
327 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
328 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
329 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
330 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
331 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
332 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
333 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
334 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
337 %rename (MEDFileVersion) MEDFileVersionSwig;
338 %rename (GetFieldIterations) GetFieldIterationsSwig;
339 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
340 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
341 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
342 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
343 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
344 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
345 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
346 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
347 %rename (WriteUMeshes) WriteUMeshesSwig;
348 %rename (GetTypesOfField) GetTypesOfFieldSwig;
349 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
350 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
354 PyObject *MEDFileVersionSwig()
356 int major,minor,release;
357 MEDCoupling::MEDFileVersion(major,minor,release);
358 PyObject *ret(PyTuple_New(3));
359 PyTuple_SetItem(ret,0,SWIG_From_int(major));
360 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
361 PyTuple_SetItem(ret,2,SWIG_From_int(release));
365 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
367 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
368 PyObject *ret=PyList_New(res.size());
370 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
372 PyObject *elt=PyTuple_New(2);
373 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
374 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
375 PyList_SetItem(ret,rk,elt);
380 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
382 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
383 PyObject *ret=PyList_New(res.size());
385 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
387 PyObject *elt=PyTuple_New(3);
388 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
389 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
390 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
391 PyList_SetItem(ret,rk,elt);
396 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
398 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
399 PyObject *ret=PyList_New(res.size());
401 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
403 PyObject *elt=PyTuple_New(2);
404 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
405 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
406 PyList_SetItem(ret,rk,elt);
411 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
413 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
414 PyObject *ret=PyList_New(res.size());
416 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
418 PyObject *elt=PyTuple_New(2);
419 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
420 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
421 PyList_SetItem(ret,rk,elt);
426 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
428 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
429 PyObject *ret=PyList_New(res.size());
431 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
433 PyObject *elt=PyTuple_New(2);
434 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
435 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
436 PyList_SetItem(ret,rk,elt);
441 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
443 int meshDim,spaceDim,numberOfNodes;
444 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
445 PyObject *ret=PyTuple_New(4);
446 PyObject *elt0=PyList_New(res.size());
448 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
450 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
452 PyObject *elt1=PyList_New(obj2.size());
453 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
455 PyObject *elt2=PyTuple_New(2);
456 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
457 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
458 PyList_SetItem(elt1,j,elt2);
460 PyList_SetItem(elt0,i,elt1);
462 PyTuple_SetItem(ret,0,elt0);
463 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
464 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
465 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
469 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
470 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
472 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
473 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
474 return convertFieldDoubleVecToPy(res);
477 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
479 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
480 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
481 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
484 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
486 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
487 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
488 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
491 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
493 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
494 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
495 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
498 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
500 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
502 PyObject *ret=PyList_New(size);
503 for(int i=0;i<size;i++)
504 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
508 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
510 std::vector<std::string> grps;
511 converPyListToVecString(li,grps);
512 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
515 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
517 std::vector<std::string> fams;
518 converPyListToVecString(li,fams);
519 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
523 namespace MEDCoupling
525 class MEDFileWritable
528 void copyOptionsFrom(const MEDFileWritable& other) const;
529 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
530 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
531 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
532 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
535 class MEDFileWritableStandAlone : public MEDFileWritable
538 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
541 class MEDFileMeshReadSelector
544 MEDFileMeshReadSelector();
545 MEDFileMeshReadSelector(unsigned int code);
546 unsigned int getCode() const;
547 void setCode(unsigned int newCode);
548 bool isCellFamilyFieldReading() const;
549 bool isNodeFamilyFieldReading() const;
550 bool isCellNameFieldReading() const;
551 bool isNodeNameFieldReading() const;
552 bool isCellNumFieldReading() const;
553 bool isNodeNumFieldReading() const;
554 void setCellFamilyFieldReading(bool b);
555 void setNodeFamilyFieldReading(bool b);
556 void setCellNameFieldReading(bool b);
557 void setNodeNameFieldReading(bool b);
558 void setCellNumFieldReading(bool b);
559 void setNodeNumFieldReading(bool b);
562 std::string __str__() const throw(INTERP_KERNEL::Exception)
564 std::ostringstream oss;
569 std::string __repr__() const throw(INTERP_KERNEL::Exception)
571 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
577 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
580 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
581 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
582 throw(INTERP_KERNEL::Exception);
583 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
584 INTERP_KERNEL::NormalizedCellType loc_geo_type,
585 INTERP_KERNEL::NormalizedCellType rem_geo_type)
586 throw(INTERP_KERNEL::Exception);
587 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
588 MEDFileJointCorrespondence *deepCopy() const;
589 MEDFileJointCorrespondence *shallowCpy() const;
590 void setIsNodal(bool isNodal);
591 bool getIsNodal() const;
592 bool isEqual(const MEDFileJointCorrespondence *other) const;
593 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
594 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
595 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
596 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
597 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
598 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
599 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);
600 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
603 MEDFileJointCorrespondence()
605 return MEDFileJointCorrespondence::New();
607 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
609 return MEDFileJointCorrespondence::New(correspondence);
611 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
612 INTERP_KERNEL::NormalizedCellType loc_geo_type,
613 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
615 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
618 std::string __str__() const throw(INTERP_KERNEL::Exception)
620 return self->simpleRepr();
625 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
628 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
629 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
630 MEDFileJointOneStep *deepCopy() const;
631 MEDFileJointOneStep *shallowCpy() const;
632 bool isEqual(const MEDFileJointOneStep *other) const;
633 void setOrder(int order);
634 int getOrder() const;
635 void setIteration(int it);
636 int getIteration() const;
637 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
638 int getNumberOfCorrespondences() const;
639 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
640 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
641 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
644 MEDFileJointOneStep()
646 return MEDFileJointOneStep::New();
649 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
651 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
654 std::string __str__() const throw(INTERP_KERNEL::Exception)
656 return self->simpleRepr();
661 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
664 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
665 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
666 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
667 MEDFileJoint *deepCopy() const;
668 MEDFileJoint *shallowCpy() const;
669 bool isEqual(const MEDFileJoint *other) const;
670 void setLocalMeshName(const std::string& name);
671 std::string getLocalMeshName() const;
672 void setRemoteMeshName(const std::string& name);
673 std::string getRemoteMeshName() const;
674 void setDescription(const std::string& name);
675 std::string getDescription() const;
676 void setJointName(const std::string& name);
677 std::string getJointName() const;
678 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
679 void setDomainNumber(const int& number);
680 int getDomainNumber() const;
681 void pushStep(MEDFileJointOneStep* step);
682 int getNumberOfSteps() const;
683 MEDFileJointOneStep *getStepAtPos(int i) const;
684 std::string simpleRepr() const;
689 return MEDFileJoint::New();
692 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
694 return MEDFileJoint::New(fileName,mName,num);
697 std::string __str__() const throw(INTERP_KERNEL::Exception)
699 return self->simpleRepr();
704 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
707 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
708 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
709 MEDFileJoints *deepCopy() const;
710 std::string simpleRepr() const;
711 std::string getMeshName() const;
712 int getNumberOfJoints() const;
713 std::vector<std::string> getJointsNames() const;
714 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
715 void resize(int newSize) throw(INTERP_KERNEL::Exception);
716 void pushJoint(MEDFileJoint *joint);
717 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
718 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
723 return MEDFileJoints::New();
726 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
728 return MEDFileJoints::New(fileName,meshName);
731 std::string __str__() const throw(INTERP_KERNEL::Exception)
733 return self->simpleRepr();
736 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
740 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
745 else if(PyString_Check(obj))
747 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
753 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
756 int __len__() const throw(INTERP_KERNEL::Exception)
758 return self->getNumberOfJoints();
761 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
763 MEDFileJoint *ret=self->getJointAtPos(i);
769 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
771 MEDFileJoint *ret=self->getJointWithName(paramName);
779 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
782 MEDFileEquivalenceBase();
785 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
788 MEDFileEquivalenceData();
790 void setArray(DataArrayInt *data);
793 DataArrayInt *getArray()
795 DataArrayInt *ret(self->getArray());
796 if(ret) ret->incrRef();
802 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
805 MEDFileEquivalenceNode();
808 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
811 MEDFileEquivalenceCell();
814 std::size_t size() const;
815 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
816 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
819 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
821 DataArrayInt *ret(self->getArray(type));
822 if(ret) ret->incrRef();
826 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
828 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
829 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
830 PyObject *res=PyList_New(result.size());
831 for(int i=0;iL!=result.end(); i++, iL++)
832 PyList_SetItem(res,i,PyInt_FromLong(*iL));
838 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
841 MEDFileEquivalencePair();
843 std::string getName() const;
844 void setName(const std::string& name);
845 std::string getDescription() const;
846 void setDescription(const std::string& descr);
847 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
850 MEDFileEquivalenceCell *initCell()
852 MEDFileEquivalenceCell *ret(self->initCell());
853 if(ret) ret->incrRef();
857 MEDFileEquivalenceNode *initNode()
859 MEDFileEquivalenceNode *ret(self->initNode());
860 if(ret) ret->incrRef();
864 MEDFileEquivalenceCell *getCell()
866 MEDFileEquivalenceCell *ret(self->getCell());
867 if(ret) ret->incrRef();
871 MEDFileEquivalenceNode *getNode()
873 MEDFileEquivalenceNode *ret(self->getNode());
874 if(ret) ret->incrRef();
880 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
883 MEDFileEquivalences();
886 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
887 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
888 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
892 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
894 MEDFileEquivalencePair *ret(self->getEquivalence(i));
895 if(ret) ret->incrRef();
898 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
900 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
901 if(ret) ret->incrRef();
905 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
907 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
908 if(ret) ret->incrRef();
914 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
917 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
918 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
919 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
920 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
921 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
922 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
923 void setName(const std::string& name);
924 std::string getName();
925 std::string getUnivName() const;
926 bool getUnivNameWrStatus() const;
927 void setUnivNameWrStatus(bool newStatus);
928 void setDescription(const std::string& name);
929 std::string getDescription() const;
930 void setOrder(int order);
931 int getOrder() const;
932 void setIteration(int it);
934 void setTimeValue(double time);
935 void setTime(int dt, int it, double time);
936 double getTimeValue() const;
937 void setTimeUnit(const std::string& unit);
938 std::string getTimeUnit() const;
939 void setAxisType(MEDCouplingAxisType at);
940 MEDCouplingAxisType getAxisType() const;
941 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
942 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
943 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
944 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
945 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
946 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
947 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
948 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
949 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
950 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
951 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
952 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
953 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
954 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
956 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
957 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
958 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
959 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
960 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
961 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
962 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
963 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
964 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
965 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
966 void clearGrpMap() throw(INTERP_KERNEL::Exception);
967 void clearFamMap() throw(INTERP_KERNEL::Exception);
968 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
969 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
970 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
971 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
972 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
973 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
974 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
975 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
976 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
977 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
978 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
979 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
980 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
981 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
982 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
983 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
984 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
985 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
986 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
987 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
988 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
989 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
990 static std::string GetMagicFamilyStr();
991 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
992 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
993 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
994 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
995 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
996 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
997 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
998 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
999 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1000 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1001 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1002 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1003 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1004 void setFamilyInfo(const std::map<std::string,int>& info);
1005 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1006 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1007 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1008 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1009 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1010 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1011 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1012 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1013 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1014 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1015 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1016 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1017 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1018 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1019 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1020 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1021 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1022 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1023 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1024 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1025 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1027 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1028 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1029 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1030 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1031 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1032 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1033 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1034 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1035 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1036 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1037 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1038 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1039 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1040 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1041 int getNumberOfJoints();
1042 MEDFileJoints *getJoints();
1043 void setJoints( MEDFileJoints* joints );
1044 void initializeEquivalences();
1045 void killEquivalences();
1048 std::string __str__() const throw(INTERP_KERNEL::Exception)
1050 return self->simpleRepr();
1053 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1055 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1058 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1061 double tmp0=self->getTime(tmp1,tmp2);
1062 PyObject *res = PyList_New(3);
1063 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1064 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1065 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1069 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1072 bool ret0=self->isEqual(other,eps,what);
1073 PyObject *res=PyList_New(2);
1074 PyObject *ret0Py=ret0?Py_True:Py_False;
1076 PyList_SetItem(res,0,ret0Py);
1077 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1081 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1083 std::vector<const DataArrayInt *> grps;
1084 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1085 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1088 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1091 bool ret0=self->areFamsEqual(other,what);
1092 PyObject *res=PyList_New(2);
1093 PyObject *ret0Py=ret0?Py_True:Py_False;
1095 PyList_SetItem(res,0,ret0Py);
1096 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1100 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1103 bool ret0=self->areGrpsEqual(other,what);
1104 PyObject *res=PyList_New(2);
1105 PyObject *ret0Py=ret0?Py_True:Py_False;
1107 PyList_SetItem(res,0,ret0Py);
1108 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1112 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1114 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1115 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1116 PyObject *res=PyList_New(result.size());
1117 for(int i=0;iL!=result.end(); i++, iL++)
1118 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1122 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1124 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1125 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1126 PyObject *res=PyList_New(result.size());
1127 for(int i=0;iL!=result.end(); i++, iL++)
1128 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1132 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1134 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1137 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1140 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1142 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1145 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1148 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1150 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1153 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1156 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1158 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1161 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1164 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1166 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1169 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1172 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1175 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1176 PyObject *ret=PyTuple_New(2);
1177 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1178 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1182 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1184 DataArrayInt *ret3=0;
1185 std::vector<int> ret1,ret2;
1186 bool ret0=self->unPolyze(ret1,ret2,ret3);
1187 PyObject *ret=PyTuple_New(4);
1188 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1190 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1191 for(int j=0;j<(int)ret1.size()/3;j++)
1193 PyObject *retLev2=PyList_New(3);
1194 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1195 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1196 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1197 PyList_SetItem(retLev1_0,j,retLev2);
1199 PyTuple_SetItem(ret,1,retLev1_0);
1201 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1202 for(int j=0;j<(int)ret2.size()/3;j++)
1204 PyObject *retLev2=PyList_New(3);
1205 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1206 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1207 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1208 PyList_SetItem(retLev1_1,j,retLev2);
1210 PyTuple_SetItem(ret,2,retLev1_1);
1212 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1216 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1218 MEDFileEquivalences *ret(self->getEquivalences());
1219 if(ret) ret->incrRef();
1225 class MEDFileUMesh : public MEDFileMesh
1228 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1229 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1230 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1231 static MEDFileUMesh *New();
1232 static const char *GetSpeStr4ExtMesh();
1234 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1235 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1236 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1237 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1238 void clearNodeAndCellNumbers();
1240 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1241 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1242 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1243 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1244 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1245 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1246 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1247 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1248 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1249 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1251 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1252 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1253 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1254 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1255 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1256 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1257 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1258 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1259 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1260 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1261 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1262 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1263 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1264 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1265 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1268 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1270 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1273 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1275 return MEDFileUMesh::New(fileName,mrs);
1278 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1280 return MEDFileUMesh::New(mem);
1285 return MEDFileUMesh::New();
1289 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1291 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1294 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)
1296 std::vector<int> typesCpp1;
1297 convertPyToNewIntArr3(types,typesCpp1);
1298 std::size_t sz(typesCpp1.size());
1299 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1300 for(std::size_t ii=0;ii<sz;ii++)
1301 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1302 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1305 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1306 {// put an empty dict in input to say to __new__ to call __init__...
1307 PyObject *ret(PyTuple_New(1));
1308 PyObject *ret0(PyDict_New());
1309 PyTuple_SetItem(ret,0,ret0);
1313 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1315 std::vector<double> a0;
1316 std::vector<int> a1;
1317 std::vector<std::string> a2;
1318 std::vector< MCAuto<DataArrayInt> > a3;
1319 MCAuto<DataArrayDouble> a4;
1320 self->serialize(a0,a1,a2,a3,a4);
1321 PyObject *ret(PyTuple_New(5));
1322 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1323 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1325 PyObject *ret2(PyList_New(sz));
1326 for(int i=0;i<sz;i++)
1327 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1328 PyTuple_SetItem(ret,2,ret2);
1330 PyObject *ret3(PyList_New(sz));
1331 for(int i=0;i<sz;i++)
1333 DataArrayInt *elt(a3[i]);
1336 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1338 PyTuple_SetItem(ret,3,ret3);
1339 DataArrayDouble *ret4(a4);
1342 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1346 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1348 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1349 if(!PyTuple_Check(inp))
1350 throw INTERP_KERNEL::Exception(MSG);
1351 int sz(PyTuple_Size(inp));
1353 throw INTERP_KERNEL::Exception(MSG);
1354 std::vector<double> a0;
1355 std::vector<int> a1;
1356 std::vector<std::string> a2;
1357 std::vector< MCAuto<DataArrayInt> > a3;
1358 MCAuto<DataArrayDouble> a4;
1360 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1362 fillArrayWithPyListDbl3(a0py,tmp,a0);
1363 convertPyToNewIntArr3(a1py,a1);
1364 fillStringVector(a2py,a2);
1366 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1368 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1369 if(!SWIG_IsOK(status))
1370 throw INTERP_KERNEL::Exception(MSG);
1371 a4=reinterpret_cast<DataArrayDouble *>(argp);
1372 if((DataArrayDouble *)a4)
1375 std::vector< DataArrayInt * > a3Tmp;
1376 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1377 std::size_t sz(a3Tmp.size());
1379 for(std::size_t i=0;i<sz;i++)
1383 a3Tmp[i]->incrRef();
1385 self->unserialize(a0,a1,a2,a3,a4);
1389 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1392 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1393 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1396 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1399 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1402 self->setMeshAtLevel(meshDimRelToMax,m1);
1405 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1408 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1410 self->removeMeshAtLevel(meshDimRelToMax);
1413 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1415 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1417 DataArrayDouble *a,*a2;
1418 DataArrayDoubleTuple *aa,*aa2;
1419 std::vector<double> bb,bb2;
1421 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1422 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1423 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1427 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1429 std::vector<const MEDFileUMesh *> meshesCpp;
1430 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1431 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1435 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1437 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1438 return convertVecPairIntToPy(ret);
1441 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1443 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1444 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1445 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1448 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1450 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1451 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1452 return self->extractPart(extractDefCpp);
1455 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1457 std::vector<const MEDCouplingUMesh *> ms;
1458 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1459 self->setMeshes(ms,renum);
1462 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1464 std::vector<const MEDCouplingUMesh *> ms;
1465 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1466 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1469 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1471 std::vector<const MEDCouplingUMesh *> ms;
1472 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1473 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1476 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1478 DataArrayDouble *ret=self->getCoords();
1484 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1486 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1489 return const_cast<PartDefinition *>(ret);
1492 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1494 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1495 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1496 PyObject *ret=PyTuple_New(3);
1497 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1498 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1499 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1503 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1505 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1511 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1513 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1514 std::size_t sz(tmp.size());
1515 PyObject *ret=PyList_New(sz);
1516 for(std::size_t i=0;i<sz;i++)
1520 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1527 class MEDFileStructuredMesh : public MEDFileMesh
1532 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1534 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1542 class MEDFileCMesh : public MEDFileStructuredMesh
1545 static MEDFileCMesh *New();
1546 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1547 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1548 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1549 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1554 return MEDFileCMesh::New();
1557 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1559 return MEDFileCMesh::New(fileName,mrs);
1562 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1564 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1567 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1569 const MEDCouplingCMesh *tmp=self->getMesh();
1572 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1577 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1580 static MEDFileCurveLinearMesh *New();
1581 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1582 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1583 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1586 MEDFileCurveLinearMesh()
1588 return MEDFileCurveLinearMesh::New();
1591 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1593 return MEDFileCurveLinearMesh::New(fileName,mrs);
1596 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1598 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1601 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1603 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1606 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1611 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1614 static MEDFileMeshMultiTS *New();
1615 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1616 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1617 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1618 std::string getName() const throw(INTERP_KERNEL::Exception);
1619 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1620 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1623 MEDFileMeshMultiTS()
1625 return MEDFileMeshMultiTS::New();
1628 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1630 return MEDFileMeshMultiTS::New(fileName);
1633 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1635 return MEDFileMeshMultiTS::New(fileName,mName);
1638 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1640 MEDFileMesh *ret=self->getOneTimeStep();
1648 class MEDFileMeshesIterator
1653 PyObject *next() throw(INTERP_KERNEL::Exception)
1655 MEDFileMesh *ret=self->nextt();
1659 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1663 PyErr_SetString(PyExc_StopIteration,"No more data.");
1670 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1673 static MEDFileMeshes *New();
1674 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1675 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1676 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1677 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1679 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1680 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1681 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1682 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1683 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1688 return MEDFileMeshes::New();
1691 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1693 return MEDFileMeshes::New(fileName);
1696 std::string __str__() const throw(INTERP_KERNEL::Exception)
1698 return self->simpleRepr();
1701 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1703 if(PyInt_Check(obj))
1705 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1710 else if(PyString_Check(obj))
1712 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1718 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1721 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1723 self->setMeshAtPos(obj,mesh);
1727 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1729 return self->iterator();
1732 int __len__() const throw(INTERP_KERNEL::Exception)
1734 return self->getNumberOfMeshes();
1737 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1739 MEDFileMesh *ret=self->getMeshAtPos(i);
1744 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1746 MEDFileMesh *ret=self->getMeshWithName(mname);
1754 class MEDFileFieldLoc : public RefCountObject
1757 std::string getName() const;
1758 int getDimension() const;
1759 int getNumberOfGaussPoints() const;
1760 int getNumberOfPointsInCells() const;
1761 const std::vector<double>& getRefCoords() const;
1762 const std::vector<double>& getGaussCoords() const;
1763 const std::vector<double>& getGaussWeights() const;
1764 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1767 std::string __str__() const throw(INTERP_KERNEL::Exception)
1769 return self->repr();
1774 class MEDFileFieldGlobsReal
1777 void resetContent();
1778 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1779 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1780 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1781 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1782 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1783 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1784 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1785 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1786 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1787 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1788 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1789 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1790 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1791 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1792 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1793 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1794 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1795 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1796 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1797 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1798 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1799 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1800 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1801 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1802 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1803 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1806 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1808 const DataArrayInt *ret=self->getProfile(pflName);
1811 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1814 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1816 const DataArrayInt *ret=self->getProfileFromId(pflId);
1819 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1822 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1824 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1827 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1830 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1832 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1835 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1838 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1840 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1841 return convertVecPairVecStToPy(ret);
1844 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1846 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1847 return convertVecPairVecStToPy(ret);
1850 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1852 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1853 self->changePflsNames(v);
1856 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1858 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1859 self->changePflsRefsNamesGen(v);
1862 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1864 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1865 self->changePflsNamesInStruct(v);
1868 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1870 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1871 self->changeLocsNames(v);
1874 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1876 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1877 self->changeLocsRefsNamesGen(v);
1880 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1882 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1883 self->changeLocsNamesInStruct(v);
1886 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1888 std::ostringstream oss;
1889 self->simpleReprGlobs(oss);
1895 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
1898 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1899 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1900 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1901 void loadArrays() throw(INTERP_KERNEL::Exception);
1902 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1903 void unloadArrays() throw(INTERP_KERNEL::Exception);
1904 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1905 int getDimension() const throw(INTERP_KERNEL::Exception);
1906 int getIteration() const throw(INTERP_KERNEL::Exception);
1907 int getOrder() const throw(INTERP_KERNEL::Exception);
1908 std::string getName() throw(INTERP_KERNEL::Exception);
1909 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1910 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1911 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1912 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1913 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1914 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1915 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1916 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1917 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1918 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1919 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1920 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1921 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
1922 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1923 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1926 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1929 double tmp0=self->getTime(tmp1,tmp2);
1930 PyObject *res = PyList_New(3);
1931 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1932 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1933 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1937 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1939 std::pair<int,int> res=self->getDtIt();
1940 PyObject *elt=PyTuple_New(2);
1941 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1942 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1946 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1948 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1951 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1953 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1956 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1958 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1959 return self->changeMeshNames(modifTab);
1962 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1964 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1965 PyObject *ret2=PyList_New(ret.size());
1966 for(int i=0;i<(int)ret.size();i++)
1967 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1971 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1973 std::vector<int> ret1;
1974 int ret0=self->getNonEmptyLevels(mname,ret1);
1975 PyObject *elt=PyTuple_New(2);
1976 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1977 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1981 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1983 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1984 std::vector< std::vector<TypeOfField> > typesF;
1985 std::vector< std::vector<std::string> > pfls;
1986 std::vector< std::vector<std::string> > locs;
1987 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1989 PyObject *ret2=PyList_New(sz);
1990 for(int i=0;i<sz;i++)
1992 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1993 const std::vector<TypeOfField>& typesFI=typesF[i];
1994 const std::vector<std::string>& pflsI=pfls[i];
1995 const std::vector<std::string>& locsI=locs[i];
1996 PyObject *elt=PyTuple_New(2);
1997 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1998 int sz2=ret[i].size();
1999 PyObject *elt2=PyList_New(sz2);
2000 for(int j=0;j<sz2;j++)
2002 PyObject *elt3=PyTuple_New(4);
2003 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2004 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,SWIG_From_int(dadsI[j].first)); PyTuple_SetItem(elt4,1,SWIG_From_int(dadsI[j].second));
2005 PyTuple_SetItem(elt3,1,elt4);
2006 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2007 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2008 PyList_SetItem(elt2,j,elt3);
2010 PyTuple_SetItem(elt,1,elt2);
2011 PyList_SetItem(ret2,i,elt);
2016 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2018 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2019 std::size_t sz=ret.size();
2020 PyObject *retPy=PyList_New(sz);
2021 for(std::size_t i=0;i<sz;i++)
2022 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2026 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2028 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2029 std::size_t sz=ret.size();
2030 PyObject *retPy=PyList_New(sz);
2031 for(std::size_t i=0;i<sz;i++)
2032 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2036 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2038 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2039 std::size_t sz=ret.size();
2040 PyObject *retPy=PyList_New(sz);
2041 for(std::size_t i=0;i<sz;i++)
2042 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2046 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2048 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2049 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2050 return self->extractPart(extractDefCpp,mm);
2055 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2058 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2059 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2060 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2061 static MEDFileField1TS *New();
2062 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2063 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2064 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2065 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2066 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2067 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2068 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2070 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2071 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2072 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2073 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2076 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2078 return MEDFileField1TS::New(fileName,loadAll);
2081 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2083 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2086 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2088 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2093 return MEDFileField1TS::New();
2096 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2098 const DataArrayDouble *arr=0;
2100 arr=field->getArray();
2101 self->copyTinyInfoFrom(field,arr);
2104 std::string __str__() const throw(INTERP_KERNEL::Exception)
2106 return self->simpleRepr();
2109 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2111 DataArrayInt *ret1=0;
2112 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2113 PyObject *ret=PyTuple_New(2);
2114 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2115 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2119 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2121 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2122 std::vector< std::vector<TypeOfField> > typesF;
2123 std::vector< std::vector<std::string> > pfls;
2124 std::vector< std::vector<std::string> > locs;
2125 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2127 PyObject *ret2=PyList_New(sz);
2128 for(int i=0;i<sz;i++)
2130 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2131 const std::vector<TypeOfField>& typesFI=typesF[i];
2132 const std::vector<std::string>& pflsI=pfls[i];
2133 const std::vector<std::string>& locsI=locs[i];
2134 PyObject *elt=PyTuple_New(2);
2135 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2136 int sz2=ret[i].size();
2137 PyObject *elt2=PyList_New(sz2);
2138 for(int j=0;j<sz2;j++)
2140 PyObject *elt3=PyTuple_New(4);
2141 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2142 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2143 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2144 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2145 PyList_SetItem(elt2,j,elt3);
2147 PyTuple_SetItem(elt,1,elt2);
2148 PyList_SetItem(ret2,i,elt);
2153 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2155 DataArrayDouble *ret=self->getUndergroundDataArray();
2161 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2163 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2164 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2167 PyObject *ret=PyTuple_New(2);
2168 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2169 std::size_t sz=elt1Cpp.size();
2170 PyObject *elt=PyList_New(sz);
2171 for(std::size_t i=0;i<sz;i++)
2173 PyObject *elt1=PyTuple_New(2);
2174 PyObject *elt2=PyTuple_New(2);
2175 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2176 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2177 PyObject *elt3=PyTuple_New(2);
2178 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2179 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2180 PyTuple_SetItem(elt1,0,elt2);
2181 PyTuple_SetItem(elt1,1,elt3);
2182 PyList_SetItem(elt,i,elt1);
2184 PyTuple_SetItem(ret,1,elt);
2190 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2193 static MEDFileIntField1TS *New();
2194 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2195 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2196 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2197 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2199 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2200 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2201 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2202 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2203 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2204 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2205 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2206 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2209 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2211 return MEDFileIntField1TS::New();
2214 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2216 return MEDFileIntField1TS::New(fileName,loadAll);
2219 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2221 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2224 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2226 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2229 std::string __str__() const throw(INTERP_KERNEL::Exception)
2231 return self->simpleRepr();
2234 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2236 DataArrayInt *ret1=0;
2237 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2238 PyObject *ret=PyTuple_New(2);
2239 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2240 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2244 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2246 DataArrayInt *ret=self->getUndergroundDataArray();
2254 class MEDFileAnyTypeFieldMultiTSIterator
2259 PyObject *next() throw(INTERP_KERNEL::Exception)
2261 MEDFileAnyTypeField1TS *ret=self->nextt();
2263 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2266 PyErr_SetString(PyExc_StopIteration,"No more data.");
2273 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2276 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2277 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2278 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2279 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2280 std::string getName() const throw(INTERP_KERNEL::Exception);
2281 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2282 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2283 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2284 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2285 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2286 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2287 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2288 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2289 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2290 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2291 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2292 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2293 void loadArrays() throw(INTERP_KERNEL::Exception);
2294 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2295 void unloadArrays() throw(INTERP_KERNEL::Exception);
2296 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2298 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2299 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2300 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2301 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2302 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2303 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2306 int __len__() const throw(INTERP_KERNEL::Exception)
2308 return self->getNumberOfTS();
2311 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2313 if(elt0 && PyInt_Check(elt0))
2315 int pos=PyInt_AS_LONG(elt0);
2318 else if(elt0 && PyTuple_Check(elt0))
2320 if(PyTuple_Size(elt0)==2)
2322 PyObject *o0=PyTuple_GetItem(elt0,0);
2323 PyObject *o1=PyTuple_GetItem(elt0,1);
2324 if(PyInt_Check(o0) && PyInt_Check(o1))
2326 int iter=PyInt_AS_LONG(o0);
2327 int order=PyInt_AS_LONG(o1);
2328 return self->getPosOfTimeStep(iter,order);
2331 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 !");
2334 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 !");
2336 else if(elt0 && PyFloat_Check(elt0))
2338 double val=PyFloat_AS_DOUBLE(elt0);
2339 return self->getPosGivenTime(val);
2342 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2345 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2347 std::vector< std::pair<int,int> > res(self->getIterations());
2348 return convertVecPairIntToPy(res);
2351 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2353 std::vector<double> ret1;
2354 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2355 std::size_t sz=ret.size();
2356 PyObject *ret2=PyList_New(sz);
2357 for(std::size_t i=0;i<sz;i++)
2359 PyObject *elt=PyTuple_New(3);
2360 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2361 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2362 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2363 PyList_SetItem(ret2,i,elt);
2368 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2370 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2371 PyObject *ret2=PyList_New(ret.size());
2372 for(int i=0;i<(int)ret.size();i++)
2374 const std::vector<TypeOfField>& rett=ret[i];
2375 PyObject *ret3=PyList_New(rett.size());
2376 for(int j=0;j<(int)rett.size();j++)
2377 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2378 PyList_SetItem(ret2,i,ret3);
2383 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2385 std::vector<int> ret1;
2386 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2387 PyObject *elt=PyTuple_New(2);
2388 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2389 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2393 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2395 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2396 std::vector< std::vector<TypeOfField> > typesF;
2397 std::vector< std::vector<std::string> > pfls;
2398 std::vector< std::vector<std::string> > locs;
2399 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2401 PyObject *ret2=PyList_New(sz);
2402 for(int i=0;i<sz;i++)
2404 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2405 const std::vector<TypeOfField>& typesFI=typesF[i];
2406 const std::vector<std::string>& pflsI=pfls[i];
2407 const std::vector<std::string>& locsI=locs[i];
2408 PyObject *elt=PyTuple_New(2);
2409 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2410 int sz2=ret[i].size();
2411 PyObject *elt2=PyList_New(sz2);
2412 for(int j=0;j<sz2;j++)
2414 PyObject *elt3=PyTuple_New(4);
2415 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2416 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));
2417 PyTuple_SetItem(elt3,1,elt4);
2418 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2419 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2420 PyList_SetItem(elt2,j,elt3);
2422 PyTuple_SetItem(elt,1,elt2);
2423 PyList_SetItem(ret2,i,elt);
2428 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2430 if(PyList_Check(elts))
2432 int sz=PyList_Size(elts);
2433 std::vector<int> ret(sz);
2434 for(int i=0;i<sz;i++)
2436 PyObject *elt=PyList_GetItem(elts,i);
2437 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2443 std::vector<int> ret(1);
2444 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2449 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2451 if(PySlice_Check(elts))
2453 Py_ssize_t strt=2,stp=2,step=2;
2454 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2455 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2456 self->eraseTimeStepIds2(strt,stp,step);
2460 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2461 if(!idsToRemove.empty())
2462 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2466 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2470 std::vector<int> pos2;
2471 DataArrayInt *pos3=0;
2472 DataArrayIntTuple *pos4=0;
2473 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2478 self->eraseTimeStepIds(&pos1,&pos1+1);
2485 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2490 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2494 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2498 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2500 return self->iterator();
2503 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2505 if(elt0 && PyList_Check(elt0))
2507 int sz=PyList_Size(elt0);
2508 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2509 int *pt=da->getPointer();
2510 for(int i=0;i<sz;i++,pt++)
2512 PyObject *elt1=PyList_GetItem(elt0,i);
2513 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2515 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2517 else if(elt0 && PySlice_Check(elt0))
2519 Py_ssize_t strt=2,stp=2,step=2;
2520 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2521 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2522 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2525 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2528 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2530 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2531 return self->changeMeshNames(modifTab);
2534 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2536 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2537 std::size_t sz=ret.size();
2538 PyObject *retPy=PyList_New(sz);
2539 for(std::size_t i=0;i<sz;i++)
2540 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2544 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2546 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2547 std::size_t sz=ret.size();
2548 PyObject *retPy=PyList_New(sz);
2549 for(std::size_t i=0;i<sz;i++)
2550 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2554 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2556 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2557 std::size_t sz=ret.size();
2558 PyObject *retPy=PyList_New(sz);
2559 for(std::size_t i=0;i<sz;i++)
2560 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2564 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2567 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2568 if(SWIG_IsOK(status))
2570 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2574 std::vector<MEDFileAnyTypeField1TS *> tmp;
2575 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2576 self->pushBackTimeSteps(tmp);
2580 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2582 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2583 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2584 return self->extractPart(extractDefCpp,mm);
2587 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2589 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2590 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2591 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2592 std::size_t sz=ret.size();
2593 PyObject *retPy=PyList_New(sz);
2594 for(std::size_t i=0;i<sz;i++)
2596 std::size_t sz2=ret[i].size();
2597 PyObject *ret1Py=PyList_New(sz2);
2598 for(std::size_t j=0;j<sz2;j++)
2600 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2603 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2605 PyList_SetItem(retPy,i,ret1Py);
2610 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2612 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2613 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2614 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2615 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2616 if(ret2.size()!=ret.size())
2618 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2619 throw INTERP_KERNEL::Exception(oss.str().c_str());
2621 std::size_t sz=ret.size();
2622 PyObject *retPy=PyList_New(sz);
2623 for(std::size_t i=0;i<sz;i++)
2625 std::size_t sz2=ret[i].size();
2626 PyObject *ret0Py=PyTuple_New(2);
2627 PyObject *ret1Py=PyList_New(sz2);
2628 for(std::size_t j=0;j<sz2;j++)
2630 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2633 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2635 PyTuple_SetItem(ret0Py,0,ret1Py);
2636 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2637 PyList_SetItem(retPy,i,ret0Py);
2644 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2647 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2648 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2649 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2651 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2652 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2653 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2654 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2655 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2656 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2658 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2659 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2660 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2663 MEDFileFieldMultiTS()
2665 return MEDFileFieldMultiTS::New();
2668 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2670 return MEDFileFieldMultiTS::New(fileName,loadAll);
2673 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2675 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2678 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2680 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2681 std::size_t sz(tmp.size());
2682 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2683 for(std::size_t i=0;i<sz;i++)
2685 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2686 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2688 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2691 std::string __str__() const throw(INTERP_KERNEL::Exception)
2693 return self->simpleRepr();
2696 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2698 DataArrayInt *ret1=0;
2699 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2700 PyObject *ret=PyTuple_New(2);
2701 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2702 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2706 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2708 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2709 std::vector< std::vector<TypeOfField> > typesF;
2710 std::vector< std::vector<std::string> > pfls;
2711 std::vector< std::vector<std::string> > locs;
2712 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2714 PyObject *ret2=PyList_New(sz);
2715 for(int i=0;i<sz;i++)
2717 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2718 const std::vector<TypeOfField>& typesFI=typesF[i];
2719 const std::vector<std::string>& pflsI=pfls[i];
2720 const std::vector<std::string>& locsI=locs[i];
2721 PyObject *elt=PyTuple_New(2);
2722 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2723 int sz2=ret[i].size();
2724 PyObject *elt2=PyList_New(sz2);
2725 for(int j=0;j<sz2;j++)
2727 PyObject *elt3=PyTuple_New(4);
2728 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2729 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2730 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2731 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2732 PyList_SetItem(elt2,j,elt3);
2734 PyTuple_SetItem(elt,1,elt2);
2735 PyList_SetItem(ret2,i,elt);
2739 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2741 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2747 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2749 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2750 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2753 PyObject *ret=PyTuple_New(2);
2754 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2755 std::size_t sz=elt1Cpp.size();
2756 PyObject *elt=PyList_New(sz);
2757 for(std::size_t i=0;i<sz;i++)
2759 PyObject *elt1=PyTuple_New(2);
2760 PyObject *elt2=PyTuple_New(2);
2761 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2762 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2763 PyObject *elt3=PyTuple_New(2);
2764 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2765 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2766 PyTuple_SetItem(elt1,0,elt2);
2767 PyTuple_SetItem(elt1,1,elt3);
2768 PyList_SetItem(elt,i,elt1);
2770 PyTuple_SetItem(ret,1,elt);
2776 class MEDFileFieldsIterator
2781 PyObject *next() throw(INTERP_KERNEL::Exception)
2783 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2785 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2788 PyErr_SetString(PyExc_StopIteration,"No more data.");
2795 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2798 static MEDFileIntFieldMultiTS *New();
2799 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2800 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2802 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2803 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2804 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2805 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2806 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2807 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2808 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2809 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2810 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2813 MEDFileIntFieldMultiTS()
2815 return MEDFileIntFieldMultiTS::New();
2818 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2820 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2823 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2825 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2828 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2830 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2831 std::size_t sz(tmp.size());
2832 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2833 for(std::size_t i=0;i<sz;i++)
2835 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2836 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2838 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2841 std::string __str__() const throw(INTERP_KERNEL::Exception)
2843 return self->simpleRepr();
2846 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2848 DataArrayInt *ret1=0;
2849 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2850 PyObject *ret=PyTuple_New(2);
2851 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2852 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2856 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2858 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2866 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2869 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2870 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2871 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2872 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
2873 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2874 void loadArrays() throw(INTERP_KERNEL::Exception);
2875 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2876 void unloadArrays() throw(INTERP_KERNEL::Exception);
2877 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2878 int getNumberOfFields() const;
2879 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2880 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2882 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2883 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2884 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2885 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2886 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2887 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2888 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2889 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2890 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2895 return MEDFileFields::New();
2898 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2900 return MEDFileFields::New(fileName,loadAll);
2903 std::string __str__() const throw(INTERP_KERNEL::Exception)
2905 return self->simpleRepr();
2908 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2910 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2911 std::size_t sz(tmp.size());
2912 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2913 for(std::size_t i=0;i<sz;i++)
2915 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2916 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2918 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2921 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2924 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2925 PyObject *ret=PyTuple_New(2);
2926 PyObject *ret_0=PyList_New(ret0.size());
2928 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2930 PyObject *elt=PyTuple_New(2);
2931 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2932 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2933 PyList_SetItem(ret_0,rk,elt);
2935 PyTuple_SetItem(ret,0,ret_0);
2936 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2937 PyTuple_SetItem(ret,1,ret_1);
2941 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2943 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2944 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2947 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2949 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2950 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2953 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2955 if(obj && PyList_Check(obj))
2957 int sz=PyList_Size(obj);
2958 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2959 int *pt=da->getPointer();
2960 for(int i=0;i<sz;i++,pt++)
2962 PyObject *elt1=PyList_GetItem(obj,i);
2963 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2965 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
2968 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2971 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2973 self->setFieldAtPos(obj,field);
2977 int __len__() const throw(INTERP_KERNEL::Exception)
2979 return self->getNumberOfFields();
2982 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2984 return self->iterator();
2987 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2989 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2990 return self->changeMeshNames(modifTab);
2993 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2995 if(elt0 && PyInt_Check(elt0))
2997 return PyInt_AS_LONG(elt0);
2999 else if(elt0 && PyString_Check(elt0))
3000 return self->getPosFromFieldName(PyString_AsString(elt0));
3002 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3005 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3007 if(PyList_Check(elts))
3009 int sz=PyList_Size(elts);
3010 std::vector<int> ret(sz);
3011 for(int i=0;i<sz;i++)
3013 PyObject *elt=PyList_GetItem(elts,i);
3014 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3020 std::vector<int> ret(1);
3021 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3026 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3028 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3029 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3030 self->pushFields(tmp);
3033 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3035 if(elts && PySlice_Check(elts))
3037 Py_ssize_t strt=2,stp=2,step=2;
3038 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3039 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3040 self->destroyFieldsAtPos2(strt,stp,step);
3044 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3045 if(!idsToRemove.empty())
3046 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3050 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3052 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3053 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3054 return self->extractPart(extractDefCpp,mm);
3059 class MEDFileParameter1TS : public RefCountObject
3062 void setIteration(int it);
3063 int getIteration() const;
3064 void setOrder(int order);
3065 int getOrder() const;
3066 void setTimeValue(double time);
3067 void setTime(int dt, int it, double time);
3068 double getTime(int& dt, int& it);
3069 double getTimeValue() const;
3072 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3075 void setValue(double val) throw(INTERP_KERNEL::Exception);
3076 double getValue() const throw(INTERP_KERNEL::Exception);
3077 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3080 std::string __str__() const throw(INTERP_KERNEL::Exception)
3082 return self->simpleRepr();
3087 class MEDFileParameterTinyInfo : public MEDFileWritable
3090 void setDescription(const std::string& name);
3091 std::string getDescription() const;
3092 void setTimeUnit(const std::string& unit);
3093 std::string getTimeUnit() const;
3096 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3099 static MEDFileParameterDouble1TS *New();
3100 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3101 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3102 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3103 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3104 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3105 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3106 std::string getName() const throw(INTERP_KERNEL::Exception);
3107 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3110 MEDFileParameterDouble1TS()
3112 return MEDFileParameterDouble1TS::New();
3115 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3117 return MEDFileParameterDouble1TS::New(fileName);
3120 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3122 return MEDFileParameterDouble1TS::New(fileName,paramName);
3125 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3127 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3130 std::string __str__() const throw(INTERP_KERNEL::Exception)
3132 return self->simpleRepr();
3135 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3138 bool ret0=self->isEqual(other,eps,what);
3139 PyObject *res=PyList_New(2);
3140 PyObject *ret0Py=ret0?Py_True:Py_False;
3142 PyList_SetItem(res,0,ret0Py);
3143 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3149 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3152 static MEDFileParameterMultiTS *New();
3153 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3154 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3155 std::string getName() const;
3156 void setName(const std::string& name);
3157 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3158 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3159 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3160 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3161 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3162 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3163 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3164 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3167 MEDFileParameterMultiTS()
3169 return MEDFileParameterMultiTS::New();
3172 MEDFileParameterMultiTS(const std::string& fileName)
3174 return MEDFileParameterMultiTS::New(fileName);
3177 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3179 return MEDFileParameterMultiTS::New(fileName,paramName);
3182 std::string __str__() const throw(INTERP_KERNEL::Exception)
3184 return self->simpleRepr();
3187 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3190 bool ret0=self->isEqual(other,eps,what);
3191 PyObject *res=PyList_New(2);
3192 PyObject *ret0Py=ret0?Py_True:Py_False;
3194 PyList_SetItem(res,0,ret0Py);
3195 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3199 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3203 std::vector<int> pos2;
3204 DataArrayInt *pos3=0;
3205 DataArrayIntTuple *pos4=0;
3206 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3211 self->eraseTimeStepIds(&pos1,&pos1+1);
3218 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3223 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3227 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3231 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3233 if(elt0 && PyInt_Check(elt0))
3235 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3238 else if(elt0 && PyTuple_Check(elt0))
3240 if(PyTuple_Size(elt0)==2)
3242 PyObject *o0=PyTuple_GetItem(elt0,0);
3243 PyObject *o1=PyTuple_GetItem(elt0,1);
3244 if(PyInt_Check(o0) && PyInt_Check(o1))
3246 int iter=PyInt_AS_LONG(o0);
3247 int order=PyInt_AS_LONG(o1);
3248 return self->getPosOfTimeStep(iter,order);
3251 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 !");
3254 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 !");
3256 else if(elt0 && PyFloat_Check(elt0))
3258 double val=PyFloat_AS_DOUBLE(elt0);
3259 return self->getPosGivenTime(val);
3262 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3265 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3267 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3273 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3275 if(PyList_Check(elts))
3277 int sz=PyList_Size(elts);
3278 std::vector<int> ret(sz);
3279 for(int i=0;i<sz;i++)
3281 PyObject *elt=PyList_GetItem(elts,i);
3282 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3288 std::vector<int> ret(1);
3289 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3294 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3296 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3297 if(!idsToRemove.empty())
3298 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3301 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3303 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3309 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3311 std::vector< std::pair<int,int> > res=self->getIterations();
3312 PyObject *ret=PyList_New(res.size());
3314 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3316 PyObject *elt=PyTuple_New(2);
3317 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3318 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3319 PyList_SetItem(ret,rk,elt);
3324 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3326 std::vector<double> res2;
3327 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3328 PyObject *ret=PyList_New(res.size());
3330 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3332 PyObject *elt=PyTuple_New(3);
3333 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3334 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3335 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3336 PyList_SetItem(ret,rk,elt);
3343 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3346 static MEDFileParameters *New();
3347 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3348 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3349 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3350 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3351 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3352 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3353 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3354 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3355 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3356 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3361 return MEDFileParameters::New();
3364 MEDFileParameters(const std::string& fileName)
3366 return MEDFileParameters::New(fileName);
3369 std::string __str__() const throw(INTERP_KERNEL::Exception)
3371 return self->simpleRepr();
3374 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3376 if(PyInt_Check(obj))
3378 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3383 else if(PyString_Check(obj))
3385 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3391 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3394 int __len__() const throw(INTERP_KERNEL::Exception)
3396 return self->getNumberOfParams();
3399 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3401 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3407 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3409 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3415 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3418 bool ret0=self->isEqual(other,eps,what);
3419 PyObject *res=PyList_New(2);
3420 PyObject *ret0Py=ret0?Py_True:Py_False;
3422 PyList_SetItem(res,0,ret0Py);
3423 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3429 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3432 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3433 static MEDFileData *New();
3434 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3435 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3436 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3437 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3438 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3439 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3440 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3442 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3443 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3447 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3449 return MEDFileData::New(fileName);
3454 return MEDFileData::New();
3457 std::string __str__() const throw(INTERP_KERNEL::Exception)
3459 return self->simpleRepr();
3462 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3464 MEDFileMeshes *ret=self->getMeshes();
3470 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3472 MEDFileParameters *ret=self->getParams();
3478 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3480 MEDFileFields *ret=self->getFields();
3486 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3488 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3489 return self->changeMeshNames(modifTab);
3492 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3494 std::vector<const MEDFileData *> mfdsCpp;
3495 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3496 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3502 class SauvReader : public RefCountObject
3505 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3506 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3509 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3511 return SauvReader::New(fileName);
3516 class SauvWriter : public RefCountObject
3519 static SauvWriter * New();
3520 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3521 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3522 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3523 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3526 SauvWriter() throw(INTERP_KERNEL::Exception)
3528 return SauvWriter::New();
3535 class MEDFileMeshStruct;
3537 class MEDFileField1TSStructItem
3540 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3543 class MEDFileMeshStruct : public RefCountObject
3546 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3548 ~MEDFileMeshStruct();
3551 class MEDMeshMultiLev : public RefCountObject
3554 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3555 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3556 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3562 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3564 DataArrayInt *famIds(0);
3565 bool isWithoutCopy(false);
3566 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3567 PyObject *ret=PyTuple_New(2);
3568 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3570 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3571 PyTuple_SetItem(ret,1,ret1Py);
3575 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3577 DataArrayInt *numIds(0);
3578 bool isWithoutCopy(false);
3579 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3580 PyObject *ret=PyTuple_New(2);
3581 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3583 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3584 PyTuple_SetItem(ret,1,ret1Py);
3588 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3590 DataArrayInt *famIds(0);
3591 bool isWithoutCopy(false);
3592 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3593 PyObject *ret=PyTuple_New(2);
3594 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3596 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3597 PyTuple_SetItem(ret,1,ret1Py);
3601 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3603 DataArrayInt *numIds(0);
3604 bool isWithoutCopy(false);
3605 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3606 PyObject *ret=PyTuple_New(2);
3607 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3609 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3610 PyTuple_SetItem(ret,1,ret1Py);
3614 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3616 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3617 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3618 PyObject *res(PyList_New(result.size()));
3619 for(int i=0;iL!=result.end(); i++, iL++)
3620 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3626 class MEDUMeshMultiLev : public MEDMeshMultiLev
3629 ~MEDUMeshMultiLev();
3633 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3635 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3636 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3637 PyObject *ret0Py=ncc?Py_True:Py_False;
3639 PyObject *ret=PyTuple_New(7);
3640 PyTuple_SetItem(ret,0,ret0Py);
3641 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3642 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3643 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3644 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3645 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3646 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3652 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3655 ~MEDStructuredMeshMultiLev();
3658 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3661 ~MEDCMeshMultiLev();
3665 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3668 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3669 std::size_t sz(objs.size());
3670 PyObject *ret(PyTuple_New(2));
3671 PyObject *ret0=PyList_New(sz);
3672 for(std::size_t i=0;i<sz;i++)
3673 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3674 PyTuple_SetItem(ret,0,ret0);
3675 PyObject *ret1Py(isInternal?Py_True:Py_False);
3677 PyTuple_SetItem(ret,1,ret1Py);
3683 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3686 ~MEDCurveLinearMeshMultiLev();
3690 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3692 DataArrayDouble *ret0(0);
3693 std::vector<int> ret1;
3695 self->buildVTUArrays(ret0,ret1,ret2);
3696 std::size_t sz(ret1.size());
3697 PyObject *ret=PyTuple_New(3);
3698 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3699 PyObject *ret1Py=PyList_New(sz);
3700 for(std::size_t i=0;i<sz;i++)
3701 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3702 PyTuple_SetItem(ret,1,ret1Py);
3703 PyObject *ret2Py(ret2?Py_True:Py_False);
3705 PyTuple_SetItem(ret,2,ret2Py);
3711 class MEDFileFastCellSupportComparator : public RefCountObject
3714 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3715 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3716 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3717 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3719 ~MEDFileFastCellSupportComparator();
3723 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3725 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3726 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3727 PyObject *res(PyList_New(result.size()));
3728 for(int i=0;iL!=result.end(); i++, iL++)
3729 PyList_SetItem(res,i,PyInt_FromLong(*iL));