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 int getNumberOfCorrespondences() const;
788 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const;
789 std::string simpleRepr() const;
792 MEDFileJointOneStep()
794 return MEDFileJointOneStep::New();
797 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number)
799 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
802 std::string __str__() const
804 return self->simpleRepr();
807 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const
809 MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
815 MEDFileJointCorrespondence *__getitem__(int i) const
817 return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
822 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
825 static MEDFileJoint *New();
826 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num);
827 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum);
828 MEDFileJoint *deepCopy() const;
829 MEDFileJoint *shallowCpy() const;
830 bool isEqual(const MEDFileJoint *other) const;
831 void setLocalMeshName(const std::string& name);
832 std::string getLocalMeshName() const;
833 void setRemoteMeshName(const std::string& name);
834 std::string getRemoteMeshName() const;
835 void setDescription(const std::string& name);
836 std::string getDescription() const;
837 void setJointName(const std::string& name);
838 std::string getJointName() const;
839 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
840 void setDomainNumber(const int& number);
841 int getDomainNumber() const;
842 void pushStep(MEDFileJointOneStep* step);
843 int getNumberOfSteps() const;
844 std::string simpleRepr() const;
849 return MEDFileJoint::New();
852 MEDFileJoint(const std::string& fileName, const std::string& mName, int num)
854 return MEDFileJoint::New(fileName,mName,num);
857 MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum)
859 return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
862 std::string __str__() const
864 return self->simpleRepr();
867 MEDFileJointOneStep *getStepAtPos(int i) const
869 MEDFileJointOneStep *ret(self->getStepAtPos(i));
875 MEDFileJointOneStep *__getitem__(int i)
877 return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
882 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
885 static MEDFileJoints *New();
886 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName);
887 MEDFileJoints *deepCopy() const;
888 std::string simpleRepr() const;
889 std::string getMeshName() const;
890 int getNumberOfJoints() const;
891 std::vector<std::string> getJointsNames() const;
892 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
893 void resize(int newSize);
894 void pushJoint(MEDFileJoint *joint);
895 void setJointAtPos(int i, MEDFileJoint *joint);
896 void destroyJointAtPos(int i);
901 return MEDFileJoints::New();
904 MEDFileJoints(const std::string& fileName, const std::string& meshName)
906 return MEDFileJoints::New(fileName,meshName);
909 std::string __str__() const
911 return self->simpleRepr();
914 MEDFileJoint *__getitem__(PyObject *obj)
916 static const char msg[]="MEDFileJoints::__getitem__ : only integer or string with meshname supported !";
919 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
924 MEDFileJoint *ret(self->getJointWithName(convertPyObjectToStr(obj,msg)));
932 return self->getNumberOfJoints();
935 MEDFileJoint *getJointAtPos(int i) const
937 MEDFileJoint *ret=self->getJointAtPos(i);
943 MEDFileJoint *getJointWithName(const std::string& paramName) const
945 MEDFileJoint *ret=self->getJointWithName(paramName);
953 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
956 MEDFileEquivalenceBase();
959 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
962 MEDFileEquivalenceData();
964 void setArray(DataArrayInt32 *data);
967 DataArrayInt32 *getArray()
969 DataArrayInt32 *ret(self->getArray());
970 if(ret) ret->incrRef();
976 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
979 MEDFileEquivalenceNode();
982 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
985 MEDFileEquivalenceCell();
988 std::size_t size() const;
989 void setArray(int meshDimRelToMax, DataArrayInt32 *da);
990 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt32 *da);
993 DataArrayInt32 *getArray(INTERP_KERNEL::NormalizedCellType type)
995 DataArrayInt32 *ret(self->getArray(type));
996 if(ret) ret->incrRef();
1000 PyObject *getTypes() const
1002 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
1003 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1004 PyObject *res=PyList_New(result.size());
1005 for(int i=0;iL!=result.end(); i++, iL++)
1006 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1012 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
1015 MEDFileEquivalencePair();
1017 std::string getName() const;
1018 void setName(const std::string& name);
1019 std::string getDescription() const;
1020 void setDescription(const std::string& descr);
1021 void setArray(int meshDimRelToMaxExt, DataArrayInt32 *da);;
1024 MEDFileEquivalenceCell *initCell()
1026 MEDFileEquivalenceCell *ret(self->initCell());
1027 if(ret) ret->incrRef();
1031 MEDFileEquivalenceNode *initNode()
1033 MEDFileEquivalenceNode *ret(self->initNode());
1034 if(ret) ret->incrRef();
1038 MEDFileEquivalenceCell *getCell()
1040 MEDFileEquivalenceCell *ret(self->getCell());
1041 if(ret) ret->incrRef();
1045 MEDFileEquivalenceNode *getNode()
1047 MEDFileEquivalenceNode *ret(self->getNode());
1048 if(ret) ret->incrRef();
1054 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
1057 MEDFileEquivalences();
1060 std::vector<std::string> getEquivalenceNames() const;
1061 void killEquivalenceWithName(const std::string& name);
1062 void killEquivalenceAt(int i);
1066 MEDFileEquivalencePair *getEquivalence(int i)
1068 MEDFileEquivalencePair *ret(self->getEquivalence(i));
1069 if(ret) ret->incrRef();
1072 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name)
1074 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
1075 if(ret) ret->incrRef();
1079 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name)
1081 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
1082 if(ret) ret->incrRef();
1088 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
1091 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1092 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1093 static MEDFileMesh *New(DataArrayByte *db);
1094 virtual MEDFileMesh *createNewEmpty() const;
1095 virtual MEDFileMesh *deepCopy() const;
1096 virtual MEDFileMesh *shallowCpy() const;
1097 virtual void clearNonDiscrAttributes() const;
1098 void setName(const std::string& name);
1099 std::string getName();
1100 std::string getUnivName() const;
1101 bool getUnivNameWrStatus() const;
1102 void setUnivNameWrStatus(bool newStatus);
1103 void setDescription(const std::string& name);
1104 std::string getDescription() const;
1105 void setOrder(int order);
1106 int getOrder() const;
1107 void setIteration(int it);
1109 void setTimeValue(double time);
1110 void setTime(int dt, int it, double time);
1111 double getTimeValue() const;
1112 void setTimeUnit(const std::string& unit);
1113 std::string getTimeUnit() const;
1114 void setAxisType(MEDCouplingAxisType at);
1115 MEDCouplingAxisType getAxisType() const;
1116 virtual int getNumberOfNodes() const;
1117 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const;
1118 virtual bool hasImplicitPart() const;
1119 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const;
1120 virtual void releaseImplicitPartIfAny() const;
1121 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const;
1122 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const;
1123 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const;
1124 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const;
1125 virtual std::vector<mcIdType> getDistributionOfTypes(int meshDimRelToMax) const;
1126 virtual MEDFileMesh *cartesianize() const;
1127 std::vector<int> getNonEmptyLevels() const;
1128 std::vector<int> getNonEmptyLevelsExt() const;
1129 int getSizeAtLevel(int meshDimRelToMaxExt) const;
1131 bool existsGroup(const std::string& groupName) const;
1132 bool existsFamily(int famId) const;
1133 bool existsFamily(const std::string& familyName) const;
1134 void setFamilyId(const std::string& familyName, int id);
1135 void setFamilyIdUnique(const std::string& familyName, int id);
1136 void addFamily(const std::string& familyName, int id);
1137 void addFamilyOnGrp(const std::string& grpName, const std::string& famName);
1138 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName);
1139 virtual bool keepFamIdsOnlyOnLevs(const std::vector<mcIdType>& famIds, const std::vector<int>& levs);
1140 void copyFamGrpMapsFrom(const MEDFileMesh& other);
1143 void clearFamGrpMaps();
1144 const std::map<std::string,int>& getFamilyInfo() const;
1145 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const;
1146 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const;
1147 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const;
1148 std::vector<mcIdType> getFamiliesIdsOnGroup(const std::string& name) const;
1149 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams);
1150 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<mcIdType>& famIds);
1151 std::vector<std::string> getGroupsOnFamily(const std::string& name) const;
1152 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps);
1153 std::vector<std::string> getGroupsNames() const;
1154 std::vector<std::string> getFamiliesNames() const;
1155 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
1156 std::vector<mcIdType> getGrpNonEmptyLevelsExt(const std::string& grp) const;
1157 std::vector<mcIdType> getGrpNonEmptyLevels(const std::string& grp) const;
1158 std::vector<mcIdType> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
1159 std::vector<mcIdType> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
1160 std::vector<mcIdType> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
1161 std::vector<mcIdType> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
1162 std::vector<mcIdType> getFamNonEmptyLevels(const std::string& fam) const;
1163 std::vector<mcIdType> getFamNonEmptyLevelsExt(const std::string& fam) const;
1164 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const;
1165 static std::string GetMagicFamilyStr();
1166 void assignFamilyNameWithGroupName();
1167 std::vector<std::string> removeEmptyGroups();
1168 void removeGroupAtLevel(int meshDimRelToMaxExt, const std::string& name);
1169 void removeGroup(const std::string& name);
1170 void removeFamily(const std::string& name);
1171 std::vector<std::string> removeOrphanGroups();
1172 std::vector<std::string> removeOrphanFamilies();
1173 void removeFamiliesReferedByNoGroups();
1174 void rearrangeFamilies();
1176 void checkOrphanFamilyZero() const;
1177 void changeGroupName(const std::string& oldName, const std::string& newName);
1178 void changeFamilyName(const std::string& oldName, const std::string& newName);
1179 void changeFamilyId(int oldId, int newId);
1180 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames);
1181 void setFamilyInfo(const std::map<std::string,mcIdType>& info);
1182 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1183 int getFamilyId(const std::string& name) const;
1184 int getMaxAbsFamilyId() const;
1185 int getMaxFamilyId() const;
1186 int getMinFamilyId() const;
1187 int getTheMaxAbsFamilyId() const;
1188 int getTheMaxFamilyId() const;
1189 int getTheMinFamilyId() const;
1190 virtual int getMaxAbsFamilyIdInArrays() const;
1191 virtual int getMaxFamilyIdInArrays() const;
1192 virtual int getMinFamilyIdInArrays() const;
1193 DataArrayIdType *getAllFamiliesIdsReferenced() const;
1194 DataArrayIdType *computeAllFamilyIdsInUse() const;
1195 std::vector<mcIdType> getFamiliesIds(const std::vector<std::string>& famNames) const;
1196 std::string getFamilyNameGivenId(int id) const;
1197 bool ensureDifferentFamIdsPerLevel();
1198 void normalizeFamIdsTrio();
1199 void normalizeFamIdsMEDFile();
1200 virtual int getMeshDimension() const;
1201 virtual std::string simpleRepr() const;
1202 virtual std::string advancedRepr() const;
1204 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const;
1205 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayIdType *famArr);
1206 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayIdType *renumArr);
1207 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr);
1208 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayIdType *globalNumArr);
1209 virtual void addNodeGroup(const DataArrayIdType *ids);
1210 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayIdType *ids);
1211 virtual DataArrayIdType *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1212 virtual DataArrayIdType *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1213 virtual DataArrayIdType *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1214 virtual DataArrayIdType *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1215 virtual DataArrayIdType *getNodeGroupArr(const std::string& grp, bool renum=false) const;
1216 virtual DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1217 virtual DataArrayIdType *getNodeFamilyArr(const std::string& fam, bool renum=false) const;
1218 virtual DataArrayIdType *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const;
1219 int getNumberOfJoints();
1220 MEDFileJoints *getJoints();
1221 void setJoints( MEDFileJoints* joints );
1222 void initializeEquivalences();
1223 void killEquivalences();
1224 bool presenceOfStructureElements() const;
1225 void killStructureElements();
1228 std::string __str__() const
1230 return self->simpleRepr();
1233 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const
1235 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1238 static INTERP_KERNEL::NormalizedCellType ConvertFromMEDFileGeoType(int geoType)
1240 med_geometry_type geoType2((med_geometry_type) geoType);
1241 return MEDFileMesh::ConvertFromMEDFileGeoType(geoType2);
1247 double tmp0=self->getTime(tmp1,tmp2);
1248 PyObject *res = PyList_New(3);
1249 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1250 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1251 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1255 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const
1258 bool ret0=self->isEqual(other,eps,what);
1259 PyObject *res=PyList_New(2);
1260 PyObject *ret0Py=ret0?Py_True:Py_False;
1262 PyList_SetItem(res,0,ret0Py);
1263 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1267 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false)
1269 std::vector<const DataArrayIdType *> grps;
1270 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grps);
1271 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1274 PyObject *areFamsEqual(const MEDFileMesh *other) const
1277 bool ret0=self->areFamsEqual(other,what);
1278 PyObject *res=PyList_New(2);
1279 PyObject *ret0Py=ret0?Py_True:Py_False;
1281 PyList_SetItem(res,0,ret0Py);
1282 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1286 PyObject *areGrpsEqual(const MEDFileMesh *other) const
1289 bool ret0=self->areGrpsEqual(other,what);
1290 PyObject *res=PyList_New(2);
1291 PyObject *ret0Py=ret0?Py_True:Py_False;
1293 PyList_SetItem(res,0,ret0Py);
1294 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1298 PyObject *getAllGeoTypes() const
1300 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1301 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1302 PyObject *res=PyList_New(result.size());
1303 for(int i=0;iL!=result.end(); i++, iL++)
1304 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1308 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const
1310 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1311 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1312 PyObject *res=PyList_New(result.size());
1313 for(int i=0;iL!=result.end(); i++, iL++)
1314 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1318 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const
1320 const DataArrayIdType *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1323 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1326 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt)
1328 const DataArrayIdType *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1331 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1334 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const
1336 const DataArrayIdType *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1339 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1342 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const
1344 const DataArrayIdType *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1347 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1350 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const
1352 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1355 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1358 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created)
1361 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1362 PyObject *ret=PyTuple_New(2);
1363 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1364 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1368 PyObject *unPolyze()
1370 DataArrayIdType *ret3=0;
1371 std::vector<mcIdType> ret1,ret2;
1372 bool ret0=self->unPolyze(ret1,ret2,ret3);
1373 PyObject *ret=PyTuple_New(4);
1374 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1376 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1377 for(int j=0;j<(int)ret1.size()/3;j++)
1379 PyObject *retLev2=PyList_New(3);
1380 PyList_SetItem(retLev2,0,PyInt_FromLong(ret1[3*j]));
1381 PyList_SetItem(retLev2,1,PyInt_FromLong(ret1[3*j+1]));
1382 PyList_SetItem(retLev2,2,PyInt_FromLong(ret1[3*j+2]));
1383 PyList_SetItem(retLev1_0,j,retLev2);
1385 PyTuple_SetItem(ret,1,retLev1_0);
1387 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1388 for(int j=0;j<(int)ret2.size()/3;j++)
1390 PyObject *retLev2=PyList_New(3);
1391 PyList_SetItem(retLev2,0,PyInt_FromLong(ret2[3*j]));
1392 PyList_SetItem(retLev2,1,PyInt_FromLong(ret2[3*j+1]));
1393 PyList_SetItem(retLev2,2,PyInt_FromLong(ret2[3*j+2]));
1394 PyList_SetItem(retLev1_1,j,retLev2);
1396 PyTuple_SetItem(ret,2,retLev1_1);
1398 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1402 MEDFileEquivalences *getEquivalences()
1404 MEDFileEquivalences *ret(self->getEquivalences());
1405 if(ret) ret->incrRef();
1409 virtual DataArrayIdType *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const
1411 MCAuto<DataArrayIdType> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1417 class MEDFileUMesh : public MEDFileMesh
1420 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1421 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1422 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem);
1423 static MEDFileUMesh *New(DataArrayByte *db);
1424 static MEDFileUMesh *New();
1425 static const char *GetSpeStr4ExtMesh();
1427 int getSpaceDimension() const;
1428 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1429 void checkConsistency() const;
1430 void checkSMESHConsistency() const;
1431 void clearNodeAndCellNumbers();
1433 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1434 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1435 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1436 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1437 DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1438 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const;
1439 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const;
1440 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const;
1441 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const;
1442 void forceComputationOfParts() const;
1443 void computeRevNum() const;
1445 void setFamilyNameAttachedOnId(int id, const std::string& newFamName);
1446 void setCoords(DataArrayDouble *coords);
1447 void setCoordsForced(DataArrayDouble *coords);
1448 void eraseGroupsAtLevel(int meshDimRelToMaxExt);
1449 void removeMeshAtLevel(int meshDimRelToMax);
1450 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m);
1451 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false);
1452 void optimizeFamilies();
1453 DataArrayIdType *computeFetchedNodeIds() const;
1454 DataArrayIdType *zipCoords();
1455 DataArrayIdType *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1456 DataArrayIdType *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1457 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const;
1458 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const;
1459 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const;
1460 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const;
1463 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1465 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1468 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1470 return MEDFileUMesh::New(fileName,mrs);
1473 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem)
1475 return MEDFileUMesh::New(mem);
1478 MEDFileUMesh(DataArrayByte *db)
1480 return MEDFileUMesh::New(db);
1485 return MEDFileUMesh::New();
1488 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)
1490 std::vector<int> typesCpp1;
1491 convertPyToNewIntArr3(types,typesCpp1);
1492 std::size_t sz(typesCpp1.size());
1493 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1494 for(std::size_t ii=0;ii<sz;ii++)
1495 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1496 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1499 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)
1501 MCAuto<DataArrayDouble> coords;
1502 MCAuto<PartDefinition> partCoords;
1503 MCAuto<DataArrayIdType> famCoords,numCoords;
1504 MCAuto<DataArrayAsciiChar> nameCoord;
1505 MEDFileUMesh::LoadPartCoords(fileName,mName,dt,it,infosOnComp,startNodeId,stopNodeId,coords,partCoords,famCoords,numCoords,nameCoord);
1506 PyObject *ret(PyTuple_New(5));
1507 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1508 PyTuple_SetItem(ret,1,convertPartDefinition(partCoords.retn(),SWIG_POINTER_OWN | 0));
1509 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(famCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1510 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(numCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1511 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(nameCoord.retn()),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 ));
1515 PyObject *__getstate__()
1517 std::vector<double> a0;
1518 std::vector<mcIdType> a1;
1519 std::vector<std::string> a2;
1520 std::vector< MCAuto<DataArrayIdType> > a3;
1521 MCAuto<DataArrayDouble> a4;
1522 self->serialize(a0,a1,a2,a3,a4);
1523 PyObject *ret(PyTuple_New(5));
1524 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1525 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1526 std::size_t sz(a2.size());
1527 PyObject *ret2(PyList_New(sz));
1528 for(std::size_t i=0;i<sz;i++)
1529 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1530 PyTuple_SetItem(ret,2,ret2);
1532 PyObject *ret3(PyList_New(sz));
1533 for(std::size_t i=0;i<sz;i++)
1535 DataArrayIdType *elt(a3[i]);
1538 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1540 PyTuple_SetItem(ret,3,ret3);
1541 DataArrayDouble *ret4(a4);
1544 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1548 void __setstate__(PyObject *inp)
1550 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1551 if(!PyTuple_Check(inp))
1552 throw INTERP_KERNEL::Exception(MSG);
1553 std::size_t sz(PyTuple_Size(inp));
1555 throw INTERP_KERNEL::Exception(MSG);
1556 std::vector<double> a0;
1557 std::vector<mcIdType> a1;
1558 std::vector<std::string> a2;
1559 std::vector< MCAuto<DataArrayIdType> > a3;
1560 MCAuto<DataArrayDouble> a4;
1562 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1564 fillArrayWithPyListDbl3(a0py,tmp,a0);
1565 convertPyToNewIntArr3(a1py,a1);
1566 fillStringVector(a2py,a2);
1568 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1570 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1571 if(!SWIG_IsOK(status))
1572 throw INTERP_KERNEL::Exception(MSG);
1573 a4=reinterpret_cast<DataArrayDouble *>(argp);
1574 if((DataArrayDouble *)a4)
1577 std::vector< DataArrayIdType * > a3Tmp;
1578 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayIdType *>(b0py,SWIGTITraits<mcIdType>::TI,"DataArrayInt",a3Tmp);
1579 std::size_t sz(a3Tmp.size());
1581 for(std::size_t i=0;i<sz;i++)
1585 a3Tmp[i]->incrRef();
1587 self->unserialize(a0,a1,a2,a3,a4);
1591 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh)
1594 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1595 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1598 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1601 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1604 self->setMeshAtLevel(meshDimRelToMax,m1);
1607 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1610 void __delitem__(int meshDimRelToMax)
1612 self->removeMeshAtLevel(meshDimRelToMax);
1615 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const
1617 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1619 DataArrayDouble *a,*a2;
1620 DataArrayDoubleTuple *aa,*aa2;
1621 std::vector<double> bb,bb2;
1623 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1624 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1625 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1629 static MEDFileUMesh *Aggregate(PyObject *meshes)
1631 std::vector<const MEDFileUMesh *> meshesCpp;
1632 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1633 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1637 PyObject *getAllDistributionOfTypes() const
1639 std::vector< std::pair<int,mcIdType> > ret(self->getAllDistributionOfTypes());
1640 return convertVecPairIntToPy(ret);
1643 DataArrayIdType *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const
1645 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1646 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1647 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1650 MEDFileUMesh *extractPart(PyObject *extractDef) const
1652 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1653 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1654 return self->extractPart(extractDefCpp);
1657 void setMeshes(PyObject *li, bool renum=false)
1659 std::vector<const MEDCouplingUMesh *> ms;
1660 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1661 self->setMeshes(ms,renum);
1664 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false)
1666 std::vector<const MEDCouplingUMesh *> ms;
1667 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1668 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1671 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false)
1673 std::vector<const MEDCouplingUMesh *> ms;
1674 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1675 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1678 DataArrayDouble *getCoords() const
1680 DataArrayDouble *ret=self->getCoords();
1686 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const
1688 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1691 return const_cast<PartDefinition *>(ret);
1694 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1)
1696 DataArrayIdType *ret0=0,*ret1=0,*ret2=0;
1697 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1698 PyObject *ret=PyTuple_New(3);
1699 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1700 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1701 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1705 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const
1707 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1713 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const
1715 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1716 std::size_t sz(tmp.size());
1717 PyObject *ret=PyList_New(sz);
1718 for(std::size_t i=0;i<sz;i++)
1722 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1729 class MEDFileStructuredMesh : public MEDFileMesh
1734 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const
1736 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1744 class MEDFileCMesh : public MEDFileStructuredMesh
1747 static MEDFileCMesh *New();
1748 static MEDFileCMesh *New(DataArrayByte *db);
1749 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1750 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1751 void setMesh(MEDCouplingCMesh *m);
1752 int getSpaceDimension() const;
1757 return MEDFileCMesh::New();
1760 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1762 return MEDFileCMesh::New(fileName,mrs);
1765 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1767 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1770 MEDFileCMesh(DataArrayByte *db)
1772 return MEDFileCMesh::New(db);
1775 PyObject *getMesh() const
1777 const MEDCouplingCMesh *tmp=self->getMesh();
1780 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1785 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1788 static MEDFileCurveLinearMesh *New();
1789 static MEDFileCurveLinearMesh *New(DataArrayByte *db);
1790 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1791 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1792 void setMesh(MEDCouplingCurveLinearMesh *m);
1793 int getSpaceDimension() const;
1794 int getMeshDimension() const;
1797 MEDFileCurveLinearMesh()
1799 return MEDFileCurveLinearMesh::New();
1802 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1804 return MEDFileCurveLinearMesh::New(fileName,mrs);
1807 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1809 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1812 MEDFileCurveLinearMesh(DataArrayByte *db)
1814 return MEDFileCurveLinearMesh::New(db);
1817 PyObject *getMesh() const
1819 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1822 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1827 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1830 static MEDFileMeshMultiTS *New();
1831 static MEDFileMeshMultiTS *New(const std::string& fileName);
1832 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName);
1833 MEDFileMeshMultiTS *deepCopy() const;
1834 std::string getName() const;
1835 void setOneTimeStep(MEDFileMesh *mesh1TimeStep);
1836 void cartesianizeMe();
1839 MEDFileMeshMultiTS()
1841 return MEDFileMeshMultiTS::New();
1844 MEDFileMeshMultiTS(const std::string& fileName)
1846 return MEDFileMeshMultiTS::New(fileName);
1849 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName)
1851 return MEDFileMeshMultiTS::New(fileName,mName);
1854 MEDFileMesh *getOneTimeStep() const
1856 MEDFileMesh *ret=self->getOneTimeStep();
1864 class MEDFileMeshesIterator
1871 MEDFileMesh *ret=self->nextt();
1875 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1879 PyErr_SetString(PyExc_StopIteration,"No more data.");
1886 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1889 static MEDFileMeshes *New();
1890 static MEDFileMeshes *New(DataArrayByte *db);
1891 MEDFileMeshes *deepCopy() const;
1892 int getNumberOfMeshes() const;
1893 std::vector<std::string> getMeshesNames() const;
1895 void resize(int newSize);
1896 void pushMesh(MEDFileMesh *mesh);
1897 void setMeshAtPos(int i, MEDFileMesh *mesh);
1898 void destroyMeshAtPos(int i);
1899 void cartesianizeMe();
1900 bool presenceOfStructureElements() const;
1901 void killStructureElements();
1906 return MEDFileMeshes::New();
1909 MEDFileMeshes(const std::string& fileName)
1911 return MEDFileMeshes::New(fileName);
1914 MEDFileMeshes(DataArrayByte *db)
1916 return MEDFileMeshes::New(db);
1919 std::string __str__() const
1921 return self->simpleRepr();
1924 MEDFileMesh *__getitem__(PyObject *obj)
1926 static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
1927 if(PyInt_Check(obj))
1929 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1934 MEDFileMesh *ret(self->getMeshWithName(convertPyObjectToStr(obj,msg)));
1940 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh)
1942 self->setMeshAtPos(obj,mesh);
1946 MEDFileMeshesIterator *__iter__()
1948 return self->iterator();
1953 return self->getNumberOfMeshes();
1956 MEDFileMesh *getMeshAtPos(int i) const
1958 MEDFileMesh *ret=self->getMeshAtPos(i);
1963 MEDFileMesh *getMeshWithName(const std::string& mname) const
1965 MEDFileMesh *ret=self->getMeshWithName(mname);
1973 class MEDFileFieldLoc : public RefCountObject
1976 std::string getName() const;
1977 int getDimension() const;
1978 int getNumberOfGaussPoints() const;
1979 int getNumberOfPointsInCells() const;
1980 const std::vector<double>& getRefCoords() const;
1981 const std::vector<double>& getGaussCoords() const;
1982 const std::vector<double>& getGaussWeights() const;
1983 bool isEqual(const MEDFileFieldLoc& other, double eps) const;
1986 std::string __str__() const
1988 return self->repr();
1993 class MEDFileFieldGlobsReal
1996 void resetContent();
1997 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
1998 void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
1999 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2000 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2001 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
2002 void checkGlobsCoherency() const;
2003 void checkGlobsPflsPartCoherency() const;
2004 void checkGlobsLocsPartCoherency() const;
2005 std::vector<std::string> getPfls() const;
2006 std::vector<std::string> getLocs() const;
2007 bool existsPfl(const std::string& pflName) const;
2008 bool existsLoc(const std::string& locName) const;
2009 std::string createNewNameOfPfl() const;
2010 std::string createNewNameOfLoc() const;
2011 std::vector< std::vector<int> > whichAreEqualProfiles() const;
2012 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
2013 virtual std::vector<std::string> getPflsReallyUsed() const;
2014 virtual std::vector<std::string> getLocsReallyUsed() const;
2015 virtual std::vector<std::string> getPflsReallyUsedMulti() const;
2016 virtual std::vector<std::string> getLocsReallyUsedMulti() const;
2017 void killProfileIds(const std::vector<int>& pflIds);
2018 void killLocalizationIds(const std::vector<int>& locIds);
2019 void changePflName(const std::string& oldName, const std::string& newName);
2020 void changeLocName(const std::string& oldName, const std::string& newName);
2021 int getNbOfGaussPtPerCell(int locId) const;
2022 int getLocalizationId(const std::string& loc) const;
2023 int getProfileId(const std::string& pfl) const;
2024 void killStructureElementsInGlobs();
2027 PyObject *getProfile(const std::string& pflName) const
2029 const DataArrayIdType *ret=self->getProfile(pflName);
2032 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2035 PyObject *getProfileFromId(int pflId) const
2037 const DataArrayIdType *ret=self->getProfileFromId(pflId);
2040 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2043 PyObject *getLocalizationFromId(int locId) const
2045 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
2048 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2051 PyObject *getLocalization(const std::string& locName) const
2053 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
2056 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2059 PyObject *zipPflsNames()
2061 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
2062 return convertVecPairVecStToPy(ret);
2065 PyObject *zipLocsNames(double eps)
2067 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
2068 return convertVecPairVecStToPy(ret);
2071 void changePflsNames(PyObject *li)
2073 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2074 self->changePflsNames(v);
2077 void changePflsRefsNamesGen(PyObject *li)
2079 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2080 self->changePflsRefsNamesGen(v);
2083 void changePflsNamesInStruct(PyObject *li)
2085 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2086 self->changePflsNamesInStruct(v);
2089 void changeLocsNames(PyObject *li)
2091 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2092 self->changeLocsNames(v);
2095 void changeLocsRefsNamesGen(PyObject *li)
2097 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2098 self->changeLocsRefsNamesGen(v);
2101 void changeLocsNamesInStruct(PyObject *li)
2103 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2104 self->changeLocsNamesInStruct(v);
2107 std::string simpleReprGlobs() const
2109 std::ostringstream oss;
2110 self->simpleReprGlobs(oss);
2116 class MEDFileEntities
2121 static MEDFileEntities *BuildFrom(PyObject *entities)
2123 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2124 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2126 std::size_t sz(inp0.size());
2128 for(std::size_t i=0;i<sz;i++)
2129 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2131 return MEDFileEntities::BuildFrom(&inp);
2138 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2141 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
2142 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2143 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2144 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
2146 void loadArraysIfNecessary();
2147 void unloadArrays();
2148 void unloadArraysWithoutDataLoss();
2149 int getDimension() const;
2150 int getIteration() const;
2151 int getOrder() const;
2152 std::string getName();
2153 void setName(const std::string& name);
2154 std::string getMeshName();
2155 void setMeshName(const std::string& newMeshName);
2156 int getMeshIteration() const;
2157 int getMeshOrder() const;
2158 int getNumberOfComponents() const;
2159 bool isDealingTS(int iteration, int order) const;
2160 void setInfo(const std::vector<std::string>& infos);
2161 const std::vector<std::string>& getInfo() const;
2162 bool presenceOfMultiDiscPerGeoType() const;
2163 void setTime(int iteration, int order, double val);
2164 virtual MEDFileAnyTypeField1TS *shallowCpy() const;
2165 MEDFileAnyTypeField1TS *deepCopy() const;
2166 std::string getDtUnit() const;
2167 void setDtUnit(const std::string& dtUnit);
2173 double tmp0=self->getTime(tmp1,tmp2);
2174 PyObject *res = PyList_New(3);
2175 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2176 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2177 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2181 PyObject *getDtIt() const
2183 std::pair<int,int> res=self->getDtIt();
2184 PyObject *elt=PyTuple_New(2);
2185 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2186 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2190 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false)
2192 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2195 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false)
2197 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2200 bool changeMeshNames(PyObject *li)
2202 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2203 return self->changeMeshNames(modifTab);
2206 PyObject *getTypesOfFieldAvailable() const
2208 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2209 PyObject *ret2=PyList_New(ret.size());
2210 for(int i=0;i<(int)ret.size();i++)
2211 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2215 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const
2217 std::vector<int> ret1;
2218 int ret0=self->getNonEmptyLevels(mname,ret1);
2219 PyObject *elt=PyTuple_New(2);
2220 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2221 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2225 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const
2227 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2228 std::vector< std::vector<TypeOfField> > typesF;
2229 std::vector< std::vector<std::string> > pfls;
2230 std::vector< std::vector<std::string> > locs;
2231 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2232 std::size_t sz=ret.size();
2233 PyObject *ret2=PyList_New(sz);
2234 for(std::size_t i=0;i<sz;i++)
2236 const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2237 const std::vector<TypeOfField>& typesFI=typesF[i];
2238 const std::vector<std::string>& pflsI=pfls[i];
2239 const std::vector<std::string>& locsI=locs[i];
2240 PyObject *elt=PyTuple_New(2);
2241 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2242 std::size_t sz2=ret[i].size();
2243 PyObject *elt2=PyList_New(sz2);
2244 for(std::size_t j=0;j<sz2;j++)
2246 PyObject *elt3=PyTuple_New(4);
2247 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2248 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2249 PyTuple_SetItem(elt3,1,elt4);
2250 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2251 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2252 PyList_SetItem(elt2,j,elt3);
2254 PyTuple_SetItem(elt,1,elt2);
2255 PyList_SetItem(ret2,i,elt);
2260 PyObject *splitComponents() const
2262 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2263 std::size_t sz=ret.size();
2264 PyObject *retPy=PyList_New(sz);
2265 for(std::size_t i=0;i<sz;i++)
2266 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2270 PyObject *splitDiscretizations() const
2272 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2273 std::size_t sz=ret.size();
2274 PyObject *retPy=PyList_New(sz);
2275 for(std::size_t i=0;i<sz;i++)
2276 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2280 PyObject *splitMultiDiscrPerGeoTypes() const
2282 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2283 std::size_t sz=ret.size();
2284 PyObject *retPy=PyList_New(sz);
2285 for(std::size_t i=0;i<sz;i++)
2286 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2290 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2292 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2293 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2294 return self->extractPart(extractDefCpp,mm);
2299 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2302 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2303 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2304 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
2305 static MEDFileField1TS *New(DataArrayByte *db);
2306 static MEDFileField1TS *New();
2307 MEDCoupling::MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const;
2308 MEDCoupling::MEDFileInt64Field1TS *convertToInt64(bool isDeepCpyGlobs=true) const;
2309 void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf);
2310 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
2311 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2312 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2313 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2314 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2315 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2317 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
2318 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2319 void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2320 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
2321 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
2324 MEDFileField1TS(const std::string& fileName, bool loadAll=true)
2326 return MEDFileField1TS::New(fileName,loadAll);
2329 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2331 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2334 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2336 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2339 MEDFileField1TS(DataArrayByte *db)
2341 return MEDFileField1TS::New(db);
2346 return MEDFileField1TS::New();
2349 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field)
2351 const DataArrayDouble *arr=0;
2353 arr=field->getArray();
2354 self->copyTinyInfoFrom(field,arr);
2357 std::string __str__() const
2359 return self->simpleRepr();
2362 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2364 return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
2367 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const
2369 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2370 std::vector< std::vector<TypeOfField> > typesF;
2371 std::vector< std::vector<std::string> > pfls;
2372 std::vector< std::vector<std::string> > locs;
2373 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2374 std::size_t sz=ret.size();
2375 PyObject *ret2=PyList_New(sz);
2376 for(std::size_t i=0;i<sz;i++)
2378 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2379 const std::vector<TypeOfField>& typesFI=typesF[i];
2380 const std::vector<std::string>& pflsI=pfls[i];
2381 const std::vector<std::string>& locsI=locs[i];
2382 PyObject *elt=PyTuple_New(2);
2383 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2384 std::size_t sz2=ret[i].size();
2385 PyObject *elt2=PyList_New(sz2);
2386 for(std::size_t j=0;j<sz2;j++)
2388 PyObject *elt3=PyTuple_New(4);
2389 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2390 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2391 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2392 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2393 PyList_SetItem(elt2,j,elt3);
2395 PyTuple_SetItem(elt,1,elt2);
2396 PyList_SetItem(ret2,i,elt);
2401 DataArrayDouble *getUndergroundDataArray() const
2403 DataArrayDouble *ret=self->getUndergroundDataArray();
2409 PyObject *getUndergroundDataArrayExt() const
2411 return MEDFileField1TS_getUndergroundDataArrayExt<double>(self);
2416 class MEDFileInt32Field1TS : public MEDFileAnyTypeField1TS
2419 static MEDFileInt32Field1TS *New();
2420 static MEDFileInt32Field1TS *New(const std::string& fileName, bool loadAll=true);
2421 static MEDFileInt32Field1TS *New(DataArrayByte *db);
2422 static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2423 static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2424 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2426 void setFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
2427 void setFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2428 void setFieldProfileFlatly(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2429 void copyTimeInfoFrom(MEDCouplingFieldInt32 *mcf);
2430 MEDCouplingFieldInt32 *field(const MEDFileMesh *mesh) const;
2431 MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2432 MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2433 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2434 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2435 MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2438 MEDFileInt32Field1TS()
2440 return MEDFileInt32Field1TS::New();
2443 MEDFileInt32Field1TS(const std::string& fileName, bool loadAll=true)
2445 return MEDFileInt32Field1TS::New(fileName,loadAll);
2448 MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2450 return MEDFileInt32Field1TS::New(fileName,fieldName,loadAll);
2453 MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2455 return MEDFileInt32Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2458 MEDFileInt32Field1TS(DataArrayByte *db)
2460 return MEDFileInt32Field1TS::New(db);
2463 std::string __str__() const
2465 return self->simpleRepr();
2468 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2470 return MEDFileField1TS_getFieldWithProfile<Int32>(self,type,meshDimRelToMax,mesh);
2473 DataArrayInt32 *getUndergroundDataArray() const
2475 DataArrayInt32 *ret=self->getUndergroundDataArray();
2481 PyObject *getUndergroundDataArrayExt() const
2483 return MEDFileField1TS_getUndergroundDataArrayExt<Int32>(self);
2488 class MEDFileInt64Field1TS : public MEDFileAnyTypeField1TS
2491 static MEDFileInt64Field1TS *New();
2492 static MEDFileInt64Field1TS *New(const std::string& fileName, bool loadAll=true);
2493 static MEDFileInt64Field1TS *New(DataArrayByte *db);
2494 static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2495 static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2496 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2498 void setFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
2499 void setFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2500 void setFieldProfileFlatly(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2501 void copyTimeInfoFrom(MEDCouplingFieldInt64 *mcf);
2502 MEDCouplingFieldInt64 *field(const MEDFileMesh *mesh) const;
2503 MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2504 MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2505 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2506 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2507 MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2510 MEDFileInt64Field1TS()
2512 return MEDFileInt64Field1TS::New();
2515 MEDFileInt64Field1TS(const std::string& fileName, bool loadAll=true)
2517 return MEDFileInt64Field1TS::New(fileName,loadAll);
2520 MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2522 return MEDFileInt64Field1TS::New(fileName,fieldName,loadAll);
2525 MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2527 return MEDFileInt64Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2530 MEDFileInt64Field1TS(DataArrayByte *db)
2532 return MEDFileInt64Field1TS::New(db);
2535 std::string __str__() const
2537 return self->simpleRepr();
2540 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2542 return MEDFileField1TS_getFieldWithProfile<Int64>(self,type,meshDimRelToMax,mesh);
2545 DataArrayInt64 *getUndergroundDataArray() const
2547 DataArrayInt64 *ret=self->getUndergroundDataArray();
2553 PyObject *getUndergroundDataArrayExt() const
2555 return MEDFileField1TS_getUndergroundDataArrayExt<Int64>(self);
2560 class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
2563 static MEDFileFloatField1TS *New();
2564 static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true);
2565 static MEDFileFloatField1TS *New(DataArrayByte *db);
2566 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2567 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2568 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2570 void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
2571 void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2572 void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2573 void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf);
2574 MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const;
2575 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2576 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2577 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2578 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2579 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2582 MEDFileFloatField1TS()
2584 return MEDFileFloatField1TS::New();
2587 MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true)
2589 return MEDFileFloatField1TS::New(fileName,loadAll);
2592 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2594 return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
2597 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2599 return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
2602 MEDFileFloatField1TS(DataArrayByte *db)
2604 return MEDFileFloatField1TS::New(db);
2607 std::string __str__() const
2609 return self->simpleRepr();
2612 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2614 return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
2617 DataArrayFloat *getUndergroundDataArray() const
2619 DataArrayFloat *ret=self->getUndergroundDataArray();
2625 PyObject *getUndergroundDataArrayExt() const
2627 return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
2632 class MEDFileAnyTypeFieldMultiTSIterator
2639 MEDFileAnyTypeField1TS *ret=self->nextt();
2641 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2644 PyErr_SetString(PyExc_StopIteration,"No more data.");
2651 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2654 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
2655 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2656 MEDFileAnyTypeFieldMultiTS *deepCopy() const;
2657 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
2658 std::string getName() const;
2659 void setName(const std::string& name);
2660 std::string getDtUnit() const;
2661 void setDtUnit(const std::string& dtUnit);
2662 std::string getMeshName() const;
2663 void setMeshName(const std::string& newMeshName);
2664 const std::vector<std::string>& getInfo() const;
2665 bool presenceOfMultiDiscPerGeoType() const;
2666 int getNumberOfComponents() const;
2667 int getNumberOfTS() const;
2668 void eraseEmptyTS();
2669 int getPosOfTimeStep(int iteration, int order) const;
2670 int getPosGivenTime(double time, double eps=1e-8) const;
2672 void loadArraysIfNecessary();
2673 void unloadArrays();
2674 void unloadArraysWithoutDataLoss();
2676 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
2677 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
2678 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
2679 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
2680 void synchronizeNameScope();
2681 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const;
2686 return self->getNumberOfTS();
2689 int getTimeId(PyObject *elt0) const
2691 if(elt0 && PyInt_Check(elt0))
2693 int pos=(int)PyInt_AS_LONG(elt0);
2696 else if(elt0 && PyTuple_Check(elt0))
2698 if(PyTuple_Size(elt0)==2)
2700 PyObject *o0=PyTuple_GetItem(elt0,0);
2701 PyObject *o1=PyTuple_GetItem(elt0,1);
2702 if(PyInt_Check(o0) && PyInt_Check(o1))
2704 int iter=(int)PyInt_AS_LONG(o0);
2705 int order=(int)PyInt_AS_LONG(o1);
2706 return self->getPosOfTimeStep(iter,order);
2709 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 !");
2712 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 !");
2714 else if(elt0 && PyFloat_Check(elt0))
2716 double val=PyFloat_AS_DOUBLE(elt0);
2717 return self->getPosGivenTime(val);
2720 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2723 PyObject *getIterations() const
2725 std::vector< std::pair<int,int> > res(self->getIterations());
2726 return convertVecPairIntToPy(res);
2729 PyObject *getTimeSteps() const
2731 std::vector<double> ret1;
2732 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2733 std::size_t sz=ret.size();
2734 PyObject *ret2=PyList_New(sz);
2735 for(std::size_t i=0;i<sz;i++)
2737 PyObject *elt=PyTuple_New(3);
2738 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2739 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2740 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2741 PyList_SetItem(ret2,i,elt);
2746 PyObject *getTypesOfFieldAvailable() const
2748 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2749 PyObject *ret2=PyList_New(ret.size());
2750 for(int i=0;i<(int)ret.size();i++)
2752 const std::vector<TypeOfField>& rett=ret[i];
2753 PyObject *ret3=PyList_New(rett.size());
2754 for(int j=0;j<(int)rett.size();j++)
2755 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2756 PyList_SetItem(ret2,i,ret3);
2761 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const
2763 std::vector<int> ret1;
2764 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2765 PyObject *elt=PyTuple_New(2);
2766 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2767 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2771 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const
2773 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2774 std::vector< std::vector<TypeOfField> > typesF;
2775 std::vector< std::vector<std::string> > pfls;
2776 std::vector< std::vector<std::string> > locs;
2777 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2778 std::size_t sz=ret.size();
2779 PyObject *ret2=PyList_New(sz);
2780 for(std::size_t i=0;i<sz;i++)
2782 const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2783 const std::vector<TypeOfField>& typesFI=typesF[i];
2784 const std::vector<std::string>& pflsI=pfls[i];
2785 const std::vector<std::string>& locsI=locs[i];
2786 PyObject *elt=PyTuple_New(2);
2787 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2788 std::size_t sz2=ret[i].size();
2789 PyObject *elt2=PyList_New(sz2);
2790 for(std::size_t j=0;j<sz2;j++)
2792 PyObject *elt3=PyTuple_New(4);
2793 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2794 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2795 PyTuple_SetItem(elt3,1,elt4);
2796 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2797 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2798 PyList_SetItem(elt2,j,elt3);
2800 PyTuple_SetItem(elt,1,elt2);
2801 PyList_SetItem(ret2,i,elt);
2806 std::vector<int> getTimeIds(PyObject *elts) const
2808 if(PyList_Check(elts))
2810 std::size_t sz=PyList_Size(elts);
2811 std::vector<int> ret(sz);
2812 for(std::size_t i=0;i<sz;i++)
2814 PyObject *elt=PyList_GetItem(elts,i);
2815 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2821 std::vector<int> ret(1);
2822 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2827 void __delitem__(PyObject *elts)
2829 if(PySlice_Check(elts))
2831 Py_ssize_t strt=2,stp=2,step=2;
2832 GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2833 self->eraseTimeStepIds2((int)strt,(int)stp,(int)step);
2837 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2838 if(!idsToRemove.empty())
2839 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2843 void eraseTimeStepIds(PyObject *li)
2847 std::vector<int> pos2;
2848 DataArrayInt32 *pos3=0;
2849 DataArrayIntTuple *pos4=0;
2850 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2855 self->eraseTimeStepIds(&pos1,&pos1+1);
2862 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2867 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2871 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2875 MEDFileAnyTypeFieldMultiTSIterator *__iter__()
2877 return self->iterator();
2880 PyObject *__getitem__(PyObject *elt0) const
2882 if(elt0 && PyList_Check(elt0))
2884 std::size_t sz=PyList_Size(elt0);
2885 MCAuto<DataArrayInt32> da=DataArrayInt32::New(); da->alloc(sz,1);
2886 int *pt=da->getPointer();
2887 for(std::size_t i=0;i<sz;i++,pt++)
2889 PyObject *elt1=PyList_GetItem(elt0,i);
2890 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2892 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2894 else if(elt0 && PySlice_Check(elt0))
2896 Py_ssize_t strt=2,stp=2,step=2;
2897 GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2898 return convertMEDFileFieldMultiTS(self->buildSubPartSlice((int)strt,(int)stp,(int)step),SWIG_POINTER_OWN | 0);
2901 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2904 bool changeMeshNames(PyObject *li)
2906 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2907 return self->changeMeshNames(modifTab);
2910 PyObject *splitComponents() const
2912 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2913 std::size_t sz=ret.size();
2914 PyObject *retPy=PyList_New(sz);
2915 for(std::size_t i=0;i<sz;i++)
2916 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2920 PyObject *splitDiscretizations() const
2922 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2923 std::size_t sz=ret.size();
2924 PyObject *retPy=PyList_New(sz);
2925 for(std::size_t i=0;i<sz;i++)
2926 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2930 PyObject *splitMultiDiscrPerGeoTypes() const
2932 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2933 std::size_t sz=ret.size();
2934 PyObject *retPy=PyList_New(sz);
2935 for(std::size_t i=0;i<sz;i++)
2936 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2940 void pushBackTimeSteps(PyObject *li)
2943 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2944 if(SWIG_IsOK(status))
2946 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2950 std::vector<MEDFileAnyTypeField1TS *> tmp;
2951 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2952 self->pushBackTimeSteps(tmp);
2956 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2958 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2959 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2960 return self->extractPart(extractDefCpp,mm);
2963 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li)
2965 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2966 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2967 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2968 std::size_t sz=ret.size();
2969 PyObject *retPy=PyList_New(sz);
2970 for(std::size_t i=0;i<sz;i++)
2972 std::size_t sz2=ret[i].size();
2973 PyObject *ret1Py=PyList_New(sz2);
2974 for(std::size_t j=0;j<sz2;j++)
2976 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2979 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2981 PyList_SetItem(retPy,i,ret1Py);
2986 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh)
2988 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2989 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2990 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2991 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2992 if(ret2.size()!=ret.size())
2994 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2995 throw INTERP_KERNEL::Exception(oss.str().c_str());
2997 std::size_t sz=ret.size();
2998 PyObject *retPy=PyList_New(sz);
2999 for(std::size_t i=0;i<sz;i++)
3001 std::size_t sz2=ret[i].size();
3002 PyObject *ret0Py=PyTuple_New(2);
3003 PyObject *ret1Py=PyList_New(sz2);
3004 for(std::size_t j=0;j<sz2;j++)
3006 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
3009 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
3011 PyTuple_SetItem(ret0Py,0,ret1Py);
3012 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
3013 PyList_SetItem(retPy,i,ret0Py);
3020 class MEDFileInt32FieldMultiTS;
3021 class MEDFileInt64FieldMultiTS;
3023 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3026 static MEDFileFieldMultiTS *New();
3027 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3028 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3029 static MEDFileFieldMultiTS *New(DataArrayByte *db);
3031 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
3032 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3033 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3034 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3035 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3036 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3038 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
3039 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3040 MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
3043 static MEDFileAnyTypeFieldMultiTS *Aggregate(PyObject *fmtssPy, PyObject *dtsPy)
3045 std::vector<const MEDFileAnyTypeFieldMultiTS *> fmtss;
3046 convertFromPyObjVectorOfObj<const MEDFileAnyTypeFieldMultiTS *>(fmtssPy,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",fmtss);
3047 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > dts2;
3048 convertPyToVectorVectorPairInt(dtsPy,dts2);
3049 std::vector< std::vector< std::pair<int,mcIdType> > > dts(MEDVectorVectorMIIterator(0,dts2),MEDVectorVectorMIIterator(dts2.size(),dts2));
3050 MCAuto<MEDFileAnyTypeFieldMultiTS> ret = MEDFileFieldMultiTS::Aggregate(fmtss,dts);
3054 MEDFileFieldMultiTS()
3056 return MEDFileFieldMultiTS::New();
3059 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true)
3061 return MEDFileFieldMultiTS::New(fileName,loadAll);
3064 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3066 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
3069 MEDFileFieldMultiTS(DataArrayByte *db)
3071 return MEDFileFieldMultiTS::New(db);
3074 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3076 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3077 std::size_t sz(tmp.size());
3078 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3079 for(std::size_t i=0;i<sz;i++)
3081 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3082 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3084 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3087 std::string __str__() const
3089 return self->simpleRepr();
3092 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3094 DataArrayIdType *ret1=0;
3095 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3096 PyObject *ret=PyTuple_New(2);
3097 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3098 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3102 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const
3104 std::vector<INTERP_KERNEL::NormalizedCellType> types;
3105 std::vector< std::vector<TypeOfField> > typesF;
3106 std::vector< std::vector<std::string> > pfls;
3107 std::vector< std::vector<std::string> > locs;
3108 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
3109 std::size_t sz=ret.size();
3110 PyObject *ret2=PyList_New(sz);
3111 for(std::size_t i=0;i<sz;i++)
3113 const std::vector<DataArrayDouble *>& dadsI=ret[i];
3114 const std::vector<TypeOfField>& typesFI=typesF[i];
3115 const std::vector<std::string>& pflsI=pfls[i];
3116 const std::vector<std::string>& locsI=locs[i];
3117 PyObject *elt=PyTuple_New(2);
3118 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
3119 std::size_t sz2=ret[i].size();
3120 PyObject *elt2=PyList_New(sz2);
3121 for(std::size_t j=0;j<sz2;j++)
3123 PyObject *elt3=PyTuple_New(4);
3124 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
3125 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3126 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
3127 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
3128 PyList_SetItem(elt2,j,elt3);
3130 PyTuple_SetItem(elt,1,elt2);
3131 PyList_SetItem(ret2,i,elt);
3135 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const
3137 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
3143 PyObject *getUndergroundDataArrayExt(int iteration, int order) const
3145 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > > elt1Cpp;
3146 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
3149 PyObject *ret=PyTuple_New(2);
3150 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3151 std::size_t sz=elt1Cpp.size();
3152 PyObject *elt=PyList_New(sz);
3153 for(std::size_t i=0;i<sz;i++)
3155 PyObject *elt1=PyTuple_New(2);
3156 PyObject *elt2=PyTuple_New(2);
3157 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
3158 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
3159 PyObject *elt3=PyTuple_New(2);
3160 PyTuple_SetItem(elt3,0,PyInt_FromLong(elt1Cpp[i].second.first));
3161 PyTuple_SetItem(elt3,1,PyInt_FromLong(elt1Cpp[i].second.second));
3162 PyTuple_SetItem(elt1,0,elt2);
3163 PyTuple_SetItem(elt1,1,elt3);
3164 PyList_SetItem(elt,i,elt1);
3166 PyTuple_SetItem(ret,1,elt);
3172 class MEDFileFieldsIterator
3179 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3181 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3184 PyErr_SetString(PyExc_StopIteration,"No more data.");
3191 class MEDFileInt32FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3194 static MEDFileInt32FieldMultiTS *New();
3195 static MEDFileInt32FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3196 static MEDFileInt32FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3197 static MEDFileInt32FieldMultiTS *New(DataArrayByte *db);
3199 void appendFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
3200 void appendFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3201 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3202 MEDCouplingFieldInt32 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3203 MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3204 MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3205 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3206 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3207 MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3210 MEDFileInt32FieldMultiTS()
3212 return MEDFileInt32FieldMultiTS::New();
3215 MEDFileInt32FieldMultiTS(const std::string& fileName, bool loadAll=true)
3217 return MEDFileInt32FieldMultiTS::New(fileName,loadAll);
3220 MEDFileInt32FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3222 return MEDFileInt32FieldMultiTS::New(fileName,fieldName,loadAll);
3225 MEDFileInt32FieldMultiTS(DataArrayByte *db)
3227 return MEDFileInt32FieldMultiTS::New(db);
3230 static MEDFileInt32FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3232 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3233 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3234 return MEDFileInt32FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3237 std::string __str__() const
3239 return self->simpleRepr();
3242 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3244 DataArrayIdType *ret1=0;
3245 DataArrayInt32 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3246 PyObject *ret=PyTuple_New(2);
3247 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int32>::TI, SWIG_POINTER_OWN | 0 ));
3248 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3252 DataArrayInt32 *getUndergroundDataArray(int iteration, int order) const
3254 DataArrayInt32 *ret=self->getUndergroundDataArray(iteration,order);
3262 class MEDFileInt64FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3265 static MEDFileInt64FieldMultiTS *New();
3266 static MEDFileInt64FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3267 static MEDFileInt64FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3268 static MEDFileInt64FieldMultiTS *New(DataArrayByte *db);
3270 void appendFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
3271 void appendFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3272 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3273 MEDCouplingFieldInt64 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3274 MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3275 MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3276 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3277 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3278 MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3281 MEDFileInt64FieldMultiTS()
3283 return MEDFileInt64FieldMultiTS::New();
3286 MEDFileInt64FieldMultiTS(const std::string& fileName, bool loadAll=true)
3288 return MEDFileInt64FieldMultiTS::New(fileName,loadAll);
3291 MEDFileInt64FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3293 return MEDFileInt64FieldMultiTS::New(fileName,fieldName,loadAll);
3296 MEDFileInt64FieldMultiTS(DataArrayByte *db)
3298 return MEDFileInt64FieldMultiTS::New(db);
3301 static MEDFileInt64FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3303 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3304 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3305 return MEDFileInt64FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3308 std::string __str__() const
3310 return self->simpleRepr();
3313 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3315 DataArrayIdType *ret1=0;
3316 DataArrayInt64 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3317 PyObject *ret=PyTuple_New(2);
3318 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int64>::TI, SWIG_POINTER_OWN | 0 ));
3319 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3323 DataArrayInt64 *getUndergroundDataArray(int iteration, int order) const
3325 DataArrayInt64 *ret=self->getUndergroundDataArray(iteration,order);
3333 class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3336 static MEDFileFloatFieldMultiTS *New();
3337 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3338 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3339 static MEDFileFloatFieldMultiTS *New(DataArrayByte *db);
3341 void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
3342 void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3343 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3344 MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const;
3345 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3346 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3347 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3348 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3349 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3352 MEDFileFloatFieldMultiTS()
3354 return MEDFileFloatFieldMultiTS::New();
3357 MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true)
3359 return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
3362 MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3364 return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
3367 MEDFileFloatFieldMultiTS(DataArrayByte *db)
3369 return MEDFileFloatFieldMultiTS::New(db);
3372 static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3374 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3375 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3376 return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3379 std::string __str__() const
3381 return self->simpleRepr();
3384 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3386 DataArrayIdType *ret1=0;
3387 DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3388 PyObject *ret=PyTuple_New(2);
3389 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
3390 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3394 DataArrayFloat *getUndergroundDataArray(int iteration, int order) const
3396 DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
3404 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3407 static MEDFileMeshSupports *New(const std::string& fileName);
3408 std::vector<std::string> getSupMeshNames() const;
3411 MEDFileUMesh *getSupMeshWithName(const std::string& name) const
3413 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3414 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3422 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3425 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms);
3427 MEDFileStructureElements();
3430 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3433 static MEDFileFields *New();
3434 static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
3435 static MEDFileFields *New(DataArrayByte *db);
3436 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities);
3437 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
3438 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
3439 MEDFileFields *deepCopy() const;
3440 MEDFileFields *shallowCpy() const;
3442 void loadArraysIfNecessary();
3443 void unloadArrays();
3444 void unloadArraysWithoutDataLoss();
3445 int getNumberOfFields() const;
3446 std::vector<std::string> getFieldsNames() const;
3447 std::vector<std::string> getMeshesNames() const;
3449 void resize(int newSize);
3450 void pushField(MEDFileAnyTypeFieldMultiTS *field);
3451 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
3452 int getPosFromFieldName(const std::string& fieldName) const;
3453 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
3454 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
3455 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
3456 bool presenceOfStructureElements() const;
3457 void aggregate(const MEDFileFields& other);
3458 void killStructureElements();
3459 void keepOnlyStructureElements();
3460 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
3461 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
3462 void destroyFieldAtPos(int i);
3463 bool removeFieldsWithoutAnyTimeStep();
3468 return MEDFileFields::New();
3471 MEDFileFields(const std::string& fileName, bool loadAll=true)
3473 return MEDFileFields::New(fileName,loadAll);
3476 MEDFileFields(DataArrayByte *db)
3478 return MEDFileFields::New(db);
3481 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities)
3483 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3486 std::string __str__() const
3488 return self->simpleRepr();
3491 MEDFileFields *partOfThisOnStructureElements() const
3493 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3497 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const
3499 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3503 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true)
3505 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3506 std::size_t sz(tmp.size());
3507 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3508 for(std::size_t i=0;i<sz;i++)
3510 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3511 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3513 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3516 PyObject *getMeshSENames() const
3518 std::vector< std::pair<std::string,std::string> > ps;
3519 self->getMeshSENames(ps);
3520 return convertVectPairStToPy(ps);
3523 PyObject *getCommonIterations() const
3526 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3527 PyObject *ret=PyTuple_New(2);
3528 PyObject *ret_0=PyList_New(ret0.size());
3530 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3532 PyObject *elt=PyTuple_New(2);
3533 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3534 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3535 PyList_SetItem(ret_0,rk,elt);
3537 PyTuple_SetItem(ret,0,ret_0);
3538 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3539 PyTuple_SetItem(ret,1,ret_1);
3543 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3545 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3546 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3549 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3551 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3552 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3555 PyObject *__getitem__(PyObject *obj)
3557 if(obj && PyList_Check(obj))
3559 std::size_t sz=PyList_Size(obj);
3560 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3561 int *pt=da->getPointer();
3562 for(std::size_t i=0;i<sz;i++,pt++)
3564 PyObject *elt1=PyList_GetItem(obj,i);
3565 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3567 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3570 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3573 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field)
3575 self->setFieldAtPos(obj,field);
3581 return self->getNumberOfFields();
3584 MEDFileFieldsIterator *__iter__()
3586 return self->iterator();
3589 bool changeMeshNames(PyObject *li)
3591 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3592 return self->changeMeshNames(modifTab);
3595 int getPosOfField(PyObject *elt0) const
3597 static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
3599 throw INTERP_KERNEL::Exception(msg);
3600 if(PyInt_Check(elt0))
3602 return (int)PyInt_AS_LONG(elt0);
3604 return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
3607 std::vector<int> getPosOfFields(PyObject *elts) const
3609 if(PyList_Check(elts))
3611 std::size_t sz=PyList_Size(elts);
3612 std::vector<int> ret(sz);
3613 for(std::size_t i=0;i<sz;i++)
3615 PyObject *elt=PyList_GetItem(elts,i);
3616 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3622 std::vector<int> ret(1);
3623 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3628 void pushFields(PyObject *fields)
3630 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3631 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3632 self->pushFields(tmp);
3635 void __delitem__(PyObject *elts)
3637 if(elts && PySlice_Check(elts))
3639 Py_ssize_t strt=2,stp=2,step=2;
3640 GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3641 self->destroyFieldsAtPos2((int)strt,(int)stp,(int)step);
3645 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3646 if(!idsToRemove.empty())
3647 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3651 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
3653 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
3654 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3655 return self->extractPart(extractDefCpp,mm);
3658 MEDFileFields *linearToQuadratic(const MEDFileMeshes *oldLin, const MEDFileMeshes *newQuad) const
3660 MCAuto<MEDFileFields> ret(self->linearToQuadratic(oldLin,newQuad));
3666 class MEDFileParameter1TS : public RefCountObject
3669 void setIteration(int it);
3670 int getIteration() const;
3671 void setOrder(int order);
3672 int getOrder() const;
3673 void setTimeValue(double time);
3674 void setTime(int dt, int it, double time);
3675 double getTime(int& dt, int& it);
3676 double getTimeValue() const;
3679 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3682 void setValue(double val);
3683 double getValue() const;
3684 std::string simpleRepr() const;
3687 std::string __str__() const
3689 return self->simpleRepr();
3694 class MEDFileParameterTinyInfo : public MEDFileWritable
3697 void setDescription(const std::string& name);
3698 std::string getDescription() const;
3699 void setTimeUnit(const std::string& unit);
3700 std::string getTimeUnit() const;
3703 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3706 static MEDFileParameterDouble1TS *New();
3707 static MEDFileParameterDouble1TS *New(const std::string& fileName);
3708 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName);
3709 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it);
3710 virtual MEDFileParameter1TS *deepCopy() const;
3711 virtual std::string simpleRepr() const;
3712 void setName(const std::string& name);
3713 std::string getName() const;
3714 void write(const std::string& fileName, int mode) const;
3717 MEDFileParameterDouble1TS()
3719 return MEDFileParameterDouble1TS::New();
3722 MEDFileParameterDouble1TS(const std::string& fileName)
3724 return MEDFileParameterDouble1TS::New(fileName);
3727 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName)
3729 return MEDFileParameterDouble1TS::New(fileName,paramName);
3732 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it)
3734 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3737 std::string __str__() const
3739 return self->simpleRepr();
3742 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const
3745 bool ret0=self->isEqual(other,eps,what);
3746 PyObject *res=PyList_New(2);
3747 PyObject *ret0Py=ret0?Py_True:Py_False;
3749 PyList_SetItem(res,0,ret0Py);
3750 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3756 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3759 static MEDFileParameterMultiTS *New();
3760 static MEDFileParameterMultiTS *New(const std::string& fileName);
3761 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName);
3762 std::string getName() const;
3763 void setName(const std::string& name);
3764 MEDFileParameterMultiTS *deepCopy() const;
3765 void write(const std::string& fileName, int mode) const;
3766 std::string simpleRepr() const;
3767 void appendValue(int dt, int it, double time, double val);
3768 double getDoubleValue(int iteration, int order) const;
3769 int getPosOfTimeStep(int iteration, int order) const;
3770 int getPosGivenTime(double time, double eps=1e-8) const;
3771 int getNumberOfTS() const;
3774 MEDFileParameterMultiTS()
3776 return MEDFileParameterMultiTS::New();
3779 MEDFileParameterMultiTS(const std::string& fileName)
3781 return MEDFileParameterMultiTS::New(fileName);
3784 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3786 return MEDFileParameterMultiTS::New(fileName,paramName);
3789 std::string __str__() const
3791 return self->simpleRepr();
3794 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const
3797 bool ret0=self->isEqual(other,eps,what);
3798 PyObject *res=PyList_New(2);
3799 PyObject *ret0Py=ret0?Py_True:Py_False;
3801 PyList_SetItem(res,0,ret0Py);
3802 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3806 void eraseTimeStepIds(PyObject *ids)
3810 std::vector<int> pos2;
3811 DataArrayInt *pos3=0;
3812 DataArrayIntTuple *pos4=0;
3813 convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3818 self->eraseTimeStepIds(&pos1,&pos1+1);
3825 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3830 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3834 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3838 int getTimeStepId(PyObject *elt0) const
3840 if(elt0 && PyInt_Check(elt0))
3842 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3845 else if(elt0 && PyTuple_Check(elt0))
3847 if(PyTuple_Size(elt0)==2)
3849 PyObject *o0=PyTuple_GetItem(elt0,0);
3850 PyObject *o1=PyTuple_GetItem(elt0,1);
3851 if(PyInt_Check(o0) && PyInt_Check(o1))
3853 int iter=(int)PyInt_AS_LONG(o0);
3854 int order=(int)PyInt_AS_LONG(o1);
3855 return self->getPosOfTimeStep(iter,order);
3858 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 !");
3861 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 !");
3863 else if(elt0 && PyFloat_Check(elt0))
3865 double val=PyFloat_AS_DOUBLE(elt0);
3866 return self->getPosGivenTime(val);
3869 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3872 MEDFileParameter1TS *__getitem__(PyObject *elt0) const
3874 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3880 std::vector<int> getTimeStepIds(PyObject *elts) const
3882 if(PyList_Check(elts))
3884 std::size_t sz=PyList_Size(elts);
3885 std::vector<int> ret(sz);
3886 for(std::size_t i=0;i<sz;i++)
3888 PyObject *elt=PyList_GetItem(elts,i);
3889 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3895 std::vector<int> ret(1);
3896 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3901 void __delitem__(PyObject *elts)
3903 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3904 if(!idsToRemove.empty())
3905 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3908 MEDFileParameter1TS *getTimeStepAtPos(int posId) const
3910 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3916 PyObject *getIterations() const
3918 std::vector< std::pair<int,int> > res=self->getIterations();
3919 PyObject *ret=PyList_New(res.size());
3921 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3923 PyObject *elt=PyTuple_New(2);
3924 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3925 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3926 PyList_SetItem(ret,rk,elt);
3931 PyObject *getTimeSteps() const
3933 std::vector<double> res2;
3934 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3935 PyObject *ret=PyList_New(res.size());
3937 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3939 PyObject *elt=PyTuple_New(3);
3940 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3941 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3942 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3943 PyList_SetItem(ret,rk,elt);
3950 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3953 static MEDFileParameters *New();
3954 static MEDFileParameters *New(const std::string& fileName);
3955 static MEDFileParameters *New(DataArrayByte *db);
3956 MEDFileParameters *deepCopy() const;
3957 std::vector<std::string> getParamsNames() const;
3958 std::string simpleRepr() const;
3959 void resize(int newSize);
3960 void pushParam(MEDFileParameterMultiTS *param);
3961 void setParamAtPos(int i, MEDFileParameterMultiTS *param);
3962 void destroyParamAtPos(int i);
3963 int getPosFromParamName(const std::string& paramName) const;
3964 int getNumberOfParams() const;
3969 return MEDFileParameters::New();
3972 MEDFileParameters(const std::string& fileName)
3974 return MEDFileParameters::New(fileName);
3977 MEDFileParameters(DataArrayByte *db)
3979 return MEDFileParameters::New(db);
3982 std::string __str__() const
3984 return self->simpleRepr();
3987 MEDFileParameterMultiTS *__getitem__(PyObject *obj)
3989 static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
3990 if(PyInt_Check(obj))
3992 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3997 MEDFileParameterMultiTS *ret(self->getParamWithName(convertPyObjectToStr(obj,msg)));
4005 return self->getNumberOfParams();
4008 MEDFileParameterMultiTS *getParamAtPos(int i) const
4010 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
4016 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const
4018 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
4024 PyObject *isEqual(const MEDFileParameters *other, double eps) const
4027 bool ret0=self->isEqual(other,eps,what);
4028 PyObject *res=PyList_New(2);
4029 PyObject *ret0Py=ret0?Py_True:Py_False;
4031 PyList_SetItem(res,0,ret0Py);
4032 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
4038 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
4041 static MEDFileData *New(DataArrayByte *db);
4042 static MEDFileData *New(const std::string& fileName);
4043 static MEDFileData *New();
4044 MEDFileData *deepCopy() const;
4045 void setFields(MEDFileFields *fields);
4046 void setMeshes(MEDFileMeshes *meshes);
4047 void setParams(MEDFileParameters *params);
4048 int getNumberOfFields() const;
4049 int getNumberOfMeshes() const;
4050 int getNumberOfParams() const;
4052 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName);
4053 bool unPolyzeMeshes();
4054 void dealWithStructureElements();
4055 std::string getHeader() const;
4056 void setHeader(const std::string& header);
4060 MEDFileData(const std::string& fileName)
4062 return MEDFileData::New(fileName);
4065 MEDFileData(DataArrayByte *db)
4067 return MEDFileData::New(db);
4072 return MEDFileData::New();
4075 std::string __str__() const
4077 return self->simpleRepr();
4080 MEDFileMeshes *getMeshes() const
4082 MEDFileMeshes *ret=self->getMeshes();
4088 MEDFileParameters *getParams() const
4090 MEDFileParameters *ret=self->getParams();
4096 MEDFileFields *getFields() const
4098 MEDFileFields *ret=self->getFields();
4104 bool changeMeshNames(PyObject *li)
4106 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
4107 return self->changeMeshNames(modifTab);
4110 static MEDFileData *Aggregate(PyObject *mfds)
4112 std::vector<const MEDFileData *> mfdsCpp;
4113 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
4114 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
4120 class SauvReader : public RefCountObject
4123 static SauvReader* New(const std::string& fileName);
4124 MEDFileData * loadInMEDFileDS();
4127 SauvReader(const std::string& fileName)
4129 return SauvReader::New(fileName);
4134 class SauvWriter : public RefCountObject
4137 static SauvWriter * New();
4138 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0);
4139 void write(const std::string& fileName);
4140 void setCpyGrpIfOnASingleFamilyStatus(bool status);
4141 bool getCpyGrpIfOnASingleFamilyStatus() const;
4146 return SauvWriter::New();
4153 class MEDFileMeshStruct;
4155 class MEDFileField1TSStructItem
4158 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt);
4161 class MEDFileMeshStruct : public RefCountObject
4164 static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
4166 ~MEDFileMeshStruct();
4169 class MEDMeshMultiLev : public RefCountObject
4172 virtual MEDMeshMultiLev *prepare() const;
4173 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const;
4174 DataArrayIdType *retrieveGlobalNodeIdsIfAny() const;
4180 PyObject *retrieveFamilyIdsOnCells() const
4182 DataArrayIdType *famIds(0);
4183 bool isWithoutCopy(false);
4184 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
4185 PyObject *ret=PyTuple_New(2);
4186 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4188 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4189 PyTuple_SetItem(ret,1,ret1Py);
4193 PyObject *retrieveNumberIdsOnCells() const
4195 DataArrayIdType *numIds(0);
4196 bool isWithoutCopy(false);
4197 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
4198 PyObject *ret=PyTuple_New(2);
4199 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4201 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4202 PyTuple_SetItem(ret,1,ret1Py);
4206 PyObject *retrieveFamilyIdsOnNodes() const
4208 DataArrayIdType *famIds(0);
4209 bool isWithoutCopy(false);
4210 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
4211 PyObject *ret=PyTuple_New(2);
4212 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4214 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4215 PyTuple_SetItem(ret,1,ret1Py);
4219 PyObject *retrieveNumberIdsOnNodes() const
4221 DataArrayIdType *numIds(0);
4222 bool isWithoutCopy(false);
4223 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
4224 PyObject *ret=PyTuple_New(2);
4225 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4227 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4228 PyTuple_SetItem(ret,1,ret1Py);
4232 PyObject *getGeoTypes() const
4234 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
4235 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4236 PyObject *res(PyList_New(result.size()));
4237 for(int i=0;iL!=result.end(); i++, iL++)
4238 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4244 class MEDUMeshMultiLev : public MEDMeshMultiLev
4247 ~MEDUMeshMultiLev();
4251 PyObject *buildVTUArrays() const
4253 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayIdType *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
4254 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
4255 PyObject *ret0Py=ncc?Py_True:Py_False;
4257 PyObject *ret=PyTuple_New(7);
4258 PyTuple_SetItem(ret,0,ret0Py);
4259 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4260 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
4261 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4262 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4263 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4264 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4270 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
4273 ~MEDStructuredMeshMultiLev();
4276 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4279 ~MEDCMeshMultiLev();
4283 PyObject *buildVTUArrays() const
4286 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4287 std::size_t sz(objs.size());
4288 PyObject *ret(PyTuple_New(2));
4289 PyObject *ret0=PyList_New(sz);
4290 for(std::size_t i=0;i<sz;i++)
4291 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4292 PyTuple_SetItem(ret,0,ret0);
4293 PyObject *ret1Py(isInternal?Py_True:Py_False);
4295 PyTuple_SetItem(ret,1,ret1Py);
4301 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4304 ~MEDCurveLinearMeshMultiLev();
4308 PyObject *buildVTUArrays() const
4310 DataArrayDouble *ret0(0);
4311 std::vector<mcIdType> ret1;
4313 self->buildVTUArrays(ret0,ret1,ret2);
4314 std::size_t sz(ret1.size());
4315 PyObject *ret=PyTuple_New(3);
4316 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4317 PyObject *ret1Py=PyList_New(sz);
4318 for(std::size_t i=0;i<sz;i++)
4319 PyList_SetItem(ret1Py,i,PyInt_FromLong(ret1[i]));
4320 PyTuple_SetItem(ret,1,ret1Py);
4321 PyObject *ret2Py(ret2?Py_True:Py_False);
4323 PyTuple_SetItem(ret,2,ret2Py);
4329 class MEDFileFastCellSupportComparator : public RefCountObject
4332 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
4333 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4334 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4335 int getNumberOfTS() const;
4337 ~MEDFileFastCellSupportComparator();
4341 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const
4343 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4344 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4345 PyObject *res(PyList_New(result.size()));
4346 for(int i=0;iL!=result.end(); i++, iL++)
4347 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4353 class MeshFormatReader
4356 MeshFormatReader(const std::string& meshFileName, const std::vector<std::string>& fieldFileName);
4358 MEDFileData* loadInMedFileDS();
4359 void setMeshName(const std::string& theMeshName);
4360 std::string getMeshName() const;
4361 void setFile(const std::string& theFileName);
4362 void setFieldFileNames(const std::vector<std::string>& theFieldFileNames);
4363 std::vector<std::string> getFieldFileNames() const;
4365 class MeshFormatWriter
4368 MeshFormatWriter(const std::string& meshFileName, const std::vector<std::string>& fieldFileNames);
4370 void setMeshFileName(const std::string& meshFileName);
4371 std::string getMeshFileName() const;
4372 void setFieldFileNames(const std::vector<std::string>& fieldFileNames);
4373 std::vector<std::string> getFieldFileNames() const;
4374 void setMEDFileDS(MEDCoupling::MEDFileData* mfd);
4384 def exit1TS(self, exctype, exc, tb):
4387 MEDFileAnyTypeField1TS.__enter__=enter1TS
4388 MEDFileAnyTypeField1TS.__exit__=exit1TS
4389 MEDFileIntField1TS = MEDFileInt32Field1TS
4390 MEDFileIntFieldMultiTS = MEDFileInt32FieldMultiTS
4391 if MEDCouplingUse64BitIDs():
4392 MEDFileIDField1TS = MEDFileInt64Field1TS
4393 MEDFileIDFieldMultiTS = MEDFileInt64FieldMultiTS
4395 MEDFileIDField1TS = MEDFileInt32Field1TS
4396 MEDFileIDFieldMultiTS = MEDFileInt32FieldMultiTS