1 // Copyright (C) 2017-2021 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 (EDF R&D)
21 #define MEDCOUPLING_EXPORT
22 #define MEDLOADER_EXPORT
24 #ifdef WITH_DOCSTRINGS
25 %include "MEDLoader_doc.i"
28 %include "MEDCouplingCommon.i"
31 #include "MEDLoader.hxx"
32 #include "MEDFileJoint.hxx"
33 #include "MEDFileMesh.hxx"
34 #include "MEDFileField.hxx"
35 #include "MEDFileParameter.hxx"
36 #include "MEDFileData.hxx"
37 #include "MEDFileEquivalence.hxx"
38 #include "MEDFileEntities.hxx"
39 #include "MEDFileMeshReadSelector.hxx"
40 #include "MEDFileFieldOverView.hxx"
41 #include "MEDCouplingTypemaps.i"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
45 #include "MeshFormatReader.hxx"
46 #include "MeshFormatWriter.hxx"
48 using namespace MEDCoupling;
51 #if SWIG_VERSION >= 0x010329
52 %template() std::vector<std::string>;
55 %typemap(out) MEDCoupling::MEDFileMesh*
57 $result=convertMEDFileMesh($1,$owner);
60 %typemap(out) MEDCoupling::MEDFileParameter1TS*
62 $result=convertMEDFileParameter1TS($1,$owner);
65 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
67 $result=convertMEDFileFieldMultiTS($1,$owner);
70 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
72 $result=convertMEDFileField1TS($1,$owner);
75 %typemap(out) MEDCoupling::MEDMeshMultiLev*
77 $result=convertMEDMeshMultiLev($1,$owner);
80 %newobject ReadUMeshFromFamiliesSwig;
81 %newobject ReadUMeshFromGroupsSwig;
82 %newobject ReadFieldSwig;
83 %newobject MEDCoupling::ReadUMeshFromFile;
84 %newobject MEDCoupling::ReadMeshFromFile;
85 %newobject MEDCoupling::ReadFieldCell;
86 %newobject MEDCoupling::ReadFieldNode;
87 %newobject MEDCoupling::ReadFieldGauss;
88 %newobject MEDCoupling::ReadFieldGaussNE;
89 %newobject MEDCoupling::MEDFileMesh::New;
90 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
91 %newobject MEDCoupling::MEDFileMesh::deepCopy;
92 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
93 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
94 %newobject MEDCoupling::MEDFileMesh::__getitem__;
95 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
96 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
97 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
98 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
101 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
102 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
103 %newobject MEDCoupling::MEDFileMesh::getGlobalNumFieldAtLevel;
104 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
105 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
106 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
107 %newobject MEDCoupling::MEDFileMesh::cartesianize;
108 %newobject MEDCoupling::MEDFileData::getJoints;
109 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
110 %newobject MEDCoupling::MEDFileUMesh::New;
111 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
112 %newobject MEDCoupling::MEDFileUMesh::getCoords;
113 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
114 %newobject MEDCoupling::MEDFileUMesh::getGroup;
115 %newobject MEDCoupling::MEDFileUMesh::getGroups;
116 %newobject MEDCoupling::MEDFileUMesh::getFamily;
117 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
118 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
120 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
121 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
122 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
123 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
124 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
125 %newobject MEDCoupling::MEDFileUMesh::computeFetchedNodeIds;
126 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
127 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
128 %newobject MEDCoupling::MEDFileUMesh::extractPart;
129 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
130 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
131 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
132 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
133 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
134 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
135 %newobject MEDCoupling::MEDFileCMesh::New;
136 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
137 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
138 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
139 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
140 %newobject MEDCoupling::MEDFileMeshes::New;
141 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
142 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
143 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
144 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
145 %newobject MEDCoupling::MEDFileMeshes::__iter__;
147 %newobject MEDCoupling::MEDFileMeshSupports::New;
148 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
150 %newobject MEDCoupling::MEDFileStructureElements::New;
152 %newobject MEDCoupling::MEDFileFields::New;
153 %newobject MEDCoupling::MEDFileFields::NewAdv;
154 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
155 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
156 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
157 %newobject MEDCoupling::MEDFileFields::deepCopy;
158 %newobject MEDCoupling::MEDFileFields::shallowCpy;
159 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
160 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
161 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
162 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
163 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
164 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
165 %newobject MEDCoupling::MEDFileFields::__iter__;
166 %newobject MEDCoupling::MEDFileFields::extractPart;
167 %newobject MEDCoupling::MEDFileFields::linearToQuadratic;
169 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
170 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
173 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
174 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
175 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
176 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
177 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
178 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
179 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
182 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
183 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
184 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
185 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
186 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
187 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
188 %newobject MEDCoupling::MEDFileFieldMultiTS::Aggregate;
190 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::New;
191 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::field;
192 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::LoadSpecificEntities;
193 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getUndergroundDataArray;
194 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::convertToDouble;
195 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevel;
196 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtTopLevel;
197 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldOnMeshAtLevel;
198 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevelOld;
200 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::New;
201 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::field;
202 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::LoadSpecificEntities;
203 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getUndergroundDataArray;
204 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::convertToDouble;
205 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevel;
206 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtTopLevel;
207 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldOnMeshAtLevel;
208 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevelOld;
210 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::New;
211 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::field;
212 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::LoadSpecificEntities;
213 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getUndergroundDataArray;
214 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::convertToDouble;
215 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevel;
216 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtTopLevel;
217 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldOnMeshAtLevel;
218 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevelOld;
220 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
221 %newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
222 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
223 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
224 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
225 %newobject MEDCoupling::MEDFileField1TS::New;
226 %newobject MEDCoupling::MEDFileField1TS::field;
227 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
228 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
229 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
230 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
231 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
232 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
233 %newobject MEDCoupling::MEDFileField1TS::convertToInt64;
235 %newobject MEDCoupling::MEDFileInt32Field1TS::New;
236 %newobject MEDCoupling::MEDFileInt32Field1TS::field;
237 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevel;
238 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtTopLevel;
239 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldOnMeshAtLevel;
240 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevelOld;
241 %newobject MEDCoupling::MEDFileInt32Field1TS::getUndergroundDataArray;
242 %newobject MEDCoupling::MEDFileInt32Field1TS::convertToDouble;
244 %newobject MEDCoupling::MEDFileInt64Field1TS::New;
245 %newobject MEDCoupling::MEDFileInt64Field1TS::field;
246 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevel;
247 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtTopLevel;
248 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldOnMeshAtLevel;
249 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevelOld;
250 %newobject MEDCoupling::MEDFileInt64Field1TS::getUndergroundDataArray;
251 %newobject MEDCoupling::MEDFileInt64Field1TS::convertToDouble;
253 %newobject MEDCoupling::MEDFileFloatField1TS::New;
254 %newobject MEDCoupling::MEDFileFloatField1TS::field;
255 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevel;
256 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtTopLevel;
257 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldOnMeshAtLevel;
258 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevelOld;
259 %newobject MEDCoupling::MEDFileFloatField1TS::getUndergroundDataArray;
260 %newobject MEDCoupling::MEDFileFloatField1TS::convertToDouble;
262 %newobject MEDCoupling::MEDFileData::New;
263 %newobject MEDCoupling::MEDFileData::deepCopy;
264 %newobject MEDCoupling::MEDFileData::getMeshes;
265 %newobject MEDCoupling::MEDFileData::getFields;
266 %newobject MEDCoupling::MEDFileData::getParams;
267 %newobject MEDCoupling::MEDFileData::Aggregate;
269 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
271 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
272 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
273 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
274 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
275 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
276 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
277 %newobject MEDCoupling::MEDFileParameters::New;
278 %newobject MEDCoupling::MEDFileParameters::deepCopy;
279 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
280 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
281 %newobject MEDCoupling::MEDFileParameters::__getitem__;
283 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
284 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
285 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
286 %newobject MEDCoupling::MEDFileJointCorrespondence::getCorrespondence;
287 %newobject MEDCoupling::MEDFileJointOneStep::New;
288 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
289 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
290 %newobject MEDCoupling::MEDFileJointOneStep::getCorrespondenceAtPos;
291 %newobject MEDCoupling::MEDFileJointOneStep::__getitem__;
292 %newobject MEDCoupling::MEDFileJoint::New;
293 %newobject MEDCoupling::MEDFileJoint::deepCopy;
294 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
295 %newobject MEDCoupling::MEDFileJoint::getStepAtPos;
296 %newobject MEDCoupling::MEDFileJoint::__getitem__;
297 %newobject MEDCoupling::MEDFileJoints::New;
298 %newobject MEDCoupling::MEDFileJoints::deepCopy;
299 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
300 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
301 %newobject MEDCoupling::MEDFileJoints::__getitem__;
302 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
303 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
304 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
305 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
306 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
307 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
308 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
309 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
310 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
312 %newobject MEDCoupling::SauvWriter::New;
313 %newobject MEDCoupling::SauvReader::New;
314 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
317 %newobject MEDCoupling::MEDFileMeshStruct::New;
318 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
319 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
320 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
321 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
322 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
324 %newobject MEDCoupling::MeshFormatReader::loadInMEDFileDS;
325 %newobject MEDCoupling::MeshFormatReader::MeshFormatReader;
326 %newobject MEDCoupling::MeshFormatWriter::MeshFormatWriter;
328 %feature("unref") MEDFileMesh "$this->decrRef();"
329 %feature("unref") MEDFileUMesh "$this->decrRef();"
330 %feature("unref") MEDFileCMesh "$this->decrRef();"
331 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
332 %feature("unref") MEDFileMeshes "$this->decrRef();"
333 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
334 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
335 %feature("unref") MEDFileField1TS "$this->decrRef();"
336 %feature("unref") MEDFileInt32Field1TS "$this->decrRef();"
337 %feature("unref") MEDFileInt64Field1TS "$this->decrRef();"
338 %feature("unref") MEDFileFloatField1TS "$this->decrRef();"
339 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
340 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
341 %feature("unref") MEDFileInt32FieldMultiTS "$this->decrRef();"
342 %feature("unref") MEDFileInt64FieldMultiTS "$this->decrRef();"
343 %feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();"
344 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
345 %feature("unref") MEDFileStructureElements "$this->decrRef();"
346 %feature("unref") MEDFileFields "$this->decrRef();"
347 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
348 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
349 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
350 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
351 %feature("unref") MEDFileParameters "$this->decrRef();"
352 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
353 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
354 %feature("unref") MEDFileJoint "$this->decrRef();"
355 %feature("unref") MEDFileJoints "$this->decrRef();"
356 %feature("unref") MEDFileEquivalences "$this->decrRef();"
357 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
358 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
359 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
360 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
361 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
362 %feature("unref") MEDFileData "$this->decrRef();"
363 %feature("unref") SauvReader "$this->decrRef();"
364 %feature("unref") SauvWriter "$this->decrRef();"
365 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
366 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
367 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
368 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
369 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
370 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
372 namespace MEDCoupling
375 std::string MEDFileVersionStr();
376 std::string MEDFileVersionOfFileStr(const std::string& fileName);
377 void SetEpsilonForNodeComp(double val);
378 void SetCompPolicyForCell(int val);
379 void SetTooLongStrPolicy(int val);
380 void CheckFileForRead(const std::string& fileName);
381 std::vector<std::string> GetMeshNames(const std::string& fileName);
382 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName);
383 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName);
384 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName);
385 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName);
386 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName);
387 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
388 std::vector<std::string> GetAllFieldNames(const std::string& fileName);
389 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName);
390 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
391 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
392 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order);
393 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj);
394 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
395 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
396 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
397 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
398 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName);
399 MEDCoupling::MEDCouplingField *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
400 MEDCoupling::MEDCouplingField *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
401 MEDCoupling::MEDCouplingField *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
402 MEDCoupling::MEDCouplingField *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
403 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch);
404 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
405 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
406 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
407 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
408 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingField *f);
411 %rename (MEDFileVersion) MEDFileVersionSwig;
412 %rename (GetFieldIterations) GetFieldIterationsSwig;
413 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
414 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
415 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
416 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
417 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
418 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
419 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
420 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
421 %rename (WriteUMeshes) WriteUMeshesSwig;
422 %rename (GetTypesOfField) GetTypesOfFieldSwig;
423 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
424 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
425 %rename (ReadField) ReadFieldSwig;
426 %rename (GetFamiliesGroupsInfo) GetFamiliesGroupsInfoSwig;
430 PyObject *MEDFileVersionSwig()
432 int major,minor,release;
433 MEDCoupling::MEDFileVersion(major,minor,release);
434 PyObject *ret(PyTuple_New(3));
435 PyTuple_SetItem(ret,0,SWIG_From_int(major));
436 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
437 PyTuple_SetItem(ret,2,SWIG_From_int(release));
441 int MEDFileSizeOfMedInt()
443 return 8*sizeof(med_int);
446 PyObject *GetFamiliesGroupsInfoSwig(const std::string& fileName, const std::string& meshName)
448 std::map<std::string,mcIdType> families;
449 std::map<std::string,std::vector<std::string>> groupsOnFam;
450 MEDCoupling::GetFamiliesGroupsInfo(fileName,meshName,families,groupsOnFam);
451 AutoPyPtr a(convertMapStringInt(families)),b(convertMapStringVectString(groupsOnFam));
452 AutoPyPtr ret(PyTuple_New(2));
453 PyTuple_SetItem(ret,0,a.retn());
454 PyTuple_SetItem(ret,1,b.retn());
458 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName)
460 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName));
464 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName)
466 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName));
470 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order)
472 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
476 MEDCoupling::MEDCouplingField *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
478 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
482 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
484 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
485 PyObject *ret=PyList_New(res.size());
487 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
489 PyObject *elt=PyTuple_New(2);
490 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
491 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
492 PyList_SetItem(ret,rk,elt);
497 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName)
499 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
500 PyObject *ret=PyList_New(res.size());
502 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
504 PyObject *elt=PyTuple_New(3);
505 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
506 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
507 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
508 PyList_SetItem(ret,rk,elt);
513 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
515 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
516 PyObject *ret=PyList_New(res.size());
518 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
520 PyObject *elt=PyTuple_New(2);
521 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
522 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
523 PyList_SetItem(ret,rk,elt);
528 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
530 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
531 PyObject *ret=PyList_New(res.size());
533 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
535 PyObject *elt=PyTuple_New(2);
536 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
537 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
538 PyList_SetItem(ret,rk,elt);
543 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName)
545 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
546 PyObject *ret=PyList_New(res.size());
548 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
550 PyObject *elt=PyTuple_New(2);
551 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
552 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
553 PyList_SetItem(ret,rk,elt);
558 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName)
560 int meshDim,spaceDim;
561 mcIdType numberOfNodes;
562 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
563 PyObject *ret=PyTuple_New(4);
564 PyObject *elt0=PyList_New(res.size());
566 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
568 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
570 PyObject *elt1=PyList_New(obj2.size());
571 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
573 PyObject *elt2=PyTuple_New(2);
574 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
575 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
576 PyList_SetItem(elt1,j,elt2);
578 PyList_SetItem(elt0,i,elt1);
580 PyTuple_SetItem(ret,0,elt0);
581 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
582 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
583 PyTuple_SetItem(ret,3,SWIG_From_long(numberOfNodes));
587 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
588 const std::string& fieldName, PyObject *liIts)
590 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
591 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
592 return convertFieldDoubleVecToPy(res);
595 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
597 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
598 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
599 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
602 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
604 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
605 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
606 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
609 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch)
611 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
612 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
613 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
616 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
618 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
619 std::size_t size=v.size();
620 PyObject *ret=PyList_New(size);
621 for(std::size_t i=0;i<size;i++)
622 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
626 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
628 std::vector<std::string> grps;
629 converPyListToVecString(li,grps);
630 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
633 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
635 std::vector<std::string> fams;
636 converPyListToVecString(li,fams);
637 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
641 namespace MEDCoupling
643 class MEDFileWritable
646 void copyOptionsFrom(const MEDFileWritable& other) const;
647 int getTooLongStrPolicy() const;
648 void setTooLongStrPolicy(int newVal);
649 int getZipConnPolicy();
650 void setZipConnPolicy(int newVal);
653 class MEDFileWritableStandAlone : public MEDFileWritable
656 void write(const std::string& fileName, int mode) const;
657 void write33(const std::string& fileName, int mode) const;
658 void write30(const std::string& fileName, int mode) const;
661 DataArrayByte *serialize() const
663 MCAuto<DataArrayByte> ret(self->serialize());
667 PyObject *__getstate__()
669 PyObject *ret(PyList_New(0));
673 void __setstate__(PyObject *inp)
679 class MEDFileMeshReadSelector
682 MEDFileMeshReadSelector();
683 MEDFileMeshReadSelector(unsigned int code);
684 mcIdType getNumberOfCoordsLoadSessions();
685 void setNumberOfCoordsLoadSessions(mcIdType newNbOfCoordsLoadSessions);
686 unsigned int getCode() const;
687 void setCode(unsigned int newCode);
688 bool isCellFamilyFieldReading() const;
689 bool isNodeFamilyFieldReading() const;
690 bool isCellNameFieldReading() const;
691 bool isNodeNameFieldReading() const;
692 bool isCellNumFieldReading() const;
693 bool isNodeNumFieldReading() const;
694 bool isGlobalNodeNumFieldReading() const;
695 void setCellFamilyFieldReading(bool b);
696 void setNodeFamilyFieldReading(bool b);
697 void setCellNameFieldReading(bool b);
698 void setNodeNameFieldReading(bool b);
699 void setCellNumFieldReading(bool b);
700 void setNodeNumFieldReading(bool b);
701 void setGlobalNodeNumFieldReading(bool b);
704 std::string __str__() const
706 std::ostringstream oss;
711 std::string __repr__() const
713 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
719 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
722 static MEDFileJointCorrespondence *New();
723 static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence) // nodes
725 static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence, // cells
726 INTERP_KERNEL::NormalizedCellType loc_geo_type,
727 INTERP_KERNEL::NormalizedCellType rem_geo_type)
729 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
730 MEDFileJointCorrespondence *deepCopy() const;
731 MEDFileJointCorrespondence *shallowCpy() const;
732 void setIsNodal(bool isNodal);
733 bool getIsNodal() const;
734 bool isEqual(const MEDFileJointCorrespondence *other) const;
735 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
736 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
737 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
738 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
739 void setCorrespondence(DataArrayIdType *corr);
740 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const;
741 std::string simpleRepr() const;
744 MEDFileJointCorrespondence()
746 return MEDFileJointCorrespondence::New();
748 MEDFileJointCorrespondence(DataArrayIdType* correspondence)
750 return MEDFileJointCorrespondence::New(correspondence);
752 MEDFileJointCorrespondence(DataArrayIdType* correspondence, // cells
753 INTERP_KERNEL::NormalizedCellType loc_geo_type,
754 INTERP_KERNEL::NormalizedCellType rem_geo_type)
756 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
759 std::string __str__() const
761 return self->simpleRepr();
764 DataArrayIdType *getCorrespondence() const
766 const DataArrayIdType *ret(self->getCorrespondence());
769 return const_cast<DataArrayIdType *>(ret);
774 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
777 static MEDFileJointOneStep *New(int dt=-1, int it=-1);
778 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1);
779 MEDFileJointOneStep *deepCopy() const;
780 MEDFileJointOneStep *shallowCpy() const;
781 bool isEqual(const MEDFileJointOneStep *other) const;
782 void setOrder(int order);
783 int getOrder() const;
784 void setIteration(int it);
785 int getIteration() const;
786 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
787 void clearCorrespondences();
788 int getNumberOfCorrespondences() const;
789 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const;
790 std::string simpleRepr() const;
793 MEDFileJointOneStep()
795 return MEDFileJointOneStep::New();
798 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number)
800 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
803 std::string __str__() const
805 return self->simpleRepr();
808 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const
810 MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
816 MEDFileJointCorrespondence *__getitem__(int i) const
818 return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
823 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
826 static MEDFileJoint *New();
827 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num);
828 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum);
829 MEDFileJoint *deepCopy() const;
830 MEDFileJoint *shallowCpy() const;
831 bool isEqual(const MEDFileJoint *other) const;
832 void setLocalMeshName(const std::string& name);
833 std::string getLocalMeshName() const;
834 void setRemoteMeshName(const std::string& name);
835 std::string getRemoteMeshName() const;
836 void setDescription(const std::string& name);
837 std::string getDescription() const;
838 void setJointName(const std::string& name);
839 std::string getJointName() const;
840 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
841 void setDomainNumber(const int& number);
842 int getDomainNumber() const;
843 void pushStep(MEDFileJointOneStep* step);
844 int getNumberOfSteps() const;
845 std::string simpleRepr() const;
850 return MEDFileJoint::New();
853 MEDFileJoint(const std::string& fileName, const std::string& mName, int num)
855 return MEDFileJoint::New(fileName,mName,num);
858 MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum)
860 return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
863 std::string __str__() const
865 return self->simpleRepr();
868 MEDFileJointOneStep *getStepAtPos(int i) const
870 MEDFileJointOneStep *ret(self->getStepAtPos(i));
876 MEDFileJointOneStep *__getitem__(int i)
878 return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
883 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
886 static MEDFileJoints *New();
887 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName);
888 MEDFileJoints *deepCopy() const;
889 std::string simpleRepr() const;
890 std::string getMeshName() const;
891 int getNumberOfJoints() const;
892 std::vector<std::string> getJointsNames() const;
893 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
894 void resize(int newSize);
895 void pushJoint(MEDFileJoint *joint);
896 void setJointAtPos(int i, MEDFileJoint *joint);
897 void destroyJointAtPos(int i);
902 return MEDFileJoints::New();
905 MEDFileJoints(const std::string& fileName, const std::string& meshName)
907 return MEDFileJoints::New(fileName,meshName);
910 std::string __str__() const
912 return self->simpleRepr();
915 MEDFileJoint *__getitem__(PyObject *obj)
917 static const char msg[]="MEDFileJoints::__getitem__ : only integer or string with meshname supported !";
920 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
925 MEDFileJoint *ret(self->getJointWithName(convertPyObjectToStr(obj,msg)));
933 return self->getNumberOfJoints();
936 MEDFileJoint *getJointAtPos(int i) const
938 MEDFileJoint *ret=self->getJointAtPos(i);
944 MEDFileJoint *getJointWithName(const std::string& paramName) const
946 MEDFileJoint *ret=self->getJointWithName(paramName);
954 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
957 MEDFileEquivalenceBase();
960 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
963 MEDFileEquivalenceData();
965 void setArray(DataArrayInt32 *data);
968 DataArrayInt32 *getArray()
970 DataArrayInt32 *ret(self->getArray());
971 if(ret) ret->incrRef();
977 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
980 MEDFileEquivalenceNode();
983 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
986 MEDFileEquivalenceCell();
989 std::size_t size() const;
990 void setArray(int meshDimRelToMax, DataArrayInt32 *da);
991 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt32 *da);
994 DataArrayInt32 *getArray(INTERP_KERNEL::NormalizedCellType type)
996 DataArrayInt32 *ret(self->getArray(type));
997 if(ret) ret->incrRef();
1001 PyObject *getTypes() const
1003 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
1004 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1005 PyObject *res=PyList_New(result.size());
1006 for(int i=0;iL!=result.end(); i++, iL++)
1007 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1013 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
1016 MEDFileEquivalencePair();
1018 std::string getName() const;
1019 void setName(const std::string& name);
1020 std::string getDescription() const;
1021 void setDescription(const std::string& descr);
1022 void setArray(int meshDimRelToMaxExt, DataArrayInt32 *da);;
1025 MEDFileEquivalenceCell *initCell()
1027 MEDFileEquivalenceCell *ret(self->initCell());
1028 if(ret) ret->incrRef();
1032 MEDFileEquivalenceNode *initNode()
1034 MEDFileEquivalenceNode *ret(self->initNode());
1035 if(ret) ret->incrRef();
1039 MEDFileEquivalenceCell *getCell()
1041 MEDFileEquivalenceCell *ret(self->getCell());
1042 if(ret) ret->incrRef();
1046 MEDFileEquivalenceNode *getNode()
1048 MEDFileEquivalenceNode *ret(self->getNode());
1049 if(ret) ret->incrRef();
1055 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
1058 MEDFileEquivalences();
1061 std::vector<std::string> getEquivalenceNames() const;
1062 void killEquivalenceWithName(const std::string& name);
1063 void killEquivalenceAt(int i);
1067 MEDFileEquivalencePair *getEquivalence(int i)
1069 MEDFileEquivalencePair *ret(self->getEquivalence(i));
1070 if(ret) ret->incrRef();
1073 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name)
1075 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
1076 if(ret) ret->incrRef();
1080 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name)
1082 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
1083 if(ret) ret->incrRef();
1089 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
1092 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1093 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1094 static MEDFileMesh *New(DataArrayByte *db);
1095 virtual MEDFileMesh *createNewEmpty() const;
1096 virtual MEDFileMesh *deepCopy() const;
1097 virtual MEDFileMesh *shallowCpy() const;
1098 virtual void clearNonDiscrAttributes() const;
1099 void setName(const std::string& name);
1100 std::string getName();
1101 std::string getUnivName() const;
1102 bool getUnivNameWrStatus() const;
1103 void setUnivNameWrStatus(bool newStatus);
1104 void setDescription(const std::string& name);
1105 std::string getDescription() const;
1106 void setOrder(int order);
1107 int getOrder() const;
1108 void setIteration(int it);
1110 void setTimeValue(double time);
1111 void setTime(int dt, int it, double time);
1112 double getTimeValue() const;
1113 void setTimeUnit(const std::string& unit);
1114 std::string getTimeUnit() const;
1115 void setAxisType(MEDCouplingAxisType at);
1116 MEDCouplingAxisType getAxisType() const;
1117 virtual int getNumberOfNodes() const;
1118 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const;
1119 virtual bool hasImplicitPart() const;
1120 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const;
1121 virtual void releaseImplicitPartIfAny() const;
1122 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const;
1123 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const;
1124 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const;
1125 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const;
1126 virtual std::vector<mcIdType> getDistributionOfTypes(int meshDimRelToMax) const;
1127 virtual MEDFileMesh *cartesianize() const;
1128 std::vector<int> getNonEmptyLevels() const;
1129 std::vector<int> getNonEmptyLevelsExt() const;
1130 int getSizeAtLevel(int meshDimRelToMaxExt) const;
1132 bool existsGroup(const std::string& groupName) const;
1133 bool existsFamily(int famId) const;
1134 bool existsFamily(const std::string& familyName) const;
1135 void setFamilyId(const std::string& familyName, int id);
1136 void setFamilyIdUnique(const std::string& familyName, int id);
1137 void addFamily(const std::string& familyName, int id);
1138 void addFamilyOnGrp(const std::string& grpName, const std::string& famName);
1139 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName);
1140 virtual bool keepFamIdsOnlyOnLevs(const std::vector<mcIdType>& famIds, const std::vector<int>& levs);
1141 void copyFamGrpMapsFrom(const MEDFileMesh& other);
1144 void clearFamGrpMaps();
1145 const std::map<std::string,int>& getFamilyInfo() const;
1146 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const;
1147 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const;
1148 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const;
1149 std::vector<mcIdType> getFamiliesIdsOnGroup(const std::string& name) const;
1150 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams);
1151 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<mcIdType>& famIds);
1152 std::vector<std::string> getGroupsOnFamily(const std::string& name) const;
1153 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps);
1154 std::vector<std::string> getGroupsNames() const;
1155 std::vector<std::string> getFamiliesNames() const;
1156 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
1157 std::vector<mcIdType> getGrpNonEmptyLevelsExt(const std::string& grp) const;
1158 std::vector<mcIdType> getGrpNonEmptyLevels(const std::string& grp) const;
1159 std::vector<mcIdType> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
1160 std::vector<mcIdType> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
1161 std::vector<mcIdType> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
1162 std::vector<mcIdType> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
1163 std::vector<mcIdType> getFamNonEmptyLevels(const std::string& fam) const;
1164 std::vector<mcIdType> getFamNonEmptyLevelsExt(const std::string& fam) const;
1165 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const;
1166 static std::string GetMagicFamilyStr();
1167 void assignFamilyNameWithGroupName();
1168 std::vector<std::string> removeEmptyGroups();
1169 void removeGroupAtLevel(int meshDimRelToMaxExt, const std::string& name);
1170 void removeGroup(const std::string& name);
1171 void removeFamily(const std::string& name);
1172 std::vector<std::string> removeOrphanGroups();
1173 std::vector<std::string> removeOrphanFamilies();
1174 void removeFamiliesReferedByNoGroups();
1175 void rearrangeFamilies();
1177 void checkOrphanFamilyZero() const;
1178 void changeGroupName(const std::string& oldName, const std::string& newName);
1179 void changeFamilyName(const std::string& oldName, const std::string& newName);
1180 void changeFamilyId(int oldId, int newId);
1181 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames);
1182 void setFamilyInfo(const std::map<std::string,mcIdType>& info);
1183 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1184 int getFamilyId(const std::string& name) const;
1185 int getMaxAbsFamilyId() const;
1186 int getMaxFamilyId() const;
1187 int getMinFamilyId() const;
1188 int getTheMaxAbsFamilyId() const;
1189 int getTheMaxFamilyId() const;
1190 int getTheMinFamilyId() const;
1191 virtual int getMaxAbsFamilyIdInArrays() const;
1192 virtual int getMaxFamilyIdInArrays() const;
1193 virtual int getMinFamilyIdInArrays() const;
1194 DataArrayIdType *getAllFamiliesIdsReferenced() const;
1195 DataArrayIdType *computeAllFamilyIdsInUse() const;
1196 std::vector<mcIdType> getFamiliesIds(const std::vector<std::string>& famNames) const;
1197 std::string getFamilyNameGivenId(int id) const;
1198 bool ensureDifferentFamIdsPerLevel();
1199 void normalizeFamIdsTrio();
1200 void normalizeFamIdsMEDFile();
1201 virtual int getMeshDimension() const;
1202 virtual std::string simpleRepr() const;
1203 virtual std::string advancedRepr() const;
1205 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const;
1206 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayIdType *famArr);
1207 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayIdType *renumArr);
1208 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr);
1209 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayIdType *globalNumArr);
1210 virtual void addNodeGroup(const DataArrayIdType *ids);
1211 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayIdType *ids);
1212 virtual DataArrayIdType *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1213 virtual DataArrayIdType *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1214 virtual DataArrayIdType *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1215 virtual DataArrayIdType *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1216 virtual DataArrayIdType *getNodeGroupArr(const std::string& grp, bool renum=false) const;
1217 virtual DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1218 virtual DataArrayIdType *getNodeFamilyArr(const std::string& fam, bool renum=false) const;
1219 virtual DataArrayIdType *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const;
1220 int getNumberOfJoints();
1221 MEDFileJoints *getJoints();
1222 void setJoints( MEDFileJoints* joints );
1223 void initializeEquivalences();
1224 void killEquivalences();
1225 bool presenceOfStructureElements() const;
1226 void killStructureElements();
1229 std::string __str__() const
1231 return self->simpleRepr();
1234 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const
1236 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1239 static INTERP_KERNEL::NormalizedCellType ConvertFromMEDFileGeoType(int geoType)
1241 med_geometry_type geoType2((med_geometry_type) geoType);
1242 return MEDFileMesh::ConvertFromMEDFileGeoType(geoType2);
1248 double tmp0=self->getTime(tmp1,tmp2);
1249 PyObject *res = PyList_New(3);
1250 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1251 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1252 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1256 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const
1259 bool ret0=self->isEqual(other,eps,what);
1260 PyObject *res=PyList_New(2);
1261 PyObject *ret0Py=ret0?Py_True:Py_False;
1263 PyList_SetItem(res,0,ret0Py);
1264 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1268 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false)
1270 std::vector<const DataArrayIdType *> grps;
1271 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grps);
1272 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1275 PyObject *areFamsEqual(const MEDFileMesh *other) const
1278 bool ret0=self->areFamsEqual(other,what);
1279 PyObject *res=PyList_New(2);
1280 PyObject *ret0Py=ret0?Py_True:Py_False;
1282 PyList_SetItem(res,0,ret0Py);
1283 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1287 PyObject *areGrpsEqual(const MEDFileMesh *other) const
1290 bool ret0=self->areGrpsEqual(other,what);
1291 PyObject *res=PyList_New(2);
1292 PyObject *ret0Py=ret0?Py_True:Py_False;
1294 PyList_SetItem(res,0,ret0Py);
1295 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1299 PyObject *getAllGeoTypes() const
1301 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1302 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1303 PyObject *res=PyList_New(result.size());
1304 for(int i=0;iL!=result.end(); i++, iL++)
1305 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1309 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const
1311 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1312 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1313 PyObject *res=PyList_New(result.size());
1314 for(int i=0;iL!=result.end(); i++, iL++)
1315 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1319 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const
1321 const DataArrayIdType *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1324 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1327 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt)
1329 const DataArrayIdType *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1332 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1335 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const
1337 const DataArrayIdType *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1340 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1343 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const
1345 const DataArrayIdType *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1348 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1351 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const
1353 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1356 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1359 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created)
1362 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1363 PyObject *ret=PyTuple_New(2);
1364 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1365 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1369 PyObject *unPolyze()
1371 DataArrayIdType *ret3=0;
1372 std::vector<mcIdType> ret1,ret2;
1373 bool ret0=self->unPolyze(ret1,ret2,ret3);
1374 PyObject *ret=PyTuple_New(4);
1375 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1377 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1378 for(int j=0;j<(int)ret1.size()/3;j++)
1380 PyObject *retLev2=PyList_New(3);
1381 PyList_SetItem(retLev2,0,PyInt_FromLong(ret1[3*j]));
1382 PyList_SetItem(retLev2,1,PyInt_FromLong(ret1[3*j+1]));
1383 PyList_SetItem(retLev2,2,PyInt_FromLong(ret1[3*j+2]));
1384 PyList_SetItem(retLev1_0,j,retLev2);
1386 PyTuple_SetItem(ret,1,retLev1_0);
1388 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1389 for(int j=0;j<(int)ret2.size()/3;j++)
1391 PyObject *retLev2=PyList_New(3);
1392 PyList_SetItem(retLev2,0,PyInt_FromLong(ret2[3*j]));
1393 PyList_SetItem(retLev2,1,PyInt_FromLong(ret2[3*j+1]));
1394 PyList_SetItem(retLev2,2,PyInt_FromLong(ret2[3*j+2]));
1395 PyList_SetItem(retLev1_1,j,retLev2);
1397 PyTuple_SetItem(ret,2,retLev1_1);
1399 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1403 MEDFileEquivalences *getEquivalences()
1405 MEDFileEquivalences *ret(self->getEquivalences());
1406 if(ret) ret->incrRef();
1410 virtual DataArrayIdType *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const
1412 MCAuto<DataArrayIdType> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1418 class MEDFileUMesh : public MEDFileMesh
1421 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1422 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1423 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem);
1424 static MEDFileUMesh *New(DataArrayByte *db);
1425 static MEDFileUMesh *New();
1426 static const char *GetSpeStr4ExtMesh();
1428 int getSpaceDimension() const;
1429 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1430 void checkConsistency() const;
1431 void checkSMESHConsistency() const;
1432 void clearNodeAndCellNumbers();
1434 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1435 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1436 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1437 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1438 DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1439 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const;
1440 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const;
1441 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const;
1442 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const;
1443 void forceComputationOfParts() const;
1444 void computeRevNum() const;
1446 void setFamilyNameAttachedOnId(int id, const std::string& newFamName);
1447 void setCoords(DataArrayDouble *coords);
1448 void setCoordsForced(DataArrayDouble *coords);
1449 void eraseGroupsAtLevel(int meshDimRelToMaxExt);
1450 void removeMeshAtLevel(int meshDimRelToMax);
1451 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m);
1452 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false);
1453 void optimizeFamilies();
1454 DataArrayIdType *computeFetchedNodeIds() const;
1455 DataArrayIdType *zipCoords();
1456 DataArrayIdType *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1457 DataArrayIdType *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1458 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const;
1459 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const;
1460 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const;
1461 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const;
1464 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1466 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1469 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1471 return MEDFileUMesh::New(fileName,mrs);
1474 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem)
1476 return MEDFileUMesh::New(mem);
1479 MEDFileUMesh(DataArrayByte *db)
1481 return MEDFileUMesh::New(db);
1486 return MEDFileUMesh::New();
1489 static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<mcIdType>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1491 std::vector<int> typesCpp1;
1492 convertPyToNewIntArr3(types,typesCpp1);
1493 std::size_t sz(typesCpp1.size());
1494 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1495 for(std::size_t ii=0;ii<sz;ii++)
1496 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1497 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1500 static PyObject *LoadPartCoords(const std::string& fileName, const std::string& mName, int dt, int it, const std::vector<std::string>& infosOnComp, mcIdType startNodeId, mcIdType stopNodeId)
1502 MCAuto<DataArrayDouble> coords;
1503 MCAuto<PartDefinition> partCoords;
1504 MCAuto<DataArrayIdType> famCoords,numCoords;
1505 MCAuto<DataArrayAsciiChar> nameCoord;
1506 MEDFileUMesh::LoadPartCoords(fileName,mName,dt,it,infosOnComp,startNodeId,stopNodeId,coords,partCoords,famCoords,numCoords,nameCoord);
1507 PyObject *ret(PyTuple_New(5));
1508 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1509 PyTuple_SetItem(ret,1,convertPartDefinition(partCoords.retn(),SWIG_POINTER_OWN | 0));
1510 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(famCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1511 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(numCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1512 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(nameCoord.retn()),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 ));
1516 PyObject *__getstate__()
1518 std::vector<double> a0;
1519 std::vector<mcIdType> a1;
1520 std::vector<std::string> a2;
1521 std::vector< MCAuto<DataArrayIdType> > a3;
1522 MCAuto<DataArrayDouble> a4;
1523 self->serialize(a0,a1,a2,a3,a4);
1524 PyObject *ret(PyTuple_New(5));
1525 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1526 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1527 std::size_t sz(a2.size());
1528 PyObject *ret2(PyList_New(sz));
1529 for(std::size_t i=0;i<sz;i++)
1530 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1531 PyTuple_SetItem(ret,2,ret2);
1533 PyObject *ret3(PyList_New(sz));
1534 for(std::size_t i=0;i<sz;i++)
1536 DataArrayIdType *elt(a3[i]);
1539 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1541 PyTuple_SetItem(ret,3,ret3);
1542 DataArrayDouble *ret4(a4);
1545 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1549 void __setstate__(PyObject *inp)
1551 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1552 if(!PyTuple_Check(inp))
1553 throw INTERP_KERNEL::Exception(MSG);
1554 std::size_t sz(PyTuple_Size(inp));
1556 throw INTERP_KERNEL::Exception(MSG);
1557 std::vector<double> a0;
1558 std::vector<mcIdType> a1;
1559 std::vector<std::string> a2;
1560 std::vector< MCAuto<DataArrayIdType> > a3;
1561 MCAuto<DataArrayDouble> a4;
1563 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1565 fillArrayWithPyListDbl3(a0py,tmp,a0);
1566 convertPyToNewIntArr3(a1py,a1);
1567 fillStringVector(a2py,a2);
1569 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1571 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1572 if(!SWIG_IsOK(status))
1573 throw INTERP_KERNEL::Exception(MSG);
1574 a4=reinterpret_cast<DataArrayDouble *>(argp);
1575 if((DataArrayDouble *)a4)
1578 std::vector< DataArrayIdType * > a3Tmp;
1579 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayIdType *>(b0py,SWIGTITraits<mcIdType>::TI,"DataArrayInt",a3Tmp);
1580 std::size_t sz(a3Tmp.size());
1582 for(std::size_t i=0;i<sz;i++)
1586 a3Tmp[i]->incrRef();
1588 self->unserialize(a0,a1,a2,a3,a4);
1592 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh)
1595 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1596 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1599 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1602 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1605 self->setMeshAtLevel(meshDimRelToMax,m1);
1608 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1611 void __delitem__(int meshDimRelToMax)
1613 self->removeMeshAtLevel(meshDimRelToMax);
1616 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const
1618 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1620 DataArrayDouble *a,*a2;
1621 DataArrayDoubleTuple *aa,*aa2;
1622 std::vector<double> bb,bb2;
1624 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1625 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1626 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1630 static MEDFileUMesh *Aggregate(PyObject *meshes)
1632 std::vector<const MEDFileUMesh *> meshesCpp;
1633 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1634 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1638 PyObject *getAllDistributionOfTypes() const
1640 std::vector< std::pair<int,mcIdType> > ret(self->getAllDistributionOfTypes());
1641 return convertVecPairIntToPy(ret);
1644 DataArrayIdType *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const
1646 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1647 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1648 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1651 MEDFileUMesh *extractPart(PyObject *extractDef) const
1653 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1654 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1655 return self->extractPart(extractDefCpp);
1658 void setMeshes(PyObject *li, bool renum=false)
1660 std::vector<const MEDCouplingUMesh *> ms;
1661 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1662 self->setMeshes(ms,renum);
1665 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false)
1667 std::vector<const MEDCouplingUMesh *> ms;
1668 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1669 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1672 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false)
1674 std::vector<const MEDCouplingUMesh *> ms;
1675 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1676 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1679 DataArrayDouble *getCoords() const
1681 DataArrayDouble *ret=self->getCoords();
1687 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const
1689 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1692 return const_cast<PartDefinition *>(ret);
1695 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1)
1697 DataArrayIdType *ret0=0,*ret1=0,*ret2=0;
1698 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1699 PyObject *ret=PyTuple_New(3);
1700 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1701 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1702 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1706 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const
1708 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1714 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const
1716 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1717 std::size_t sz(tmp.size());
1718 PyObject *ret=PyList_New(sz);
1719 for(std::size_t i=0;i<sz;i++)
1723 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1730 class MEDFileStructuredMesh : public MEDFileMesh
1735 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const
1737 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1745 class MEDFileCMesh : public MEDFileStructuredMesh
1748 static MEDFileCMesh *New();
1749 static MEDFileCMesh *New(DataArrayByte *db);
1750 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1751 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1752 void setMesh(MEDCouplingCMesh *m);
1753 int getSpaceDimension() const;
1758 return MEDFileCMesh::New();
1761 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1763 return MEDFileCMesh::New(fileName,mrs);
1766 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1768 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1771 MEDFileCMesh(DataArrayByte *db)
1773 return MEDFileCMesh::New(db);
1776 PyObject *getMesh() const
1778 const MEDCouplingCMesh *tmp=self->getMesh();
1781 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1786 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1789 static MEDFileCurveLinearMesh *New();
1790 static MEDFileCurveLinearMesh *New(DataArrayByte *db);
1791 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1792 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1793 void setMesh(MEDCouplingCurveLinearMesh *m);
1794 int getSpaceDimension() const;
1795 int getMeshDimension() const;
1798 MEDFileCurveLinearMesh()
1800 return MEDFileCurveLinearMesh::New();
1803 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1805 return MEDFileCurveLinearMesh::New(fileName,mrs);
1808 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1810 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1813 MEDFileCurveLinearMesh(DataArrayByte *db)
1815 return MEDFileCurveLinearMesh::New(db);
1818 PyObject *getMesh() const
1820 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1823 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1828 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1831 static MEDFileMeshMultiTS *New();
1832 static MEDFileMeshMultiTS *New(const std::string& fileName);
1833 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName);
1834 MEDFileMeshMultiTS *deepCopy() const;
1835 std::string getName() const;
1836 void setOneTimeStep(MEDFileMesh *mesh1TimeStep);
1837 void cartesianizeMe();
1840 MEDFileMeshMultiTS()
1842 return MEDFileMeshMultiTS::New();
1845 MEDFileMeshMultiTS(const std::string& fileName)
1847 return MEDFileMeshMultiTS::New(fileName);
1850 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName)
1852 return MEDFileMeshMultiTS::New(fileName,mName);
1855 MEDFileMesh *getOneTimeStep() const
1857 MEDFileMesh *ret=self->getOneTimeStep();
1865 class MEDFileMeshesIterator
1872 MEDFileMesh *ret=self->nextt();
1876 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1880 PyErr_SetString(PyExc_StopIteration,"No more data.");
1887 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1890 static MEDFileMeshes *New();
1891 static MEDFileMeshes *New(DataArrayByte *db);
1892 MEDFileMeshes *deepCopy() const;
1893 int getNumberOfMeshes() const;
1894 std::vector<std::string> getMeshesNames() const;
1896 void resize(int newSize);
1897 void pushMesh(MEDFileMesh *mesh);
1898 void setMeshAtPos(int i, MEDFileMesh *mesh);
1899 void destroyMeshAtPos(int i);
1900 void cartesianizeMe();
1901 bool presenceOfStructureElements() const;
1902 void killStructureElements();
1907 return MEDFileMeshes::New();
1910 MEDFileMeshes(const std::string& fileName)
1912 return MEDFileMeshes::New(fileName);
1915 MEDFileMeshes(DataArrayByte *db)
1917 return MEDFileMeshes::New(db);
1920 std::string __str__() const
1922 return self->simpleRepr();
1925 MEDFileMesh *__getitem__(PyObject *obj)
1927 static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
1928 if(PyInt_Check(obj))
1930 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1935 MEDFileMesh *ret(self->getMeshWithName(convertPyObjectToStr(obj,msg)));
1941 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh)
1943 self->setMeshAtPos(obj,mesh);
1947 MEDFileMeshesIterator *__iter__()
1949 return self->iterator();
1954 return self->getNumberOfMeshes();
1957 MEDFileMesh *getMeshAtPos(int i) const
1959 MEDFileMesh *ret=self->getMeshAtPos(i);
1964 MEDFileMesh *getMeshWithName(const std::string& mname) const
1966 MEDFileMesh *ret=self->getMeshWithName(mname);
1974 class MEDFileFieldLoc : public RefCountObject
1977 std::string getName() const;
1978 int getDimension() const;
1979 int getNumberOfGaussPoints() const;
1980 int getNumberOfPointsInCells() const;
1981 const std::vector<double>& getRefCoords() const;
1982 const std::vector<double>& getGaussCoords() const;
1983 const std::vector<double>& getGaussWeights() const;
1984 bool isEqual(const MEDFileFieldLoc& other, double eps) const;
1987 std::string __str__() const
1989 return self->repr();
1994 class MEDFileFieldGlobsReal
1997 void resetContent();
1998 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
1999 void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
2000 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2001 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2002 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
2003 void checkGlobsCoherency() const;
2004 void checkGlobsPflsPartCoherency() const;
2005 void checkGlobsLocsPartCoherency() const;
2006 std::vector<std::string> getPfls() const;
2007 std::vector<std::string> getLocs() const;
2008 bool existsPfl(const std::string& pflName) const;
2009 bool existsLoc(const std::string& locName) const;
2010 std::string createNewNameOfPfl() const;
2011 std::string createNewNameOfLoc() const;
2012 std::vector< std::vector<int> > whichAreEqualProfiles() const;
2013 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
2014 virtual std::vector<std::string> getPflsReallyUsed() const;
2015 virtual std::vector<std::string> getLocsReallyUsed() const;
2016 virtual std::vector<std::string> getPflsReallyUsedMulti() const;
2017 virtual std::vector<std::string> getLocsReallyUsedMulti() const;
2018 void killProfileIds(const std::vector<int>& pflIds);
2019 void killLocalizationIds(const std::vector<int>& locIds);
2020 void changePflName(const std::string& oldName, const std::string& newName);
2021 void changeLocName(const std::string& oldName, const std::string& newName);
2022 int getNbOfGaussPtPerCell(int locId) const;
2023 int getLocalizationId(const std::string& loc) const;
2024 int getProfileId(const std::string& pfl) const;
2025 void killStructureElementsInGlobs();
2028 PyObject *getProfile(const std::string& pflName) const
2030 const DataArrayIdType *ret=self->getProfile(pflName);
2033 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2036 PyObject *getProfileFromId(int pflId) const
2038 const DataArrayIdType *ret=self->getProfileFromId(pflId);
2041 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2044 PyObject *getLocalizationFromId(int locId) const
2046 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
2049 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2052 PyObject *getLocalization(const std::string& locName) const
2054 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
2057 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2060 PyObject *zipPflsNames()
2062 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
2063 return convertVecPairVecStToPy(ret);
2066 PyObject *zipLocsNames(double eps)
2068 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
2069 return convertVecPairVecStToPy(ret);
2072 void changePflsNames(PyObject *li)
2074 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2075 self->changePflsNames(v);
2078 void changePflsRefsNamesGen(PyObject *li)
2080 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2081 self->changePflsRefsNamesGen(v);
2084 void changePflsNamesInStruct(PyObject *li)
2086 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2087 self->changePflsNamesInStruct(v);
2090 void changeLocsNames(PyObject *li)
2092 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2093 self->changeLocsNames(v);
2096 void changeLocsRefsNamesGen(PyObject *li)
2098 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2099 self->changeLocsRefsNamesGen(v);
2102 void changeLocsNamesInStruct(PyObject *li)
2104 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2105 self->changeLocsNamesInStruct(v);
2108 std::string simpleReprGlobs() const
2110 std::ostringstream oss;
2111 self->simpleReprGlobs(oss);
2117 class MEDFileEntities
2122 static MEDFileEntities *BuildFrom(PyObject *entities)
2124 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2125 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2127 std::size_t sz(inp0.size());
2129 for(std::size_t i=0;i<sz;i++)
2130 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2132 return MEDFileEntities::BuildFrom(&inp);
2139 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2142 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
2143 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2144 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2145 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
2147 void loadArraysIfNecessary();
2148 void unloadArrays();
2149 void unloadArraysWithoutDataLoss();
2150 int getDimension() const;
2151 int getIteration() const;
2152 int getOrder() const;
2153 std::string getName();
2154 void setName(const std::string& name);
2155 std::string getMeshName();
2156 void setMeshName(const std::string& newMeshName);
2157 int getMeshIteration() const;
2158 int getMeshOrder() const;
2159 int getNumberOfComponents() const;
2160 bool isDealingTS(int iteration, int order) const;
2161 void setInfo(const std::vector<std::string>& infos);
2162 const std::vector<std::string>& getInfo() const;
2163 bool presenceOfMultiDiscPerGeoType() const;
2164 void setTime(int iteration, int order, double val);
2165 virtual MEDFileAnyTypeField1TS *shallowCpy() const;
2166 MEDFileAnyTypeField1TS *deepCopy() const;
2167 std::string getDtUnit() const;
2168 void setDtUnit(const std::string& dtUnit);
2174 double tmp0=self->getTime(tmp1,tmp2);
2175 PyObject *res = PyList_New(3);
2176 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2177 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2178 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2182 PyObject *getDtIt() const
2184 std::pair<int,int> res=self->getDtIt();
2185 PyObject *elt=PyTuple_New(2);
2186 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2187 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2191 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false)
2193 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2196 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false)
2198 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2201 bool changeMeshNames(PyObject *li)
2203 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2204 return self->changeMeshNames(modifTab);
2207 PyObject *getTypesOfFieldAvailable() const
2209 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2210 PyObject *ret2=PyList_New(ret.size());
2211 for(int i=0;i<(int)ret.size();i++)
2212 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2216 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const
2218 std::vector<int> ret1;
2219 int ret0=self->getNonEmptyLevels(mname,ret1);
2220 PyObject *elt=PyTuple_New(2);
2221 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2222 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2226 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const
2228 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2229 std::vector< std::vector<TypeOfField> > typesF;
2230 std::vector< std::vector<std::string> > pfls;
2231 std::vector< std::vector<std::string> > locs;
2232 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2233 std::size_t sz=ret.size();
2234 PyObject *ret2=PyList_New(sz);
2235 for(std::size_t i=0;i<sz;i++)
2237 const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2238 const std::vector<TypeOfField>& typesFI=typesF[i];
2239 const std::vector<std::string>& pflsI=pfls[i];
2240 const std::vector<std::string>& locsI=locs[i];
2241 PyObject *elt=PyTuple_New(2);
2242 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2243 std::size_t sz2=ret[i].size();
2244 PyObject *elt2=PyList_New(sz2);
2245 for(std::size_t j=0;j<sz2;j++)
2247 PyObject *elt3=PyTuple_New(4);
2248 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2249 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2250 PyTuple_SetItem(elt3,1,elt4);
2251 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2252 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2253 PyList_SetItem(elt2,j,elt3);
2255 PyTuple_SetItem(elt,1,elt2);
2256 PyList_SetItem(ret2,i,elt);
2261 PyObject *splitComponents() const
2263 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2264 std::size_t sz=ret.size();
2265 PyObject *retPy=PyList_New(sz);
2266 for(std::size_t i=0;i<sz;i++)
2267 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2271 PyObject *splitDiscretizations() const
2273 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2274 std::size_t sz=ret.size();
2275 PyObject *retPy=PyList_New(sz);
2276 for(std::size_t i=0;i<sz;i++)
2277 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2281 PyObject *splitMultiDiscrPerGeoTypes() const
2283 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2284 std::size_t sz=ret.size();
2285 PyObject *retPy=PyList_New(sz);
2286 for(std::size_t i=0;i<sz;i++)
2287 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2291 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2293 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2294 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2295 return self->extractPart(extractDefCpp,mm);
2300 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2303 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2304 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2305 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
2306 static MEDFileField1TS *New(DataArrayByte *db);
2307 static MEDFileField1TS *New();
2308 MEDCoupling::MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const;
2309 MEDCoupling::MEDFileInt64Field1TS *convertToInt64(bool isDeepCpyGlobs=true) const;
2310 void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf);
2311 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
2312 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2313 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2314 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2315 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2316 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2318 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
2319 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2320 void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2321 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
2322 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
2325 MEDFileField1TS(const std::string& fileName, bool loadAll=true)
2327 return MEDFileField1TS::New(fileName,loadAll);
2330 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2332 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2335 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2337 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2340 MEDFileField1TS(DataArrayByte *db)
2342 return MEDFileField1TS::New(db);
2347 return MEDFileField1TS::New();
2350 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field)
2352 const DataArrayDouble *arr=0;
2354 arr=field->getArray();
2355 self->copyTinyInfoFrom(field,arr);
2358 std::string __str__() const
2360 return self->simpleRepr();
2363 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2365 return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
2368 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const
2370 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2371 std::vector< std::vector<TypeOfField> > typesF;
2372 std::vector< std::vector<std::string> > pfls;
2373 std::vector< std::vector<std::string> > locs;
2374 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2375 std::size_t sz=ret.size();
2376 PyObject *ret2=PyList_New(sz);
2377 for(std::size_t i=0;i<sz;i++)
2379 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2380 const std::vector<TypeOfField>& typesFI=typesF[i];
2381 const std::vector<std::string>& pflsI=pfls[i];
2382 const std::vector<std::string>& locsI=locs[i];
2383 PyObject *elt=PyTuple_New(2);
2384 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2385 std::size_t sz2=ret[i].size();
2386 PyObject *elt2=PyList_New(sz2);
2387 for(std::size_t j=0;j<sz2;j++)
2389 PyObject *elt3=PyTuple_New(4);
2390 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2391 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2392 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2393 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2394 PyList_SetItem(elt2,j,elt3);
2396 PyTuple_SetItem(elt,1,elt2);
2397 PyList_SetItem(ret2,i,elt);
2402 DataArrayDouble *getUndergroundDataArray() const
2404 DataArrayDouble *ret=self->getUndergroundDataArray();
2410 PyObject *getUndergroundDataArrayExt() const
2412 return MEDFileField1TS_getUndergroundDataArrayExt<double>(self);
2417 class MEDFileInt32Field1TS : public MEDFileAnyTypeField1TS
2420 static MEDFileInt32Field1TS *New();
2421 static MEDFileInt32Field1TS *New(const std::string& fileName, bool loadAll=true);
2422 static MEDFileInt32Field1TS *New(DataArrayByte *db);
2423 static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2424 static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2425 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2427 void setFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
2428 void setFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2429 void setFieldProfileFlatly(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2430 void copyTimeInfoFrom(MEDCouplingFieldInt32 *mcf);
2431 MEDCouplingFieldInt32 *field(const MEDFileMesh *mesh) const;
2432 MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2433 MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2434 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2435 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2436 MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2439 MEDFileInt32Field1TS()
2441 return MEDFileInt32Field1TS::New();
2444 MEDFileInt32Field1TS(const std::string& fileName, bool loadAll=true)
2446 return MEDFileInt32Field1TS::New(fileName,loadAll);
2449 MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2451 return MEDFileInt32Field1TS::New(fileName,fieldName,loadAll);
2454 MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2456 return MEDFileInt32Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2459 MEDFileInt32Field1TS(DataArrayByte *db)
2461 return MEDFileInt32Field1TS::New(db);
2464 std::string __str__() const
2466 return self->simpleRepr();
2469 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2471 return MEDFileField1TS_getFieldWithProfile<Int32>(self,type,meshDimRelToMax,mesh);
2474 DataArrayInt32 *getUndergroundDataArray() const
2476 DataArrayInt32 *ret=self->getUndergroundDataArray();
2482 PyObject *getUndergroundDataArrayExt() const
2484 return MEDFileField1TS_getUndergroundDataArrayExt<Int32>(self);
2489 class MEDFileInt64Field1TS : public MEDFileAnyTypeField1TS
2492 static MEDFileInt64Field1TS *New();
2493 static MEDFileInt64Field1TS *New(const std::string& fileName, bool loadAll=true);
2494 static MEDFileInt64Field1TS *New(DataArrayByte *db);
2495 static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2496 static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2497 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2499 void setFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
2500 void setFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2501 void setFieldProfileFlatly(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2502 void copyTimeInfoFrom(MEDCouplingFieldInt64 *mcf);
2503 MEDCouplingFieldInt64 *field(const MEDFileMesh *mesh) const;
2504 MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2505 MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2506 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2507 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2508 MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2511 MEDFileInt64Field1TS()
2513 return MEDFileInt64Field1TS::New();
2516 MEDFileInt64Field1TS(const std::string& fileName, bool loadAll=true)
2518 return MEDFileInt64Field1TS::New(fileName,loadAll);
2521 MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2523 return MEDFileInt64Field1TS::New(fileName,fieldName,loadAll);
2526 MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2528 return MEDFileInt64Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2531 MEDFileInt64Field1TS(DataArrayByte *db)
2533 return MEDFileInt64Field1TS::New(db);
2536 std::string __str__() const
2538 return self->simpleRepr();
2541 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2543 return MEDFileField1TS_getFieldWithProfile<Int64>(self,type,meshDimRelToMax,mesh);
2546 DataArrayInt64 *getUndergroundDataArray() const
2548 DataArrayInt64 *ret=self->getUndergroundDataArray();
2554 PyObject *getUndergroundDataArrayExt() const
2556 return MEDFileField1TS_getUndergroundDataArrayExt<Int64>(self);
2561 class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
2564 static MEDFileFloatField1TS *New();
2565 static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true);
2566 static MEDFileFloatField1TS *New(DataArrayByte *db);
2567 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2568 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2569 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2571 void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
2572 void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2573 void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2574 void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf);
2575 MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const;
2576 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2577 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2578 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2579 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2580 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2583 MEDFileFloatField1TS()
2585 return MEDFileFloatField1TS::New();
2588 MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true)
2590 return MEDFileFloatField1TS::New(fileName,loadAll);
2593 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2595 return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
2598 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2600 return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
2603 MEDFileFloatField1TS(DataArrayByte *db)
2605 return MEDFileFloatField1TS::New(db);
2608 std::string __str__() const
2610 return self->simpleRepr();
2613 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2615 return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
2618 DataArrayFloat *getUndergroundDataArray() const
2620 DataArrayFloat *ret=self->getUndergroundDataArray();
2626 PyObject *getUndergroundDataArrayExt() const
2628 return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
2633 class MEDFileAnyTypeFieldMultiTSIterator
2640 MEDFileAnyTypeField1TS *ret=self->nextt();
2642 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2645 PyErr_SetString(PyExc_StopIteration,"No more data.");
2652 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2655 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
2656 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2657 MEDFileAnyTypeFieldMultiTS *deepCopy() const;
2658 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
2659 std::string getName() const;
2660 void setName(const std::string& name);
2661 std::string getDtUnit() const;
2662 void setDtUnit(const std::string& dtUnit);
2663 std::string getMeshName() const;
2664 void setMeshName(const std::string& newMeshName);
2665 const std::vector<std::string>& getInfo() const;
2666 bool presenceOfMultiDiscPerGeoType() const;
2667 int getNumberOfComponents() const;
2668 int getNumberOfTS() const;
2669 void eraseEmptyTS();
2670 int getPosOfTimeStep(int iteration, int order) const;
2671 int getPosGivenTime(double time, double eps=1e-8) const;
2673 void loadArraysIfNecessary();
2674 void unloadArrays();
2675 void unloadArraysWithoutDataLoss();
2677 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
2678 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
2679 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
2680 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
2681 void synchronizeNameScope();
2682 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const;
2687 return self->getNumberOfTS();
2690 int getTimeId(PyObject *elt0) const
2692 if(elt0 && PyInt_Check(elt0))
2694 int pos=(int)PyInt_AS_LONG(elt0);
2697 else if(elt0 && PyTuple_Check(elt0))
2699 if(PyTuple_Size(elt0)==2)
2701 PyObject *o0=PyTuple_GetItem(elt0,0);
2702 PyObject *o1=PyTuple_GetItem(elt0,1);
2703 if(PyInt_Check(o0) && PyInt_Check(o1))
2705 int iter=(int)PyInt_AS_LONG(o0);
2706 int order=(int)PyInt_AS_LONG(o1);
2707 return self->getPosOfTimeStep(iter,order);
2710 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 !");
2713 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 !");
2715 else if(elt0 && PyFloat_Check(elt0))
2717 double val=PyFloat_AS_DOUBLE(elt0);
2718 return self->getPosGivenTime(val);
2721 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2724 PyObject *getIterations() const
2726 std::vector< std::pair<int,int> > res(self->getIterations());
2727 return convertVecPairIntToPy(res);
2730 PyObject *getTimeSteps() const
2732 std::vector<double> ret1;
2733 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2734 std::size_t sz=ret.size();
2735 PyObject *ret2=PyList_New(sz);
2736 for(std::size_t i=0;i<sz;i++)
2738 PyObject *elt=PyTuple_New(3);
2739 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2740 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2741 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2742 PyList_SetItem(ret2,i,elt);
2747 PyObject *getTypesOfFieldAvailable() const
2749 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2750 PyObject *ret2=PyList_New(ret.size());
2751 for(int i=0;i<(int)ret.size();i++)
2753 const std::vector<TypeOfField>& rett=ret[i];
2754 PyObject *ret3=PyList_New(rett.size());
2755 for(int j=0;j<(int)rett.size();j++)
2756 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2757 PyList_SetItem(ret2,i,ret3);
2762 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const
2764 std::vector<int> ret1;
2765 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2766 PyObject *elt=PyTuple_New(2);
2767 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2768 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2772 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const
2774 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2775 std::vector< std::vector<TypeOfField> > typesF;
2776 std::vector< std::vector<std::string> > pfls;
2777 std::vector< std::vector<std::string> > locs;
2778 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2779 std::size_t sz=ret.size();
2780 PyObject *ret2=PyList_New(sz);
2781 for(std::size_t i=0;i<sz;i++)
2783 const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2784 const std::vector<TypeOfField>& typesFI=typesF[i];
2785 const std::vector<std::string>& pflsI=pfls[i];
2786 const std::vector<std::string>& locsI=locs[i];
2787 PyObject *elt=PyTuple_New(2);
2788 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2789 std::size_t sz2=ret[i].size();
2790 PyObject *elt2=PyList_New(sz2);
2791 for(std::size_t j=0;j<sz2;j++)
2793 PyObject *elt3=PyTuple_New(4);
2794 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2795 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2796 PyTuple_SetItem(elt3,1,elt4);
2797 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2798 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2799 PyList_SetItem(elt2,j,elt3);
2801 PyTuple_SetItem(elt,1,elt2);
2802 PyList_SetItem(ret2,i,elt);
2807 std::vector<int> getTimeIds(PyObject *elts) const
2809 if(PyList_Check(elts))
2811 std::size_t sz=PyList_Size(elts);
2812 std::vector<int> ret(sz);
2813 for(std::size_t i=0;i<sz;i++)
2815 PyObject *elt=PyList_GetItem(elts,i);
2816 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2822 std::vector<int> ret(1);
2823 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2828 void __delitem__(PyObject *elts)
2830 if(PySlice_Check(elts))
2832 Py_ssize_t strt=2,stp=2,step=2;
2833 GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2834 self->eraseTimeStepIds2((int)strt,(int)stp,(int)step);
2838 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2839 if(!idsToRemove.empty())
2840 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2844 void eraseTimeStepIds(PyObject *li)
2848 std::vector<int> pos2;
2849 DataArrayInt32 *pos3=0;
2850 DataArrayIntTuple *pos4=0;
2851 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2856 self->eraseTimeStepIds(&pos1,&pos1+1);
2863 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2868 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2872 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2876 MEDFileAnyTypeFieldMultiTSIterator *__iter__()
2878 return self->iterator();
2881 PyObject *__getitem__(PyObject *elt0) const
2883 if(elt0 && PyList_Check(elt0))
2885 std::size_t sz=PyList_Size(elt0);
2886 MCAuto<DataArrayInt32> da=DataArrayInt32::New(); da->alloc(sz,1);
2887 int *pt=da->getPointer();
2888 for(std::size_t i=0;i<sz;i++,pt++)
2890 PyObject *elt1=PyList_GetItem(elt0,i);
2891 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2893 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2895 else if(elt0 && PySlice_Check(elt0))
2897 Py_ssize_t strt=2,stp=2,step=2;
2898 GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2899 return convertMEDFileFieldMultiTS(self->buildSubPartSlice((int)strt,(int)stp,(int)step),SWIG_POINTER_OWN | 0);
2902 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2905 bool changeMeshNames(PyObject *li)
2907 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2908 return self->changeMeshNames(modifTab);
2911 PyObject *splitComponents() const
2913 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2914 std::size_t sz=ret.size();
2915 PyObject *retPy=PyList_New(sz);
2916 for(std::size_t i=0;i<sz;i++)
2917 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2921 PyObject *splitDiscretizations() const
2923 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2924 std::size_t sz=ret.size();
2925 PyObject *retPy=PyList_New(sz);
2926 for(std::size_t i=0;i<sz;i++)
2927 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2931 PyObject *splitMultiDiscrPerGeoTypes() const
2933 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2934 std::size_t sz=ret.size();
2935 PyObject *retPy=PyList_New(sz);
2936 for(std::size_t i=0;i<sz;i++)
2937 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2941 void pushBackTimeSteps(PyObject *li)
2944 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2945 if(SWIG_IsOK(status))
2947 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2951 std::vector<MEDFileAnyTypeField1TS *> tmp;
2952 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2953 self->pushBackTimeSteps(tmp);
2957 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2959 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2960 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2961 return self->extractPart(extractDefCpp,mm);
2964 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li)
2966 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2967 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2968 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2969 std::size_t sz=ret.size();
2970 PyObject *retPy=PyList_New(sz);
2971 for(std::size_t i=0;i<sz;i++)
2973 std::size_t sz2=ret[i].size();
2974 PyObject *ret1Py=PyList_New(sz2);
2975 for(std::size_t j=0;j<sz2;j++)
2977 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2980 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2982 PyList_SetItem(retPy,i,ret1Py);
2987 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh)
2989 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2990 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2991 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2992 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2993 if(ret2.size()!=ret.size())
2995 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2996 throw INTERP_KERNEL::Exception(oss.str().c_str());
2998 std::size_t sz=ret.size();
2999 PyObject *retPy=PyList_New(sz);
3000 for(std::size_t i=0;i<sz;i++)
3002 std::size_t sz2=ret[i].size();
3003 PyObject *ret0Py=PyTuple_New(2);
3004 PyObject *ret1Py=PyList_New(sz2);
3005 for(std::size_t j=0;j<sz2;j++)
3007 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
3010 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
3012 PyTuple_SetItem(ret0Py,0,ret1Py);
3013 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
3014 PyList_SetItem(retPy,i,ret0Py);
3021 class MEDFileInt32FieldMultiTS;
3022 class MEDFileInt64FieldMultiTS;
3024 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3027 static MEDFileFieldMultiTS *New();
3028 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3029 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3030 static MEDFileFieldMultiTS *New(DataArrayByte *db);
3032 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
3033 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3034 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3035 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3036 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3037 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3039 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
3040 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3041 MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
3044 static MEDFileAnyTypeFieldMultiTS *Aggregate(PyObject *fmtssPy, PyObject *dtsPy)
3046 std::vector<const MEDFileAnyTypeFieldMultiTS *> fmtss;
3047 convertFromPyObjVectorOfObj<const MEDFileAnyTypeFieldMultiTS *>(fmtssPy,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",fmtss);
3048 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > dts2;
3049 convertPyToVectorVectorPairInt(dtsPy,dts2);
3050 std::vector< std::vector< std::pair<int,mcIdType> > > dts(MEDVectorVectorMIIterator(0,dts2),MEDVectorVectorMIIterator(dts2.size(),dts2));
3051 MCAuto<MEDFileAnyTypeFieldMultiTS> ret = MEDFileFieldMultiTS::Aggregate(fmtss,dts);
3055 MEDFileFieldMultiTS()
3057 return MEDFileFieldMultiTS::New();
3060 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true)
3062 return MEDFileFieldMultiTS::New(fileName,loadAll);
3065 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3067 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
3070 MEDFileFieldMultiTS(DataArrayByte *db)
3072 return MEDFileFieldMultiTS::New(db);
3075 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3077 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3078 std::size_t sz(tmp.size());
3079 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3080 for(std::size_t i=0;i<sz;i++)
3082 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3083 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3085 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3088 std::string __str__() const
3090 return self->simpleRepr();
3093 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3095 DataArrayIdType *ret1=0;
3096 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3097 PyObject *ret=PyTuple_New(2);
3098 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3099 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3103 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const
3105 std::vector<INTERP_KERNEL::NormalizedCellType> types;
3106 std::vector< std::vector<TypeOfField> > typesF;
3107 std::vector< std::vector<std::string> > pfls;
3108 std::vector< std::vector<std::string> > locs;
3109 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
3110 std::size_t sz=ret.size();
3111 PyObject *ret2=PyList_New(sz);
3112 for(std::size_t i=0;i<sz;i++)
3114 const std::vector<DataArrayDouble *>& dadsI=ret[i];
3115 const std::vector<TypeOfField>& typesFI=typesF[i];
3116 const std::vector<std::string>& pflsI=pfls[i];
3117 const std::vector<std::string>& locsI=locs[i];
3118 PyObject *elt=PyTuple_New(2);
3119 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
3120 std::size_t sz2=ret[i].size();
3121 PyObject *elt2=PyList_New(sz2);
3122 for(std::size_t j=0;j<sz2;j++)
3124 PyObject *elt3=PyTuple_New(4);
3125 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
3126 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3127 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
3128 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
3129 PyList_SetItem(elt2,j,elt3);
3131 PyTuple_SetItem(elt,1,elt2);
3132 PyList_SetItem(ret2,i,elt);
3136 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const
3138 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
3144 PyObject *getUndergroundDataArrayExt(int iteration, int order) const
3146 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > > elt1Cpp;
3147 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
3150 PyObject *ret=PyTuple_New(2);
3151 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3152 std::size_t sz=elt1Cpp.size();
3153 PyObject *elt=PyList_New(sz);
3154 for(std::size_t i=0;i<sz;i++)
3156 PyObject *elt1=PyTuple_New(2);
3157 PyObject *elt2=PyTuple_New(2);
3158 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
3159 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
3160 PyObject *elt3=PyTuple_New(2);
3161 PyTuple_SetItem(elt3,0,PyInt_FromLong(elt1Cpp[i].second.first));
3162 PyTuple_SetItem(elt3,1,PyInt_FromLong(elt1Cpp[i].second.second));
3163 PyTuple_SetItem(elt1,0,elt2);
3164 PyTuple_SetItem(elt1,1,elt3);
3165 PyList_SetItem(elt,i,elt1);
3167 PyTuple_SetItem(ret,1,elt);
3173 class MEDFileFieldsIterator
3180 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3182 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3185 PyErr_SetString(PyExc_StopIteration,"No more data.");
3192 class MEDFileInt32FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3195 static MEDFileInt32FieldMultiTS *New();
3196 static MEDFileInt32FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3197 static MEDFileInt32FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3198 static MEDFileInt32FieldMultiTS *New(DataArrayByte *db);
3200 void appendFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
3201 void appendFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3202 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3203 MEDCouplingFieldInt32 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3204 MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3205 MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3206 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3207 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3208 MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3211 MEDFileInt32FieldMultiTS()
3213 return MEDFileInt32FieldMultiTS::New();
3216 MEDFileInt32FieldMultiTS(const std::string& fileName, bool loadAll=true)
3218 return MEDFileInt32FieldMultiTS::New(fileName,loadAll);
3221 MEDFileInt32FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3223 return MEDFileInt32FieldMultiTS::New(fileName,fieldName,loadAll);
3226 MEDFileInt32FieldMultiTS(DataArrayByte *db)
3228 return MEDFileInt32FieldMultiTS::New(db);
3231 static MEDFileInt32FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3233 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3234 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3235 return MEDFileInt32FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3238 std::string __str__() const
3240 return self->simpleRepr();
3243 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3245 DataArrayIdType *ret1=0;
3246 DataArrayInt32 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3247 PyObject *ret=PyTuple_New(2);
3248 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int32>::TI, SWIG_POINTER_OWN | 0 ));
3249 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3253 DataArrayInt32 *getUndergroundDataArray(int iteration, int order) const
3255 DataArrayInt32 *ret=self->getUndergroundDataArray(iteration,order);
3263 class MEDFileInt64FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3266 static MEDFileInt64FieldMultiTS *New();
3267 static MEDFileInt64FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3268 static MEDFileInt64FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3269 static MEDFileInt64FieldMultiTS *New(DataArrayByte *db);
3271 void appendFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
3272 void appendFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3273 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3274 MEDCouplingFieldInt64 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3275 MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3276 MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3277 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3278 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3279 MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3282 MEDFileInt64FieldMultiTS()
3284 return MEDFileInt64FieldMultiTS::New();
3287 MEDFileInt64FieldMultiTS(const std::string& fileName, bool loadAll=true)
3289 return MEDFileInt64FieldMultiTS::New(fileName,loadAll);
3292 MEDFileInt64FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3294 return MEDFileInt64FieldMultiTS::New(fileName,fieldName,loadAll);
3297 MEDFileInt64FieldMultiTS(DataArrayByte *db)
3299 return MEDFileInt64FieldMultiTS::New(db);
3302 static MEDFileInt64FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3304 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3305 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3306 return MEDFileInt64FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3309 std::string __str__() const
3311 return self->simpleRepr();
3314 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3316 DataArrayIdType *ret1=0;
3317 DataArrayInt64 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3318 PyObject *ret=PyTuple_New(2);
3319 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int64>::TI, SWIG_POINTER_OWN | 0 ));
3320 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3324 DataArrayInt64 *getUndergroundDataArray(int iteration, int order) const
3326 DataArrayInt64 *ret=self->getUndergroundDataArray(iteration,order);
3334 class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3337 static MEDFileFloatFieldMultiTS *New();
3338 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3339 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3340 static MEDFileFloatFieldMultiTS *New(DataArrayByte *db);
3342 void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
3343 void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3344 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3345 MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const;
3346 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3347 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3348 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3349 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3350 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3353 MEDFileFloatFieldMultiTS()
3355 return MEDFileFloatFieldMultiTS::New();
3358 MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true)
3360 return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
3363 MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3365 return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
3368 MEDFileFloatFieldMultiTS(DataArrayByte *db)
3370 return MEDFileFloatFieldMultiTS::New(db);
3373 static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3375 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3376 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3377 return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3380 std::string __str__() const
3382 return self->simpleRepr();
3385 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3387 DataArrayIdType *ret1=0;
3388 DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3389 PyObject *ret=PyTuple_New(2);
3390 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
3391 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3395 DataArrayFloat *getUndergroundDataArray(int iteration, int order) const
3397 DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
3405 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3408 static MEDFileMeshSupports *New(const std::string& fileName);
3409 std::vector<std::string> getSupMeshNames() const;
3412 MEDFileUMesh *getSupMeshWithName(const std::string& name) const
3414 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3415 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3423 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3426 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms);
3428 MEDFileStructureElements();
3431 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3434 static MEDFileFields *New();
3435 static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
3436 static MEDFileFields *New(DataArrayByte *db);
3437 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities);
3438 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
3439 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
3440 MEDFileFields *deepCopy() const;
3441 MEDFileFields *shallowCpy() const;
3443 void loadArraysIfNecessary();
3444 void unloadArrays();
3445 void unloadArraysWithoutDataLoss();
3446 int getNumberOfFields() const;
3447 std::vector<std::string> getFieldsNames() const;
3448 std::vector<std::string> getMeshesNames() const;
3450 void resize(int newSize);
3451 void pushField(MEDFileAnyTypeFieldMultiTS *field);
3452 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
3453 int getPosFromFieldName(const std::string& fieldName) const;
3454 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
3455 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
3456 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
3457 bool presenceOfStructureElements() const;
3458 void aggregate(const MEDFileFields& other);
3459 void killStructureElements();
3460 void keepOnlyStructureElements();
3461 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
3462 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
3463 void destroyFieldAtPos(int i);
3464 bool removeFieldsWithoutAnyTimeStep();
3469 return MEDFileFields::New();
3472 MEDFileFields(const std::string& fileName, bool loadAll=true)
3474 return MEDFileFields::New(fileName,loadAll);
3477 MEDFileFields(DataArrayByte *db)
3479 return MEDFileFields::New(db);
3482 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities)
3484 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3487 std::string __str__() const
3489 return self->simpleRepr();
3492 MEDFileFields *partOfThisOnStructureElements() const
3494 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3498 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const
3500 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3504 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true)
3506 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3507 std::size_t sz(tmp.size());
3508 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3509 for(std::size_t i=0;i<sz;i++)
3511 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3512 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3514 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3517 PyObject *getMeshSENames() const
3519 std::vector< std::pair<std::string,std::string> > ps;
3520 self->getMeshSENames(ps);
3521 return convertVectPairStToPy(ps);
3524 PyObject *getCommonIterations() const
3527 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3528 PyObject *ret=PyTuple_New(2);
3529 PyObject *ret_0=PyList_New(ret0.size());
3531 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3533 PyObject *elt=PyTuple_New(2);
3534 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3535 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3536 PyList_SetItem(ret_0,rk,elt);
3538 PyTuple_SetItem(ret,0,ret_0);
3539 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3540 PyTuple_SetItem(ret,1,ret_1);
3544 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3546 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3547 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3550 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3552 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3553 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3556 PyObject *__getitem__(PyObject *obj)
3558 if(obj && PyList_Check(obj))
3560 std::size_t sz=PyList_Size(obj);
3561 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3562 int *pt=da->getPointer();
3563 for(std::size_t i=0;i<sz;i++,pt++)
3565 PyObject *elt1=PyList_GetItem(obj,i);
3566 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3568 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3571 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3574 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field)
3576 self->setFieldAtPos(obj,field);
3582 return self->getNumberOfFields();
3585 MEDFileFieldsIterator *__iter__()
3587 return self->iterator();
3590 bool changeMeshNames(PyObject *li)
3592 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3593 return self->changeMeshNames(modifTab);
3596 int getPosOfField(PyObject *elt0) const
3598 static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
3600 throw INTERP_KERNEL::Exception(msg);
3601 if(PyInt_Check(elt0))
3603 return (int)PyInt_AS_LONG(elt0);
3605 return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
3608 std::vector<int> getPosOfFields(PyObject *elts) const
3610 if(PyList_Check(elts))
3612 std::size_t sz=PyList_Size(elts);
3613 std::vector<int> ret(sz);
3614 for(std::size_t i=0;i<sz;i++)
3616 PyObject *elt=PyList_GetItem(elts,i);
3617 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3623 std::vector<int> ret(1);
3624 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3629 void pushFields(PyObject *fields)
3631 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3632 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3633 self->pushFields(tmp);
3636 void __delitem__(PyObject *elts)
3638 if(elts && PySlice_Check(elts))
3640 Py_ssize_t strt=2,stp=2,step=2;
3641 GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3642 self->destroyFieldsAtPos2((int)strt,(int)stp,(int)step);
3646 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3647 if(!idsToRemove.empty())
3648 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3652 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
3654 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
3655 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3656 return self->extractPart(extractDefCpp,mm);
3659 MEDFileFields *linearToQuadratic(const MEDFileMeshes *oldLin, const MEDFileMeshes *newQuad) const
3661 MCAuto<MEDFileFields> ret(self->linearToQuadratic(oldLin,newQuad));
3667 class MEDFileParameter1TS : public RefCountObject
3670 void setIteration(int it);
3671 int getIteration() const;
3672 void setOrder(int order);
3673 int getOrder() const;
3674 void setTimeValue(double time);
3675 void setTime(int dt, int it, double time);
3676 double getTime(int& dt, int& it);
3677 double getTimeValue() const;
3680 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3683 void setValue(double val);
3684 double getValue() const;
3685 std::string simpleRepr() const;
3688 std::string __str__() const
3690 return self->simpleRepr();
3695 class MEDFileParameterTinyInfo : public MEDFileWritable
3698 void setDescription(const std::string& name);
3699 std::string getDescription() const;
3700 void setTimeUnit(const std::string& unit);
3701 std::string getTimeUnit() const;
3704 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3707 static MEDFileParameterDouble1TS *New();
3708 static MEDFileParameterDouble1TS *New(const std::string& fileName);
3709 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName);
3710 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it);
3711 virtual MEDFileParameter1TS *deepCopy() const;
3712 virtual std::string simpleRepr() const;
3713 void setName(const std::string& name);
3714 std::string getName() const;
3715 void write(const std::string& fileName, int mode) const;
3718 MEDFileParameterDouble1TS()
3720 return MEDFileParameterDouble1TS::New();
3723 MEDFileParameterDouble1TS(const std::string& fileName)
3725 return MEDFileParameterDouble1TS::New(fileName);
3728 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName)
3730 return MEDFileParameterDouble1TS::New(fileName,paramName);
3733 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it)
3735 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3738 std::string __str__() const
3740 return self->simpleRepr();
3743 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const
3746 bool ret0=self->isEqual(other,eps,what);
3747 PyObject *res=PyList_New(2);
3748 PyObject *ret0Py=ret0?Py_True:Py_False;
3750 PyList_SetItem(res,0,ret0Py);
3751 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3757 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3760 static MEDFileParameterMultiTS *New();
3761 static MEDFileParameterMultiTS *New(const std::string& fileName);
3762 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName);
3763 std::string getName() const;
3764 void setName(const std::string& name);
3765 MEDFileParameterMultiTS *deepCopy() const;
3766 void write(const std::string& fileName, int mode) const;
3767 std::string simpleRepr() const;
3768 void appendValue(int dt, int it, double time, double val);
3769 double getDoubleValue(int iteration, int order) const;
3770 int getPosOfTimeStep(int iteration, int order) const;
3771 int getPosGivenTime(double time, double eps=1e-8) const;
3772 int getNumberOfTS() const;
3775 MEDFileParameterMultiTS()
3777 return MEDFileParameterMultiTS::New();
3780 MEDFileParameterMultiTS(const std::string& fileName)
3782 return MEDFileParameterMultiTS::New(fileName);
3785 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3787 return MEDFileParameterMultiTS::New(fileName,paramName);
3790 std::string __str__() const
3792 return self->simpleRepr();
3795 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const
3798 bool ret0=self->isEqual(other,eps,what);
3799 PyObject *res=PyList_New(2);
3800 PyObject *ret0Py=ret0?Py_True:Py_False;
3802 PyList_SetItem(res,0,ret0Py);
3803 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3807 void eraseTimeStepIds(PyObject *ids)
3811 std::vector<int> pos2;
3812 DataArrayInt *pos3=0;
3813 DataArrayIntTuple *pos4=0;
3814 convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3819 self->eraseTimeStepIds(&pos1,&pos1+1);
3826 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3831 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3835 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3839 int getTimeStepId(PyObject *elt0) const
3841 if(elt0 && PyInt_Check(elt0))
3843 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3846 else if(elt0 && PyTuple_Check(elt0))
3848 if(PyTuple_Size(elt0)==2)
3850 PyObject *o0=PyTuple_GetItem(elt0,0);
3851 PyObject *o1=PyTuple_GetItem(elt0,1);
3852 if(PyInt_Check(o0) && PyInt_Check(o1))
3854 int iter=(int)PyInt_AS_LONG(o0);
3855 int order=(int)PyInt_AS_LONG(o1);
3856 return self->getPosOfTimeStep(iter,order);
3859 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 !");
3862 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 !");
3864 else if(elt0 && PyFloat_Check(elt0))
3866 double val=PyFloat_AS_DOUBLE(elt0);
3867 return self->getPosGivenTime(val);
3870 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3873 MEDFileParameter1TS *__getitem__(PyObject *elt0) const
3875 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3881 std::vector<int> getTimeStepIds(PyObject *elts) const
3883 if(PyList_Check(elts))
3885 std::size_t sz=PyList_Size(elts);
3886 std::vector<int> ret(sz);
3887 for(std::size_t i=0;i<sz;i++)
3889 PyObject *elt=PyList_GetItem(elts,i);
3890 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3896 std::vector<int> ret(1);
3897 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3902 void __delitem__(PyObject *elts)
3904 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3905 if(!idsToRemove.empty())
3906 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3909 MEDFileParameter1TS *getTimeStepAtPos(int posId) const
3911 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3917 PyObject *getIterations() const
3919 std::vector< std::pair<int,int> > res=self->getIterations();
3920 PyObject *ret=PyList_New(res.size());
3922 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3924 PyObject *elt=PyTuple_New(2);
3925 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3926 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3927 PyList_SetItem(ret,rk,elt);
3932 PyObject *getTimeSteps() const
3934 std::vector<double> res2;
3935 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3936 PyObject *ret=PyList_New(res.size());
3938 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3940 PyObject *elt=PyTuple_New(3);
3941 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3942 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3943 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3944 PyList_SetItem(ret,rk,elt);
3951 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3954 static MEDFileParameters *New();
3955 static MEDFileParameters *New(const std::string& fileName);
3956 static MEDFileParameters *New(DataArrayByte *db);
3957 MEDFileParameters *deepCopy() const;
3958 std::vector<std::string> getParamsNames() const;
3959 std::string simpleRepr() const;
3960 void resize(int newSize);
3961 void pushParam(MEDFileParameterMultiTS *param);
3962 void setParamAtPos(int i, MEDFileParameterMultiTS *param);
3963 void destroyParamAtPos(int i);
3964 int getPosFromParamName(const std::string& paramName) const;
3965 int getNumberOfParams() const;
3970 return MEDFileParameters::New();
3973 MEDFileParameters(const std::string& fileName)
3975 return MEDFileParameters::New(fileName);
3978 MEDFileParameters(DataArrayByte *db)
3980 return MEDFileParameters::New(db);
3983 std::string __str__() const
3985 return self->simpleRepr();
3988 MEDFileParameterMultiTS *__getitem__(PyObject *obj)
3990 static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
3991 if(PyInt_Check(obj))
3993 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3998 MEDFileParameterMultiTS *ret(self->getParamWithName(convertPyObjectToStr(obj,msg)));
4006 return self->getNumberOfParams();
4009 MEDFileParameterMultiTS *getParamAtPos(int i) const
4011 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
4017 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const
4019 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
4025 PyObject *isEqual(const MEDFileParameters *other, double eps) const
4028 bool ret0=self->isEqual(other,eps,what);
4029 PyObject *res=PyList_New(2);
4030 PyObject *ret0Py=ret0?Py_True:Py_False;
4032 PyList_SetItem(res,0,ret0Py);
4033 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
4039 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
4042 static MEDFileData *New(DataArrayByte *db);
4043 static MEDFileData *New(const std::string& fileName);
4044 static MEDFileData *New();
4045 MEDFileData *deepCopy() const;
4046 void setFields(MEDFileFields *fields);
4047 void setMeshes(MEDFileMeshes *meshes);
4048 void setParams(MEDFileParameters *params);
4049 int getNumberOfFields() const;
4050 int getNumberOfMeshes() const;
4051 int getNumberOfParams() const;
4053 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName);
4054 bool unPolyzeMeshes();
4055 void dealWithStructureElements();
4056 std::string getHeader() const;
4057 void setHeader(const std::string& header);
4061 MEDFileData(const std::string& fileName)
4063 return MEDFileData::New(fileName);
4066 MEDFileData(DataArrayByte *db)
4068 return MEDFileData::New(db);
4073 return MEDFileData::New();
4076 std::string __str__() const
4078 return self->simpleRepr();
4081 MEDFileMeshes *getMeshes() const
4083 MEDFileMeshes *ret=self->getMeshes();
4089 MEDFileParameters *getParams() const
4091 MEDFileParameters *ret=self->getParams();
4097 MEDFileFields *getFields() const
4099 MEDFileFields *ret=self->getFields();
4105 bool changeMeshNames(PyObject *li)
4107 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
4108 return self->changeMeshNames(modifTab);
4111 static MEDFileData *Aggregate(PyObject *mfds)
4113 std::vector<const MEDFileData *> mfdsCpp;
4114 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
4115 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
4121 class SauvReader : public RefCountObject
4124 static SauvReader* New(const std::string& fileName);
4125 MEDFileData * loadInMEDFileDS();
4128 SauvReader(const std::string& fileName)
4130 return SauvReader::New(fileName);
4135 class SauvWriter : public RefCountObject
4138 static SauvWriter * New();
4139 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0);
4140 void write(const std::string& fileName);
4141 void setCpyGrpIfOnASingleFamilyStatus(bool status);
4142 bool getCpyGrpIfOnASingleFamilyStatus() const;
4147 return SauvWriter::New();
4154 class MEDFileMeshStruct;
4156 class MEDFileField1TSStructItem
4159 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt);
4162 class MEDFileMeshStruct : public RefCountObject
4165 static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
4167 ~MEDFileMeshStruct();
4170 class MEDMeshMultiLev : public RefCountObject
4173 virtual MEDMeshMultiLev *prepare() const;
4174 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const;
4175 DataArrayIdType *retrieveGlobalNodeIdsIfAny() const;
4181 PyObject *retrieveFamilyIdsOnCells() const
4183 DataArrayIdType *famIds(0);
4184 bool isWithoutCopy(false);
4185 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
4186 PyObject *ret=PyTuple_New(2);
4187 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4189 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4190 PyTuple_SetItem(ret,1,ret1Py);
4194 PyObject *retrieveNumberIdsOnCells() const
4196 DataArrayIdType *numIds(0);
4197 bool isWithoutCopy(false);
4198 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
4199 PyObject *ret=PyTuple_New(2);
4200 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4202 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4203 PyTuple_SetItem(ret,1,ret1Py);
4207 PyObject *retrieveFamilyIdsOnNodes() const
4209 DataArrayIdType *famIds(0);
4210 bool isWithoutCopy(false);
4211 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
4212 PyObject *ret=PyTuple_New(2);
4213 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4215 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4216 PyTuple_SetItem(ret,1,ret1Py);
4220 PyObject *retrieveNumberIdsOnNodes() const
4222 DataArrayIdType *numIds(0);
4223 bool isWithoutCopy(false);
4224 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
4225 PyObject *ret=PyTuple_New(2);
4226 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4228 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4229 PyTuple_SetItem(ret,1,ret1Py);
4233 PyObject *getGeoTypes() const
4235 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
4236 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4237 PyObject *res(PyList_New(result.size()));
4238 for(int i=0;iL!=result.end(); i++, iL++)
4239 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4245 class MEDUMeshMultiLev : public MEDMeshMultiLev
4248 ~MEDUMeshMultiLev();
4252 PyObject *buildVTUArrays() const
4254 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayIdType *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
4255 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
4256 PyObject *ret0Py=ncc?Py_True:Py_False;
4258 PyObject *ret=PyTuple_New(7);
4259 PyTuple_SetItem(ret,0,ret0Py);
4260 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4261 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
4262 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4263 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4264 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4265 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4271 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
4274 ~MEDStructuredMeshMultiLev();
4277 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4280 ~MEDCMeshMultiLev();
4284 PyObject *buildVTUArrays() const
4287 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4288 std::size_t sz(objs.size());
4289 PyObject *ret(PyTuple_New(2));
4290 PyObject *ret0=PyList_New(sz);
4291 for(std::size_t i=0;i<sz;i++)
4292 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4293 PyTuple_SetItem(ret,0,ret0);
4294 PyObject *ret1Py(isInternal?Py_True:Py_False);
4296 PyTuple_SetItem(ret,1,ret1Py);
4302 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4305 ~MEDCurveLinearMeshMultiLev();
4309 PyObject *buildVTUArrays() const
4311 DataArrayDouble *ret0(0);
4312 std::vector<mcIdType> ret1;
4314 self->buildVTUArrays(ret0,ret1,ret2);
4315 std::size_t sz(ret1.size());
4316 PyObject *ret=PyTuple_New(3);
4317 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4318 PyObject *ret1Py=PyList_New(sz);
4319 for(std::size_t i=0;i<sz;i++)
4320 PyList_SetItem(ret1Py,i,PyInt_FromLong(ret1[i]));
4321 PyTuple_SetItem(ret,1,ret1Py);
4322 PyObject *ret2Py(ret2?Py_True:Py_False);
4324 PyTuple_SetItem(ret,2,ret2Py);
4330 class MEDFileFastCellSupportComparator : public RefCountObject
4333 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
4334 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4335 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4336 int getNumberOfTS() const;
4338 ~MEDFileFastCellSupportComparator();
4342 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const
4344 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4345 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4346 PyObject *res(PyList_New(result.size()));
4347 for(int i=0;iL!=result.end(); i++, iL++)
4348 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4354 class MeshFormatReader
4357 MeshFormatReader(const std::string& meshFileName, const std::vector<std::string>& fieldFileName);
4359 MEDFileData* loadInMedFileDS();
4360 void setMeshName(const std::string& theMeshName);
4361 std::string getMeshName() const;
4362 void setFile(const std::string& theFileName);
4363 void setFieldFileNames(const std::vector<std::string>& theFieldFileNames);
4364 std::vector<std::string> getFieldFileNames() const;
4366 class MeshFormatWriter
4369 MeshFormatWriter(const std::string& meshFileName, const std::vector<std::string>& fieldFileNames);
4371 void setMeshFileName(const std::string& meshFileName);
4372 std::string getMeshFileName() const;
4373 void setFieldFileNames(const std::vector<std::string>& fieldFileNames);
4374 std::vector<std::string> getFieldFileNames() const;
4375 void setMEDFileDS(MEDCoupling::MEDFileData* mfd);
4385 def exit1TS(self, exctype, exc, tb):
4388 MEDFileAnyTypeField1TS.__enter__=enter1TS
4389 MEDFileAnyTypeField1TS.__exit__=exit1TS
4390 MEDFileIntField1TS = MEDFileInt32Field1TS
4391 MEDFileIntFieldMultiTS = MEDFileInt32FieldMultiTS
4392 if MEDCouplingUse64BitIDs():
4393 MEDFileIDField1TS = MEDFileInt64Field1TS
4394 MEDFileIDFieldMultiTS = MEDFileInt64FieldMultiTS
4396 MEDFileIDField1TS = MEDFileInt32Field1TS
4397 MEDFileIDFieldMultiTS = MEDFileInt32FieldMultiTS