1 // Copyright (C) 2017-2023 CEA, EDF
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::LoadConnectivityOnlyPartOf;
112 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
113 %newobject MEDCoupling::MEDFileUMesh::getCoords;
114 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
115 %newobject MEDCoupling::MEDFileUMesh::getGroup;
116 %newobject MEDCoupling::MEDFileUMesh::getGroups;
117 %newobject MEDCoupling::MEDFileUMesh::getFamily;
118 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
119 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
120 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
121 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
122 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
123 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
124 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
125 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
126 %newobject MEDCoupling::MEDFileUMesh::computeFetchedNodeIds;
127 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
128 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
129 %newobject MEDCoupling::MEDFileUMesh::extractPart;
130 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
131 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
132 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
133 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
134 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
135 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
136 %newobject MEDCoupling::MEDFileCMesh::New;
137 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
138 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
139 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
140 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
141 %newobject MEDCoupling::MEDFileMeshes::New;
142 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
143 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
144 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
145 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
146 %newobject MEDCoupling::MEDFileMeshes::__iter__;
148 %newobject MEDCoupling::MEDFileMeshSupports::New;
149 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
151 %newobject MEDCoupling::MEDFileStructureElements::New;
153 %newobject MEDCoupling::MEDFileFields::New;
154 %newobject MEDCoupling::MEDFileFields::NewAdv;
155 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
156 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
157 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
158 %newobject MEDCoupling::MEDFileFields::deepCopy;
159 %newobject MEDCoupling::MEDFileFields::shallowCpy;
160 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
161 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
162 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
163 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
164 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
165 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
166 %newobject MEDCoupling::MEDFileFields::__iter__;
167 %newobject MEDCoupling::MEDFileFields::extractPart;
168 %newobject MEDCoupling::MEDFileFields::linearToQuadratic;
170 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
173 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
174 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
175 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
176 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
177 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
178 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
179 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
182 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
183 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
184 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
185 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
186 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
187 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
188 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
189 %newobject MEDCoupling::MEDFileFieldMultiTS::Aggregate;
191 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::New;
192 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::field;
193 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::LoadSpecificEntities;
194 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getUndergroundDataArray;
195 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::convertToDouble;
196 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevel;
197 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtTopLevel;
198 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldOnMeshAtLevel;
199 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevelOld;
201 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::New;
202 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::field;
203 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::LoadSpecificEntities;
204 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getUndergroundDataArray;
205 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::convertToDouble;
206 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevel;
207 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtTopLevel;
208 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldOnMeshAtLevel;
209 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevelOld;
211 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::New;
212 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::field;
213 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::LoadSpecificEntities;
214 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getUndergroundDataArray;
215 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::convertToDouble;
216 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevel;
217 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtTopLevel;
218 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldOnMeshAtLevel;
219 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevelOld;
221 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
222 %newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
223 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
224 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
225 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
226 %newobject MEDCoupling::MEDFileAnyTypeField1TS::buildNewEmpty;
227 %newobject MEDCoupling::MEDFileField1TS::New;
228 %newobject MEDCoupling::MEDFileField1TS::field;
229 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
230 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
231 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
232 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
233 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
234 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
235 %newobject MEDCoupling::MEDFileField1TS::convertToInt64;
237 %newobject MEDCoupling::MEDFileInt32Field1TS::New;
238 %newobject MEDCoupling::MEDFileInt32Field1TS::field;
239 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevel;
240 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtTopLevel;
241 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldOnMeshAtLevel;
242 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevelOld;
243 %newobject MEDCoupling::MEDFileInt32Field1TS::getUndergroundDataArray;
244 %newobject MEDCoupling::MEDFileInt32Field1TS::convertToDouble;
246 %newobject MEDCoupling::MEDFileInt64Field1TS::New;
247 %newobject MEDCoupling::MEDFileInt64Field1TS::field;
248 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevel;
249 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtTopLevel;
250 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldOnMeshAtLevel;
251 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevelOld;
252 %newobject MEDCoupling::MEDFileInt64Field1TS::getUndergroundDataArray;
253 %newobject MEDCoupling::MEDFileInt64Field1TS::convertToDouble;
255 %newobject MEDCoupling::MEDFileFloatField1TS::New;
256 %newobject MEDCoupling::MEDFileFloatField1TS::field;
257 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevel;
258 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtTopLevel;
259 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldOnMeshAtLevel;
260 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevelOld;
261 %newobject MEDCoupling::MEDFileFloatField1TS::getUndergroundDataArray;
262 %newobject MEDCoupling::MEDFileFloatField1TS::convertToDouble;
264 %newobject MEDCoupling::MEDFileData::New;
265 %newobject MEDCoupling::MEDFileData::deepCopy;
266 %newobject MEDCoupling::MEDFileData::getMeshes;
267 %newobject MEDCoupling::MEDFileData::getFields;
268 %newobject MEDCoupling::MEDFileData::getParams;
269 %newobject MEDCoupling::MEDFileData::Aggregate;
271 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
273 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
274 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
275 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
276 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
277 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
278 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
279 %newobject MEDCoupling::MEDFileParameters::New;
280 %newobject MEDCoupling::MEDFileParameters::deepCopy;
281 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
282 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
283 %newobject MEDCoupling::MEDFileParameters::__getitem__;
285 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
286 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
287 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
288 %newobject MEDCoupling::MEDFileJointCorrespondence::getCorrespondence;
289 %newobject MEDCoupling::MEDFileJointOneStep::New;
290 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
291 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
292 %newobject MEDCoupling::MEDFileJointOneStep::getCorrespondenceAtPos;
293 %newobject MEDCoupling::MEDFileJointOneStep::__getitem__;
294 %newobject MEDCoupling::MEDFileJoint::New;
295 %newobject MEDCoupling::MEDFileJoint::deepCopy;
296 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
297 %newobject MEDCoupling::MEDFileJoint::getStepAtPos;
298 %newobject MEDCoupling::MEDFileJoint::__getitem__;
299 %newobject MEDCoupling::MEDFileJoints::New;
300 %newobject MEDCoupling::MEDFileJoints::deepCopy;
301 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
302 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
303 %newobject MEDCoupling::MEDFileJoints::__getitem__;
304 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
305 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
306 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
307 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
308 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
309 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
310 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
311 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
312 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
314 %newobject MEDCoupling::SauvWriter::New;
315 %newobject MEDCoupling::SauvReader::New;
316 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
319 %newobject MEDCoupling::MEDFileMeshStruct::New;
320 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
321 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
322 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
323 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
324 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
326 %newobject MEDCoupling::MeshFormatReader::loadInMEDFileDS;
327 %newobject MEDCoupling::MeshFormatReader::MeshFormatReader;
328 %newobject MEDCoupling::MeshFormatWriter::MeshFormatWriter;
330 %feature("unref") MEDFileMesh "$this->decrRef();"
331 %feature("unref") MEDFileUMesh "$this->decrRef();"
332 %feature("unref") MEDFileCMesh "$this->decrRef();"
333 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
334 %feature("unref") MEDFileMeshes "$this->decrRef();"
335 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
336 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
337 %feature("unref") MEDFileField1TS "$this->decrRef();"
338 %feature("unref") MEDFileInt32Field1TS "$this->decrRef();"
339 %feature("unref") MEDFileInt64Field1TS "$this->decrRef();"
340 %feature("unref") MEDFileFloatField1TS "$this->decrRef();"
341 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
342 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
343 %feature("unref") MEDFileInt32FieldMultiTS "$this->decrRef();"
344 %feature("unref") MEDFileInt64FieldMultiTS "$this->decrRef();"
345 %feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();"
346 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
347 %feature("unref") MEDFileStructureElements "$this->decrRef();"
348 %feature("unref") MEDFileFields "$this->decrRef();"
349 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
350 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
351 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
352 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
353 %feature("unref") MEDFileParameters "$this->decrRef();"
354 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
355 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
356 %feature("unref") MEDFileJoint "$this->decrRef();"
357 %feature("unref") MEDFileJoints "$this->decrRef();"
358 %feature("unref") MEDFileEquivalences "$this->decrRef();"
359 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
360 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
361 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
362 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
363 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
364 %feature("unref") MEDFileData "$this->decrRef();"
365 %feature("unref") SauvReader "$this->decrRef();"
366 %feature("unref") SauvWriter "$this->decrRef();"
367 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
368 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
369 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
370 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
371 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
372 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
374 namespace MEDCoupling
377 std::string MEDFileVersionStr();
378 std::string MEDFileVersionOfFileStr(const std::string& fileName);
379 void SetEpsilonForNodeComp(double val);
380 void SetCompPolicyForCell(int val);
381 void SetTooLongStrPolicy(int val);
382 void CheckFileForRead(const std::string& fileName);
383 std::vector<std::string> GetMeshNames(const std::string& fileName);
384 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName);
385 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName);
386 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName);
387 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName);
388 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName);
389 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
390 std::vector<std::string> GetAllFieldNames(const std::string& fileName);
391 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName);
392 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
393 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
394 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order);
395 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj);
396 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
397 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
398 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
399 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
400 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName);
401 MEDCoupling::MEDCouplingField *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
402 MEDCoupling::MEDCouplingField *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
403 MEDCoupling::MEDCouplingField *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
404 MEDCoupling::MEDCouplingField *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
405 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch);
406 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
407 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
408 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
409 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
410 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingField *f);
413 %rename (MEDFileVersion) MEDFileVersionSwig;
414 %rename (GetFieldIterations) GetFieldIterationsSwig;
415 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
416 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
417 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
418 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
419 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
420 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
421 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
422 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
423 %rename (WriteUMeshes) WriteUMeshesSwig;
424 %rename (GetTypesOfField) GetTypesOfFieldSwig;
425 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
426 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
427 %rename (ReadField) ReadFieldSwig;
428 %rename (GetFamiliesGroupsInfo) GetFamiliesGroupsInfoSwig;
432 PyObject *MEDFileVersionSwig()
434 int major,minor,release;
435 MEDCoupling::MEDFileVersion(major,minor,release);
436 PyObject *ret(PyTuple_New(3));
437 PyTuple_SetItem(ret,0,SWIG_From_int(major));
438 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
439 PyTuple_SetItem(ret,2,SWIG_From_int(release));
443 int MEDFileSizeOfMedInt()
445 return 8*sizeof(med_int);
448 PyObject *GetFamiliesGroupsInfoSwig(const std::string& fileName, const std::string& meshName)
450 std::map<std::string,mcIdType> families;
451 std::map<std::string,std::vector<std::string>> groupsOnFam;
452 MEDCoupling::GetFamiliesGroupsInfo(fileName,meshName,families,groupsOnFam);
453 AutoPyPtr a(convertMapStringInt(families)),b(convertMapStringVectString(groupsOnFam));
454 AutoPyPtr ret(PyTuple_New(2));
455 PyTuple_SetItem(ret,0,a.retn());
456 PyTuple_SetItem(ret,1,b.retn());
460 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName)
462 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName));
466 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName)
468 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName));
472 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order)
474 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
478 MEDCoupling::MEDCouplingField *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
480 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
484 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
486 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
487 PyObject *ret=PyList_New(res.size());
489 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
491 PyObject *elt=PyTuple_New(2);
492 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
493 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
494 PyList_SetItem(ret,rk,elt);
499 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName)
501 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
502 PyObject *ret=PyList_New(res.size());
504 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
506 PyObject *elt=PyTuple_New(3);
507 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
508 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
509 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
510 PyList_SetItem(ret,rk,elt);
515 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
517 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
518 PyObject *ret=PyList_New(res.size());
520 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
522 PyObject *elt=PyTuple_New(2);
523 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
524 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
525 PyList_SetItem(ret,rk,elt);
530 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
532 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
533 PyObject *ret=PyList_New(res.size());
535 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
537 PyObject *elt=PyTuple_New(2);
538 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
539 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
540 PyList_SetItem(ret,rk,elt);
545 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName)
547 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
548 PyObject *ret=PyList_New(res.size());
550 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
552 PyObject *elt=PyTuple_New(2);
553 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
554 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
555 PyList_SetItem(ret,rk,elt);
560 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName)
562 int meshDim,spaceDim;
563 mcIdType numberOfNodes;
564 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
565 PyObject *ret=PyTuple_New(4);
566 PyObject *elt0=PyList_New(res.size());
568 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
570 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
572 PyObject *elt1=PyList_New(obj2.size());
573 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
575 PyObject *elt2=PyTuple_New(2);
576 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
577 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
578 PyList_SetItem(elt1,j,elt2);
580 PyList_SetItem(elt0,i,elt1);
582 PyTuple_SetItem(ret,0,elt0);
583 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
584 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
585 PyTuple_SetItem(ret,3,SWIG_From_long(numberOfNodes));
589 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
590 const std::string& fieldName, PyObject *liIts)
592 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
593 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
594 return convertFieldDoubleVecToPy(res);
597 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
599 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
600 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
601 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
604 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
606 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
607 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
608 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
611 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch)
613 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
614 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
615 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
618 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
620 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
621 std::size_t size=v.size();
622 PyObject *ret=PyList_New(size);
623 for(std::size_t i=0;i<size;i++)
624 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
628 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
630 std::vector<std::string> grps;
631 converPyListToVecString(li,grps);
632 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
635 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
637 std::vector<std::string> fams;
638 converPyListToVecString(li,fams);
639 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
643 namespace MEDCoupling
645 class MEDFileWritable
648 void copyOptionsFrom(const MEDFileWritable& other) const;
649 int getTooLongStrPolicy() const;
650 void setTooLongStrPolicy(int newVal);
651 int getZipConnPolicy();
652 void setZipConnPolicy(int newVal);
655 class MEDFileWritableStandAlone : public MEDFileWritable
658 void write(const std::string& fileName, int mode) const;
659 void write33(const std::string& fileName, int mode) const;
660 void write30(const std::string& fileName, int mode) const;
663 DataArrayByte *serialize() const
665 MCAuto<DataArrayByte> ret(self->serialize());
669 PyObject *__getstate__()
671 PyObject *ret(PyList_New(0));
675 void __setstate__(PyObject *inp)
681 class MEDFileMeshReadSelector
684 MEDFileMeshReadSelector();
685 MEDFileMeshReadSelector(unsigned int code);
686 mcIdType getNumberOfCoordsLoadSessions();
687 void setNumberOfCoordsLoadSessions(mcIdType newNbOfCoordsLoadSessions);
688 unsigned int getCode() const;
689 void setCode(unsigned int newCode);
690 bool isCellFamilyFieldReading() const;
691 bool isNodeFamilyFieldReading() const;
692 bool isCellNameFieldReading() const;
693 bool isNodeNameFieldReading() const;
694 bool isCellNumFieldReading() const;
695 bool isNodeNumFieldReading() const;
696 bool isGlobalNodeNumFieldReading() const;
697 void setCellFamilyFieldReading(bool b);
698 void setNodeFamilyFieldReading(bool b);
699 void setCellNameFieldReading(bool b);
700 void setNodeNameFieldReading(bool b);
701 void setCellNumFieldReading(bool b);
702 void setNodeNumFieldReading(bool b);
703 void setGlobalNodeNumFieldReading(bool b);
706 std::string __str__() const
708 std::ostringstream oss;
713 std::string __repr__() const
715 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
721 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
724 static MEDFileJointCorrespondence *New();
725 static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence) // nodes
727 static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence, // cells
728 INTERP_KERNEL::NormalizedCellType loc_geo_type,
729 INTERP_KERNEL::NormalizedCellType rem_geo_type)
731 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
732 MEDFileJointCorrespondence *deepCopy() const;
733 MEDFileJointCorrespondence *shallowCpy() const;
734 void setIsNodal(bool isNodal);
735 bool getIsNodal() const;
736 bool isEqual(const MEDFileJointCorrespondence *other) const;
737 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
738 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
739 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
740 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
741 void setCorrespondence(DataArrayIdType *corr);
742 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const;
743 std::string simpleRepr() const;
746 MEDFileJointCorrespondence()
748 return MEDFileJointCorrespondence::New();
750 MEDFileJointCorrespondence(DataArrayIdType* correspondence)
752 return MEDFileJointCorrespondence::New(correspondence);
754 MEDFileJointCorrespondence(DataArrayIdType* correspondence, // cells
755 INTERP_KERNEL::NormalizedCellType loc_geo_type,
756 INTERP_KERNEL::NormalizedCellType rem_geo_type)
758 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
761 std::string __str__() const
763 return self->simpleRepr();
766 DataArrayIdType *getCorrespondence() const
768 const DataArrayIdType *ret(self->getCorrespondence());
771 return const_cast<DataArrayIdType *>(ret);
776 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
779 static MEDFileJointOneStep *New(int dt=-1, int it=-1);
780 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1);
781 MEDFileJointOneStep *deepCopy() const;
782 MEDFileJointOneStep *shallowCpy() const;
783 bool isEqual(const MEDFileJointOneStep *other) const;
784 void setOrder(int order);
785 int getOrder() const;
786 void setIteration(int it);
787 int getIteration() const;
788 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
789 void clearCorrespondences();
790 int getNumberOfCorrespondences() const;
791 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const;
792 std::string simpleRepr() const;
795 MEDFileJointOneStep()
797 return MEDFileJointOneStep::New();
800 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number)
802 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
805 std::string __str__() const
807 return self->simpleRepr();
810 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const
812 MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
818 MEDFileJointCorrespondence *__getitem__(int i) const
820 return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
825 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
828 static MEDFileJoint *New();
829 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num);
830 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum);
831 MEDFileJoint *deepCopy() const;
832 MEDFileJoint *shallowCpy() const;
833 bool isEqual(const MEDFileJoint *other) const;
834 void setLocalMeshName(const std::string& name);
835 std::string getLocalMeshName() const;
836 void setRemoteMeshName(const std::string& name);
837 std::string getRemoteMeshName() const;
838 void setDescription(const std::string& name);
839 std::string getDescription() const;
840 void setJointName(const std::string& name);
841 std::string getJointName() const;
842 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
843 void setDomainNumber(const int& number);
844 int getDomainNumber() const;
845 void pushStep(MEDFileJointOneStep* step);
846 int getNumberOfSteps() const;
847 std::string simpleRepr() const;
852 return MEDFileJoint::New();
855 MEDFileJoint(const std::string& fileName, const std::string& mName, int num)
857 return MEDFileJoint::New(fileName,mName,num);
860 MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum)
862 return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
865 std::string __str__() const
867 return self->simpleRepr();
870 MEDFileJointOneStep *getStepAtPos(int i) const
872 MEDFileJointOneStep *ret(self->getStepAtPos(i));
878 MEDFileJointOneStep *__getitem__(int i)
880 return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
885 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
888 static MEDFileJoints *New();
889 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName);
890 MEDFileJoints *deepCopy() const;
891 std::string simpleRepr() const;
892 std::string getMeshName() const;
893 int getNumberOfJoints() const;
894 std::vector<std::string> getJointsNames() const;
895 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
896 void resize(int newSize);
897 void pushJoint(MEDFileJoint *joint);
898 void setJointAtPos(int i, MEDFileJoint *joint);
899 void destroyJointAtPos(int i);
904 return MEDFileJoints::New();
907 MEDFileJoints(const std::string& fileName, const std::string& meshName)
909 return MEDFileJoints::New(fileName,meshName);
912 std::string __str__() const
914 return self->simpleRepr();
917 MEDFileJoint *__getitem__(PyObject *obj)
919 static const char msg[]="MEDFileJoints::__getitem__ : only integer or string with meshname supported !";
922 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
927 MEDFileJoint *ret(self->getJointWithName(convertPyObjectToStr(obj,msg)));
935 return self->getNumberOfJoints();
938 MEDFileJoint *getJointAtPos(int i) const
940 MEDFileJoint *ret=self->getJointAtPos(i);
946 MEDFileJoint *getJointWithName(const std::string& paramName) const
948 MEDFileJoint *ret=self->getJointWithName(paramName);
956 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
959 MEDFileEquivalenceBase();
962 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
965 MEDFileEquivalenceData();
967 void setArray(DataArrayInt32 *data);
970 DataArrayInt32 *getArray()
972 DataArrayInt32 *ret(self->getArray());
973 if(ret) ret->incrRef();
979 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
982 MEDFileEquivalenceNode();
985 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
988 MEDFileEquivalenceCell();
991 std::size_t size() const;
992 void setArray(int meshDimRelToMax, DataArrayInt32 *da);
993 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt32 *da);
996 DataArrayInt32 *getArray(INTERP_KERNEL::NormalizedCellType type)
998 DataArrayInt32 *ret(self->getArray(type));
999 if(ret) ret->incrRef();
1003 PyObject *getTypes() const
1005 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
1006 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1007 PyObject *res=PyList_New(result.size());
1008 for(int i=0;iL!=result.end(); i++, iL++)
1009 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1015 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
1018 MEDFileEquivalencePair();
1020 std::string getName() const;
1021 void setName(const std::string& name);
1022 std::string getDescription() const;
1023 void setDescription(const std::string& descr);
1024 void setArray(int meshDimRelToMaxExt, DataArrayInt32 *da);;
1027 MEDFileEquivalenceCell *initCell()
1029 MEDFileEquivalenceCell *ret(self->initCell());
1030 if(ret) ret->incrRef();
1034 MEDFileEquivalenceNode *initNode()
1036 MEDFileEquivalenceNode *ret(self->initNode());
1037 if(ret) ret->incrRef();
1041 MEDFileEquivalenceCell *getCell()
1043 MEDFileEquivalenceCell *ret(self->getCell());
1044 if(ret) ret->incrRef();
1048 MEDFileEquivalenceNode *getNode()
1050 MEDFileEquivalenceNode *ret(self->getNode());
1051 if(ret) ret->incrRef();
1057 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
1060 MEDFileEquivalences();
1063 std::vector<std::string> getEquivalenceNames() const;
1064 void killEquivalenceWithName(const std::string& name);
1065 void killEquivalenceAt(int i);
1069 MEDFileEquivalencePair *getEquivalence(int i)
1071 MEDFileEquivalencePair *ret(self->getEquivalence(i));
1072 if(ret) ret->incrRef();
1075 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name)
1077 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
1078 if(ret) ret->incrRef();
1082 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name)
1084 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
1085 if(ret) ret->incrRef();
1091 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
1094 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1095 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1096 static MEDFileMesh *New(DataArrayByte *db);
1097 virtual MEDFileMesh *createNewEmpty() const;
1098 virtual MEDFileMesh *deepCopy() const;
1099 virtual MEDFileMesh *shallowCpy() const;
1100 virtual void clearNonDiscrAttributes() const;
1101 void setName(const std::string& name);
1102 std::string getName();
1103 std::string getUnivName() const;
1104 bool getUnivNameWrStatus() const;
1105 void setUnivNameWrStatus(bool newStatus);
1106 void setDescription(const std::string& name);
1107 std::string getDescription() const;
1108 void setOrder(int order);
1109 int getOrder() const;
1110 void setIteration(int it);
1112 void setTimeValue(double time);
1113 void setTime(int dt, int it, double time);
1114 double getTimeValue() const;
1115 void setTimeUnit(const std::string& unit);
1116 std::string getTimeUnit() const;
1117 void setAxisType(MEDCouplingAxisType at);
1118 MEDCouplingAxisType getAxisType() const;
1119 virtual int getNumberOfNodes() const;
1120 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const;
1121 virtual bool hasImplicitPart() const;
1122 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const;
1123 virtual void releaseImplicitPartIfAny() const;
1124 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const;
1125 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const;
1126 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const;
1127 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const;
1128 virtual std::vector<mcIdType> getDistributionOfTypes(int meshDimRelToMax) const;
1129 virtual MEDFileMesh *cartesianize() const;
1130 std::vector<int> getNonEmptyLevels() const;
1131 std::vector<int> getNonEmptyLevelsExt() const;
1132 int getSizeAtLevel(int meshDimRelToMaxExt) const;
1134 bool existsGroup(const std::string& groupName) const;
1135 bool existsFamily(int famId) const;
1136 bool existsFamily(const std::string& familyName) const;
1137 void setFamilyId(const std::string& familyName, int id);
1138 void setFamilyIdUnique(const std::string& familyName, int id);
1139 void addFamily(const std::string& familyName, int id);
1140 void addFamilyOnGrp(const std::string& grpName, const std::string& famName);
1141 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName);
1142 virtual bool keepFamIdsOnlyOnLevs(const std::vector<mcIdType>& famIds, const std::vector<int>& levs);
1143 void copyFamGrpMapsFrom(const MEDFileMesh& other);
1146 void clearFamGrpMaps();
1147 const std::map<std::string,int>& getFamilyInfo() const;
1148 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const;
1149 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const;
1150 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const;
1151 std::vector<mcIdType> getFamiliesIdsOnGroup(const std::string& name) const;
1152 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams);
1153 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<mcIdType>& famIds);
1154 std::vector<std::string> getGroupsOnFamily(const std::string& name) const;
1155 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps);
1156 std::vector<std::string> getGroupsNames() const;
1157 std::vector<std::string> getFamiliesNames() const;
1158 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
1159 std::vector<mcIdType> getGrpNonEmptyLevelsExt(const std::string& grp) const;
1160 std::vector<mcIdType> getGrpNonEmptyLevels(const std::string& grp) const;
1161 std::vector<mcIdType> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
1162 std::vector<mcIdType> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
1163 std::vector<mcIdType> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
1164 std::vector<mcIdType> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
1165 std::vector<mcIdType> getFamNonEmptyLevels(const std::string& fam) const;
1166 std::vector<mcIdType> getFamNonEmptyLevelsExt(const std::string& fam) const;
1167 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const;
1168 static std::string GetMagicFamilyStr();
1169 void assignFamilyNameWithGroupName();
1170 std::vector<std::string> removeEmptyGroups();
1171 void removeGroupAtLevel(int meshDimRelToMaxExt, const std::string& name);
1172 void removeGroup(const std::string& name);
1173 void removeFamily(const std::string& name);
1174 std::vector<std::string> removeOrphanGroups();
1175 std::vector<std::string> removeOrphanFamilies();
1176 void removeFamiliesReferedByNoGroups();
1177 void rearrangeFamilies();
1179 void checkOrphanFamilyZero() const;
1180 void changeGroupName(const std::string& oldName, const std::string& newName);
1181 void changeFamilyName(const std::string& oldName, const std::string& newName);
1182 void changeFamilyId(int oldId, int newId);
1183 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames);
1184 void setFamilyInfo(const std::map<std::string,mcIdType>& info);
1185 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1186 int getFamilyId(const std::string& name) const;
1187 int getMaxAbsFamilyId() const;
1188 int getMaxFamilyId() const;
1189 int getMinFamilyId() const;
1190 int getTheMaxAbsFamilyId() const;
1191 int getTheMaxFamilyId() const;
1192 int getTheMinFamilyId() const;
1193 virtual int getMaxAbsFamilyIdInArrays() const;
1194 virtual int getMaxFamilyIdInArrays() const;
1195 virtual int getMinFamilyIdInArrays() const;
1196 DataArrayIdType *getAllFamiliesIdsReferenced() const;
1197 DataArrayIdType *computeAllFamilyIdsInUse() const;
1198 std::vector<mcIdType> getFamiliesIds(const std::vector<std::string>& famNames) const;
1199 std::string getFamilyNameGivenId(int id) const;
1200 bool ensureDifferentFamIdsPerLevel();
1201 void normalizeFamIdsTrio();
1202 void normalizeFamIdsMEDFile();
1203 virtual int getMeshDimension() const;
1204 virtual std::string simpleRepr() const;
1205 virtual std::string advancedRepr() const;
1207 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const;
1208 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayIdType *famArr);
1209 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayIdType *renumArr);
1210 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr);
1211 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayIdType *globalNumArr);
1212 virtual void addNodeGroup(const DataArrayIdType *ids);
1213 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayIdType *ids);
1214 virtual DataArrayIdType *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1215 virtual DataArrayIdType *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1216 virtual DataArrayIdType *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1217 virtual DataArrayIdType *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1218 virtual DataArrayIdType *getNodeGroupArr(const std::string& grp, bool renum=false) const;
1219 virtual DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1220 virtual DataArrayIdType *getNodeFamilyArr(const std::string& fam, bool renum=false) const;
1221 virtual DataArrayIdType *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const;
1222 int getNumberOfJoints();
1223 MEDFileJoints *getJoints();
1224 void setJoints( MEDFileJoints* joints );
1225 void initializeEquivalences();
1226 void killEquivalences();
1227 bool presenceOfStructureElements() const;
1228 void killStructureElements();
1231 std::string __str__() const
1233 return self->simpleRepr();
1236 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const
1238 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1241 static INTERP_KERNEL::NormalizedCellType ConvertFromMEDFileGeoType(int geoType)
1243 med_geometry_type geoType2((med_geometry_type) geoType);
1244 return MEDFileMesh::ConvertFromMEDFileGeoType(geoType2);
1247 static int ConvertToMEDFileGeoType(INTERP_KERNEL::NormalizedCellType geoType)
1249 return (int) MEDFileMesh::ConvertToMEDFileGeoType(geoType);
1255 double tmp0=self->getTime(tmp1,tmp2);
1256 PyObject *res = PyList_New(3);
1257 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1258 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1259 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1263 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const
1266 bool ret0=self->isEqual(other,eps,what);
1267 PyObject *res=PyList_New(2);
1268 PyObject *ret0Py=ret0?Py_True:Py_False;
1270 PyList_SetItem(res,0,ret0Py);
1271 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1275 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false)
1277 std::vector<const DataArrayIdType *> grps;
1278 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grps);
1279 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1282 void addGroupsAtLevel(int meshDimRelToMaxExt, PyObject *grps)
1284 std::vector<const DataArrayIdType *> grpsCpp;
1285 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(grps,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grpsCpp);
1286 self->addGroupsAtLevel(meshDimRelToMaxExt,grpsCpp);
1289 PyObject *areFamsEqual(const MEDFileMesh *other) const
1292 bool ret0=self->areFamsEqual(other,what);
1293 PyObject *res=PyList_New(2);
1294 PyObject *ret0Py=ret0?Py_True:Py_False;
1296 PyList_SetItem(res,0,ret0Py);
1297 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1301 PyObject *areGrpsEqual(const MEDFileMesh *other) const
1304 bool ret0=self->areGrpsEqual(other,what);
1305 PyObject *res=PyList_New(2);
1306 PyObject *ret0Py=ret0?Py_True:Py_False;
1308 PyList_SetItem(res,0,ret0Py);
1309 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1313 PyObject *getAllGeoTypes() const
1315 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1316 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1317 PyObject *res=PyList_New(result.size());
1318 for(int i=0;iL!=result.end(); i++, iL++)
1319 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1323 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const
1325 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1326 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1327 PyObject *res=PyList_New(result.size());
1328 for(int i=0;iL!=result.end(); i++, iL++)
1329 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1333 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const
1335 const DataArrayIdType *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1338 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1341 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt)
1343 const DataArrayIdType *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1346 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1349 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const
1351 const DataArrayIdType *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1354 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1357 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const
1359 const DataArrayIdType *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1362 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1365 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const
1367 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1370 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1373 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created)
1376 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1377 PyObject *ret=PyTuple_New(2);
1378 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1379 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1383 PyObject *unPolyze()
1385 DataArrayIdType *ret3=0;
1386 std::vector<mcIdType> ret1,ret2;
1387 bool ret0=self->unPolyze(ret1,ret2,ret3);
1388 PyObject *ret=PyTuple_New(4);
1389 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1391 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1392 for(int j=0;j<(int)ret1.size()/3;j++)
1394 PyObject *retLev2=PyList_New(3);
1395 PyList_SetItem(retLev2,0,PyInt_FromLong(ret1[3*j]));
1396 PyList_SetItem(retLev2,1,PyInt_FromLong(ret1[3*j+1]));
1397 PyList_SetItem(retLev2,2,PyInt_FromLong(ret1[3*j+2]));
1398 PyList_SetItem(retLev1_0,j,retLev2);
1400 PyTuple_SetItem(ret,1,retLev1_0);
1402 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1403 for(int j=0;j<(int)ret2.size()/3;j++)
1405 PyObject *retLev2=PyList_New(3);
1406 PyList_SetItem(retLev2,0,PyInt_FromLong(ret2[3*j]));
1407 PyList_SetItem(retLev2,1,PyInt_FromLong(ret2[3*j+1]));
1408 PyList_SetItem(retLev2,2,PyInt_FromLong(ret2[3*j+2]));
1409 PyList_SetItem(retLev1_1,j,retLev2);
1411 PyTuple_SetItem(ret,2,retLev1_1);
1413 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1417 MEDFileEquivalences *getEquivalences()
1419 MEDFileEquivalences *ret(self->getEquivalences());
1420 if(ret) ret->incrRef();
1424 virtual DataArrayIdType *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const
1426 MCAuto<DataArrayIdType> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1432 class MEDFileUMesh : public MEDFileMesh
1435 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1436 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1437 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem);
1438 static MEDFileUMesh *New(DataArrayByte *db);
1439 static MEDFileUMesh *New();
1440 static const char *GetSpeStr4ExtMesh();
1442 int getSpaceDimension() const;
1443 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1444 void checkConsistency() const;
1445 void checkSMESHConsistency() const;
1446 void clearNodeAndCellNumbers();
1448 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1449 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1450 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1451 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1452 DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1453 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const;
1454 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const;
1455 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const;
1456 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const;
1457 void declarePartsUpdated() const;
1458 void forceComputationOfParts() const;
1459 void computeRevNum() const;
1461 void setFamilyNameAttachedOnId(int id, const std::string& newFamName);
1462 void setCoords(DataArrayDouble *coords);
1463 void setCoordsForced(DataArrayDouble *coords);
1464 void eraseGroupsAtLevel(int meshDimRelToMaxExt);
1465 void removeMeshAtLevel(int meshDimRelToMax);
1466 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m);
1467 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false);
1468 void optimizeFamilies();
1469 DataArrayIdType *computeFetchedNodeIds() const;
1470 DataArrayIdType *zipCoords();
1471 DataArrayIdType *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1472 DataArrayIdType *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1473 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const;
1474 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const;
1475 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const;
1476 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const;
1479 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1481 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1484 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1486 return MEDFileUMesh::New(fileName,mrs);
1489 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem)
1491 return MEDFileUMesh::New(mem);
1494 MEDFileUMesh(DataArrayByte *db)
1496 return MEDFileUMesh::New(db);
1501 return MEDFileUMesh::New();
1504 static MEDFileUMesh *LoadConnectivityOnlyPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<mcIdType>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1506 std::vector<int> typesCpp1;
1507 convertPyToNewIntArr3(types,typesCpp1);
1508 std::size_t sz(typesCpp1.size());
1509 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1510 for(std::size_t ii=0;ii<sz;ii++)
1511 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1512 return MEDFileUMesh::LoadConnectivityOnlyPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs).retn();
1515 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)
1517 std::vector<int> typesCpp1;
1518 convertPyToNewIntArr3(types,typesCpp1);
1519 std::size_t sz(typesCpp1.size());
1520 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1521 for(std::size_t ii=0;ii<sz;ii++)
1522 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1523 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1526 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)
1528 MCAuto<DataArrayDouble> coords;
1529 MCAuto<PartDefinition> partCoords;
1530 MCAuto<DataArrayIdType> famCoords,numCoords;
1531 MCAuto<DataArrayAsciiChar> nameCoord;
1532 MEDFileUMesh::LoadPartCoords(fileName,mName,dt,it,infosOnComp,startNodeId,stopNodeId,coords,partCoords,famCoords,numCoords,nameCoord);
1533 PyObject *ret(PyTuple_New(5));
1534 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1535 PyTuple_SetItem(ret,1,convertPartDefinition(partCoords.retn(),SWIG_POINTER_OWN | 0));
1536 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(famCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1537 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(numCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1538 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(nameCoord.retn()),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 ));
1542 PyObject *__getstate__()
1544 std::vector<double> a0;
1545 std::vector<mcIdType> a1;
1546 std::vector<std::string> a2;
1547 std::vector< MCAuto<DataArrayIdType> > a3;
1548 MCAuto<DataArrayDouble> a4;
1549 self->serialize(a0,a1,a2,a3,a4);
1550 PyObject *ret(PyTuple_New(5));
1551 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1552 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1553 std::size_t sz(a2.size());
1554 PyObject *ret2(PyList_New(sz));
1555 for(std::size_t i=0;i<sz;i++)
1556 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1557 PyTuple_SetItem(ret,2,ret2);
1559 PyObject *ret3(PyList_New(sz));
1560 for(std::size_t i=0;i<sz;i++)
1562 DataArrayIdType *elt(a3[i]);
1565 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1567 PyTuple_SetItem(ret,3,ret3);
1568 DataArrayDouble *ret4(a4);
1571 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1575 void __setstate__(PyObject *inp)
1577 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1578 if(!PyTuple_Check(inp))
1579 throw INTERP_KERNEL::Exception(MSG);
1580 std::size_t sz(PyTuple_Size(inp));
1582 throw INTERP_KERNEL::Exception(MSG);
1583 std::vector<double> a0;
1584 std::vector<mcIdType> a1;
1585 std::vector<std::string> a2;
1586 std::vector< MCAuto<DataArrayIdType> > a3;
1587 MCAuto<DataArrayDouble> a4;
1589 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1591 fillArrayWithPyListDbl3(a0py,tmp,a0);
1592 convertPyToNewIntArr3(a1py,a1);
1593 fillStringVector(a2py,a2);
1595 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1597 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1598 if(!SWIG_IsOK(status))
1599 throw INTERP_KERNEL::Exception(MSG);
1600 a4=reinterpret_cast<DataArrayDouble *>(argp);
1601 if((DataArrayDouble *)a4)
1604 std::vector< DataArrayIdType * > a3Tmp;
1605 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayIdType *>(b0py,SWIGTITraits<mcIdType>::TI,"DataArrayInt",a3Tmp);
1606 std::size_t sz(a3Tmp.size());
1608 for(std::size_t i=0;i<sz;i++)
1612 a3Tmp[i]->incrRef();
1614 self->unserialize(a0,a1,a2,a3,a4);
1618 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh)
1621 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1622 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1625 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1628 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1631 self->setMeshAtLevel(meshDimRelToMax,m1);
1634 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1637 void __delitem__(int meshDimRelToMax)
1639 self->removeMeshAtLevel(meshDimRelToMax);
1642 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const
1644 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1646 DataArrayDouble *a,*a2;
1647 DataArrayDoubleTuple *aa,*aa2;
1648 std::vector<double> bb,bb2;
1650 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1651 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1652 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1656 static MEDFileUMesh *Aggregate(PyObject *meshes)
1658 std::vector<const MEDFileUMesh *> meshesCpp;
1659 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1660 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1664 PyObject *getAllDistributionOfTypes() const
1666 std::vector< std::pair<int,mcIdType> > ret(self->getAllDistributionOfTypes());
1667 return convertVecPairIntToPy(ret);
1670 DataArrayIdType *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const
1672 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1673 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1674 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1677 MEDFileUMesh *extractPart(PyObject *extractDef) const
1679 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1680 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1681 return self->extractPart(extractDefCpp);
1684 void setMeshes(PyObject *li, bool renum=false)
1686 std::vector<const MEDCouplingUMesh *> ms;
1687 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1688 self->setMeshes(ms,renum);
1691 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false)
1693 std::vector<const MEDCouplingUMesh *> ms;
1694 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1695 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1698 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false)
1700 std::vector<const MEDCouplingUMesh *> ms;
1701 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1702 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1705 DataArrayDouble *getCoords() const
1707 DataArrayDouble *ret=self->getCoords();
1713 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const
1715 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1718 return const_cast<PartDefinition *>(ret);
1721 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1)
1723 DataArrayIdType *ret0=0,*ret1=0,*ret2=0;
1724 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1725 PyObject *ret=PyTuple_New(3);
1726 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1727 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1728 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1732 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const
1734 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1740 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const
1742 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1743 std::size_t sz(tmp.size());
1744 PyObject *ret=PyList_New(sz);
1745 for(std::size_t i=0;i<sz;i++)
1749 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1756 class MEDFileStructuredMesh : public MEDFileMesh
1761 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const
1763 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1771 class MEDFileCMesh : public MEDFileStructuredMesh
1774 static MEDFileCMesh *New();
1775 static MEDFileCMesh *New(DataArrayByte *db);
1776 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1777 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1778 void setMesh(MEDCouplingCMesh *m);
1779 int getSpaceDimension() const;
1784 return MEDFileCMesh::New();
1787 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1789 return MEDFileCMesh::New(fileName,mrs);
1792 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1794 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1797 MEDFileCMesh(DataArrayByte *db)
1799 return MEDFileCMesh::New(db);
1802 PyObject *getMesh() const
1804 const MEDCouplingCMesh *tmp=self->getMesh();
1807 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1812 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1815 static MEDFileCurveLinearMesh *New();
1816 static MEDFileCurveLinearMesh *New(DataArrayByte *db);
1817 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1818 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1819 void setMesh(MEDCouplingCurveLinearMesh *m);
1820 int getSpaceDimension() const;
1821 int getMeshDimension() const;
1824 MEDFileCurveLinearMesh()
1826 return MEDFileCurveLinearMesh::New();
1829 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1831 return MEDFileCurveLinearMesh::New(fileName,mrs);
1834 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1836 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1839 MEDFileCurveLinearMesh(DataArrayByte *db)
1841 return MEDFileCurveLinearMesh::New(db);
1844 PyObject *getMesh() const
1846 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1849 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1854 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1857 static MEDFileMeshMultiTS *New();
1858 static MEDFileMeshMultiTS *New(const std::string& fileName);
1859 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName);
1860 MEDFileMeshMultiTS *deepCopy() const;
1861 std::string getName() const;
1862 void setOneTimeStep(MEDFileMesh *mesh1TimeStep);
1863 void cartesianizeMe();
1866 MEDFileMeshMultiTS()
1868 return MEDFileMeshMultiTS::New();
1871 MEDFileMeshMultiTS(const std::string& fileName)
1873 return MEDFileMeshMultiTS::New(fileName);
1876 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName)
1878 return MEDFileMeshMultiTS::New(fileName,mName);
1881 MEDFileMesh *getOneTimeStep() const
1883 MEDFileMesh *ret=self->getOneTimeStep();
1891 class MEDFileMeshesIterator
1898 MEDFileMesh *ret=self->nextt();
1902 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1906 PyErr_SetString(PyExc_StopIteration,"No more data.");
1913 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1916 static MEDFileMeshes *New();
1917 static MEDFileMeshes *New(DataArrayByte *db);
1918 MEDFileMeshes *deepCopy() const;
1919 int getNumberOfMeshes() const;
1920 std::vector<std::string> getMeshesNames() const;
1922 void resize(int newSize);
1923 void pushMesh(MEDFileMesh *mesh);
1924 void setMeshAtPos(int i, MEDFileMesh *mesh);
1925 void destroyMeshAtPos(int i);
1926 void cartesianizeMe();
1927 bool presenceOfStructureElements() const;
1928 void killStructureElements();
1933 return MEDFileMeshes::New();
1936 MEDFileMeshes(const std::string& fileName)
1938 return MEDFileMeshes::New(fileName);
1941 MEDFileMeshes(DataArrayByte *db)
1943 return MEDFileMeshes::New(db);
1946 std::string __str__() const
1948 return self->simpleRepr();
1951 MEDFileMesh *__getitem__(PyObject *obj)
1953 static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
1954 if(PyInt_Check(obj))
1956 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1961 MEDFileMesh *ret(self->getMeshWithName(convertPyObjectToStr(obj,msg)));
1967 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh)
1969 self->setMeshAtPos(obj,mesh);
1973 MEDFileMeshesIterator *__iter__()
1975 return self->iterator();
1980 return self->getNumberOfMeshes();
1983 MEDFileMesh *getMeshAtPos(int i) const
1985 MEDFileMesh *ret=self->getMeshAtPos(i);
1990 MEDFileMesh *getMeshWithName(const std::string& mname) const
1992 MEDFileMesh *ret=self->getMeshWithName(mname);
2000 class MEDFileFieldLoc : public RefCountObject
2003 std::string getName() const;
2004 int getDimension() const;
2005 int getNumberOfGaussPoints() const;
2006 int getNumberOfPointsInCells() const;
2007 const std::vector<double>& getRefCoords() const;
2008 const std::vector<double>& getGaussCoords() const;
2009 const std::vector<double>& getGaussWeights() const;
2010 bool isEqual(const MEDFileFieldLoc& other, double eps) const;
2013 std::string __str__() const
2015 return self->repr();
2020 class MEDFileFieldGlobsReal
2023 void resetContent();
2024 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
2025 void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
2026 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2027 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2028 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
2029 void checkGlobsCoherency() const;
2030 void checkGlobsPflsPartCoherency() const;
2031 void checkGlobsLocsPartCoherency() const;
2032 std::vector<std::string> getPfls() const;
2033 std::vector<std::string> getLocs() const;
2034 bool existsPfl(const std::string& pflName) const;
2035 bool existsLoc(const std::string& locName) const;
2036 std::string createNewNameOfPfl() const;
2037 std::string createNewNameOfLoc() const;
2038 std::vector< std::vector<int> > whichAreEqualProfiles() const;
2039 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
2040 virtual std::vector<std::string> getPflsReallyUsed() const;
2041 virtual std::vector<std::string> getLocsReallyUsed() const;
2042 virtual std::vector<std::string> getPflsReallyUsedMulti() const;
2043 virtual std::vector<std::string> getLocsReallyUsedMulti() const;
2044 void killProfileIds(const std::vector<int>& pflIds);
2045 void killLocalizationIds(const std::vector<int>& locIds);
2046 void changePflName(const std::string& oldName, const std::string& newName);
2047 void changeLocName(const std::string& oldName, const std::string& newName);
2048 int getNbOfGaussPtPerCell(int locId) const;
2049 int getLocalizationId(const std::string& loc) const;
2050 int getProfileId(const std::string& pfl) const;
2051 void killStructureElementsInGlobs();
2054 PyObject *getProfile(const std::string& pflName) const
2056 const DataArrayIdType *ret=self->getProfile(pflName);
2059 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2062 PyObject *getProfileFromId(int pflId) const
2064 const DataArrayIdType *ret=self->getProfileFromId(pflId);
2067 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2070 PyObject *getLocalizationFromId(int locId) const
2072 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
2075 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2078 PyObject *getLocalization(const std::string& locName) const
2080 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
2083 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2086 PyObject *zipPflsNames()
2088 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
2089 return convertVecPairVecStToPy(ret);
2092 PyObject *zipLocsNames(double eps)
2094 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
2095 return convertVecPairVecStToPy(ret);
2098 void changePflsNames(PyObject *li)
2100 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2101 self->changePflsNames(v);
2104 void changePflsRefsNamesGen(PyObject *li)
2106 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2107 self->changePflsRefsNamesGen(v);
2110 void changePflsNamesInStruct(PyObject *li)
2112 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2113 self->changePflsNamesInStruct(v);
2116 void changeLocsNames(PyObject *li)
2118 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2119 self->changeLocsNames(v);
2122 void changeLocsRefsNamesGen(PyObject *li)
2124 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2125 self->changeLocsRefsNamesGen(v);
2128 void changeLocsNamesInStruct(PyObject *li)
2130 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2131 self->changeLocsNamesInStruct(v);
2134 std::string simpleReprGlobs() const
2136 std::ostringstream oss;
2137 self->simpleReprGlobs(oss);
2143 class MEDFileEntities
2148 static MEDFileEntities *BuildFrom(PyObject *entities)
2150 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2151 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2153 std::size_t sz(inp0.size());
2155 for(std::size_t i=0;i<sz;i++)
2156 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2158 return MEDFileEntities::BuildFrom(&inp);
2165 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2168 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
2169 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2170 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2171 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
2173 void loadArraysIfNecessary();
2174 void unloadArrays();
2175 void unloadArraysWithoutDataLoss();
2176 int getDimension() const;
2177 int getIteration() const;
2178 int getOrder() const;
2179 std::string getName();
2180 void setName(const std::string& name);
2181 std::string getMeshName();
2182 void setMeshName(const std::string& newMeshName);
2183 int getMeshIteration() const;
2184 int getMeshOrder() const;
2185 int getNumberOfComponents() const;
2186 bool isDealingTS(int iteration, int order) const;
2187 void setInfo(const std::vector<std::string>& infos);
2188 const std::vector<std::string>& getInfo() const;
2189 bool presenceOfMultiDiscPerGeoType() const;
2190 void setTime(int iteration, int order, double val);
2191 virtual MEDFileAnyTypeField1TS *shallowCpy() const;
2192 MEDFileAnyTypeField1TS *deepCopy() const;
2193 std::string getDtUnit() const;
2194 void setDtUnit(const std::string& dtUnit);
2200 double tmp0=self->getTime(tmp1,tmp2);
2201 PyObject *res = PyList_New(3);
2202 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2203 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2204 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2208 PyObject *getDtIt() const
2210 std::pair<int,int> res=self->getDtIt();
2211 PyObject *elt=PyTuple_New(2);
2212 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2213 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2217 MEDFileAnyTypeField1TS *buildNewEmpty() const
2219 MCAuto<MEDFileAnyTypeField1TS> ret = self->buildNewEmpty();
2223 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false)
2225 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2228 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false)
2230 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2233 bool changeMeshNames(PyObject *li)
2235 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2236 return self->changeMeshNames(modifTab);
2239 PyObject *getTypesOfFieldAvailable() const
2241 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2242 PyObject *ret2=PyList_New(ret.size());
2243 for(int i=0;i<(int)ret.size();i++)
2244 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2248 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const
2250 std::vector<int> ret1;
2251 int ret0=self->getNonEmptyLevels(mname,ret1);
2252 PyObject *elt=PyTuple_New(2);
2253 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2254 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2258 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const
2260 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2261 std::vector< std::vector<TypeOfField> > typesF;
2262 std::vector< std::vector<std::string> > pfls;
2263 std::vector< std::vector<std::string> > locs;
2264 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2265 std::size_t sz=ret.size();
2266 PyObject *ret2=PyList_New(sz);
2267 for(std::size_t i=0;i<sz;i++)
2269 const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2270 const std::vector<TypeOfField>& typesFI=typesF[i];
2271 const std::vector<std::string>& pflsI=pfls[i];
2272 const std::vector<std::string>& locsI=locs[i];
2273 PyObject *elt=PyTuple_New(2);
2274 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2275 std::size_t sz2=ret[i].size();
2276 PyObject *elt2=PyList_New(sz2);
2277 for(std::size_t j=0;j<sz2;j++)
2279 PyObject *elt3=PyTuple_New(4);
2280 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2281 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2282 PyTuple_SetItem(elt3,1,elt4);
2283 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2284 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2285 PyList_SetItem(elt2,j,elt3);
2287 PyTuple_SetItem(elt,1,elt2);
2288 PyList_SetItem(ret2,i,elt);
2293 PyObject *splitComponents() const
2295 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2296 std::size_t sz=ret.size();
2297 PyObject *retPy=PyList_New(sz);
2298 for(std::size_t i=0;i<sz;i++)
2299 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2303 PyObject *splitDiscretizations() const
2305 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2306 std::size_t sz=ret.size();
2307 PyObject *retPy=PyList_New(sz);
2308 for(std::size_t i=0;i<sz;i++)
2309 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2313 PyObject *splitMultiDiscrPerGeoTypes() const
2315 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2316 std::size_t sz=ret.size();
2317 PyObject *retPy=PyList_New(sz);
2318 for(std::size_t i=0;i<sz;i++)
2319 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2323 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2325 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2326 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2327 return self->extractPart(extractDefCpp,mm);
2332 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2335 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2336 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2337 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
2338 static MEDFileField1TS *New(DataArrayByte *db);
2339 static MEDFileField1TS *New();
2340 MEDCoupling::MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const;
2341 MEDCoupling::MEDFileInt64Field1TS *convertToInt64(bool isDeepCpyGlobs=true) const;
2342 void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf);
2343 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
2344 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2345 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2346 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2347 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2348 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2350 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
2351 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2352 void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2353 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
2354 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
2357 MEDFileField1TS(const std::string& fileName, bool loadAll=true)
2359 return MEDFileField1TS::New(fileName,loadAll);
2362 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2364 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2367 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2369 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2372 MEDFileField1TS(DataArrayByte *db)
2374 return MEDFileField1TS::New(db);
2379 return MEDFileField1TS::New();
2382 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field)
2384 const DataArrayDouble *arr=0;
2386 arr=field->getArray();
2387 self->copyTinyInfoFrom(field,arr);
2390 std::string __str__() const
2392 return self->simpleRepr();
2395 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2397 return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
2400 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const
2402 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2403 std::vector< std::vector<TypeOfField> > typesF;
2404 std::vector< std::vector<std::string> > pfls;
2405 std::vector< std::vector<std::string> > locs;
2406 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2407 std::size_t sz=ret.size();
2408 PyObject *ret2=PyList_New(sz);
2409 for(std::size_t i=0;i<sz;i++)
2411 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2412 const std::vector<TypeOfField>& typesFI=typesF[i];
2413 const std::vector<std::string>& pflsI=pfls[i];
2414 const std::vector<std::string>& locsI=locs[i];
2415 PyObject *elt=PyTuple_New(2);
2416 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2417 std::size_t sz2=ret[i].size();
2418 PyObject *elt2=PyList_New(sz2);
2419 for(std::size_t j=0;j<sz2;j++)
2421 PyObject *elt3=PyTuple_New(4);
2422 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2423 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2424 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2425 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2426 PyList_SetItem(elt2,j,elt3);
2428 PyTuple_SetItem(elt,1,elt2);
2429 PyList_SetItem(ret2,i,elt);
2434 DataArrayDouble *getUndergroundDataArray() const
2436 DataArrayDouble *ret=self->getUndergroundDataArray();
2442 PyObject *getUndergroundDataArrayExt() const
2444 return MEDFileField1TS_getUndergroundDataArrayExt<double>(self);
2449 class MEDFileInt32Field1TS : public MEDFileAnyTypeField1TS
2452 static MEDFileInt32Field1TS *New();
2453 static MEDFileInt32Field1TS *New(const std::string& fileName, bool loadAll=true);
2454 static MEDFileInt32Field1TS *New(DataArrayByte *db);
2455 static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2456 static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2457 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2459 void setFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
2460 void setFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2461 void setFieldProfileFlatly(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2462 void copyTimeInfoFrom(MEDCouplingFieldInt32 *mcf);
2463 MEDCouplingFieldInt32 *field(const MEDFileMesh *mesh) const;
2464 MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2465 MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2466 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2467 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2468 MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2471 MEDFileInt32Field1TS()
2473 return MEDFileInt32Field1TS::New();
2476 MEDFileInt32Field1TS(const std::string& fileName, bool loadAll=true)
2478 return MEDFileInt32Field1TS::New(fileName,loadAll);
2481 MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2483 return MEDFileInt32Field1TS::New(fileName,fieldName,loadAll);
2486 MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2488 return MEDFileInt32Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2491 MEDFileInt32Field1TS(DataArrayByte *db)
2493 return MEDFileInt32Field1TS::New(db);
2496 std::string __str__() const
2498 return self->simpleRepr();
2501 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2503 return MEDFileField1TS_getFieldWithProfile<Int32>(self,type,meshDimRelToMax,mesh);
2506 DataArrayInt32 *getUndergroundDataArray() const
2508 DataArrayInt32 *ret=self->getUndergroundDataArray();
2514 PyObject *getUndergroundDataArrayExt() const
2516 return MEDFileField1TS_getUndergroundDataArrayExt<Int32>(self);
2521 class MEDFileInt64Field1TS : public MEDFileAnyTypeField1TS
2524 static MEDFileInt64Field1TS *New();
2525 static MEDFileInt64Field1TS *New(const std::string& fileName, bool loadAll=true);
2526 static MEDFileInt64Field1TS *New(DataArrayByte *db);
2527 static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2528 static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2529 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2531 void setFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
2532 void setFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2533 void setFieldProfileFlatly(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2534 void copyTimeInfoFrom(MEDCouplingFieldInt64 *mcf);
2535 MEDCouplingFieldInt64 *field(const MEDFileMesh *mesh) const;
2536 MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2537 MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2538 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2539 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2540 MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2543 MEDFileInt64Field1TS()
2545 return MEDFileInt64Field1TS::New();
2548 MEDFileInt64Field1TS(const std::string& fileName, bool loadAll=true)
2550 return MEDFileInt64Field1TS::New(fileName,loadAll);
2553 MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2555 return MEDFileInt64Field1TS::New(fileName,fieldName,loadAll);
2558 MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2560 return MEDFileInt64Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2563 MEDFileInt64Field1TS(DataArrayByte *db)
2565 return MEDFileInt64Field1TS::New(db);
2568 std::string __str__() const
2570 return self->simpleRepr();
2573 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2575 return MEDFileField1TS_getFieldWithProfile<Int64>(self,type,meshDimRelToMax,mesh);
2578 DataArrayInt64 *getUndergroundDataArray() const
2580 DataArrayInt64 *ret=self->getUndergroundDataArray();
2586 PyObject *getUndergroundDataArrayExt() const
2588 return MEDFileField1TS_getUndergroundDataArrayExt<Int64>(self);
2593 class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
2596 static MEDFileFloatField1TS *New();
2597 static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true);
2598 static MEDFileFloatField1TS *New(DataArrayByte *db);
2599 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2600 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2601 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2603 void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
2604 void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2605 void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2606 void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf);
2607 MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const;
2608 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2609 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2610 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2611 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2612 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2615 MEDFileFloatField1TS()
2617 return MEDFileFloatField1TS::New();
2620 MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true)
2622 return MEDFileFloatField1TS::New(fileName,loadAll);
2625 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2627 return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
2630 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2632 return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
2635 MEDFileFloatField1TS(DataArrayByte *db)
2637 return MEDFileFloatField1TS::New(db);
2640 std::string __str__() const
2642 return self->simpleRepr();
2645 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2647 return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
2650 DataArrayFloat *getUndergroundDataArray() const
2652 DataArrayFloat *ret=self->getUndergroundDataArray();
2658 PyObject *getUndergroundDataArrayExt() const
2660 return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
2665 class MEDFileAnyTypeFieldMultiTSIterator
2672 MEDFileAnyTypeField1TS *ret=self->nextt();
2674 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2677 PyErr_SetString(PyExc_StopIteration,"No more data.");
2684 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2687 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
2688 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2689 MEDFileAnyTypeFieldMultiTS *deepCopy() const;
2690 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
2691 std::string getName() const;
2692 void setName(const std::string& name);
2693 std::string getDtUnit() const;
2694 void setDtUnit(const std::string& dtUnit);
2695 std::string getMeshName() const;
2696 void setMeshName(const std::string& newMeshName);
2697 void setInfo(const std::vector<std::string>& infos);
2698 const std::vector<std::string>& getInfo() const;
2699 bool presenceOfMultiDiscPerGeoType() const;
2700 int getNumberOfComponents() const;
2701 int getNumberOfTS() const;
2702 void eraseEmptyTS();
2703 int getPosOfTimeStep(int iteration, int order) const;
2704 int getPosGivenTime(double time, double eps=1e-8) const;
2706 void loadArraysIfNecessary();
2707 void unloadArrays();
2708 void unloadArraysWithoutDataLoss();
2710 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
2711 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
2712 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
2713 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
2714 void synchronizeNameScope();
2715 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const;
2720 return self->getNumberOfTS();
2723 int getTimeId(PyObject *elt0) const
2725 if(elt0 && PyInt_Check(elt0))
2727 int pos=(int)PyInt_AS_LONG(elt0);
2730 else if(elt0 && PyTuple_Check(elt0))
2732 if(PyTuple_Size(elt0)==2)
2734 PyObject *o0=PyTuple_GetItem(elt0,0);
2735 PyObject *o1=PyTuple_GetItem(elt0,1);
2736 if(PyInt_Check(o0) && PyInt_Check(o1))
2738 int iter=(int)PyInt_AS_LONG(o0);
2739 int order=(int)PyInt_AS_LONG(o1);
2740 return self->getPosOfTimeStep(iter,order);
2743 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 !");
2746 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 !");
2748 else if(elt0 && PyFloat_Check(elt0))
2750 double val=PyFloat_AS_DOUBLE(elt0);
2751 return self->getPosGivenTime(val);
2754 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2757 PyObject *getIterations() const
2759 std::vector< std::pair<int,int> > res(self->getIterations());
2760 return convertVecPairIntToPy(res);
2763 PyObject *getTimeSteps() const
2765 std::vector<double> ret1;
2766 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2767 std::size_t sz=ret.size();
2768 PyObject *ret2=PyList_New(sz);
2769 for(std::size_t i=0;i<sz;i++)
2771 PyObject *elt=PyTuple_New(3);
2772 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2773 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2774 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2775 PyList_SetItem(ret2,i,elt);
2780 PyObject *getTypesOfFieldAvailable() const
2782 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2783 PyObject *ret2=PyList_New(ret.size());
2784 for(int i=0;i<(int)ret.size();i++)
2786 const std::vector<TypeOfField>& rett=ret[i];
2787 PyObject *ret3=PyList_New(rett.size());
2788 for(int j=0;j<(int)rett.size();j++)
2789 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2790 PyList_SetItem(ret2,i,ret3);
2795 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const
2797 std::vector<int> ret1;
2798 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2799 PyObject *elt=PyTuple_New(2);
2800 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2801 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2805 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const
2807 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2808 std::vector< std::vector<TypeOfField> > typesF;
2809 std::vector< std::vector<std::string> > pfls;
2810 std::vector< std::vector<std::string> > locs;
2811 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2812 std::size_t sz=ret.size();
2813 PyObject *ret2=PyList_New(sz);
2814 for(std::size_t i=0;i<sz;i++)
2816 const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2817 const std::vector<TypeOfField>& typesFI=typesF[i];
2818 const std::vector<std::string>& pflsI=pfls[i];
2819 const std::vector<std::string>& locsI=locs[i];
2820 PyObject *elt=PyTuple_New(2);
2821 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2822 std::size_t sz2=ret[i].size();
2823 PyObject *elt2=PyList_New(sz2);
2824 for(std::size_t j=0;j<sz2;j++)
2826 PyObject *elt3=PyTuple_New(4);
2827 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2828 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2829 PyTuple_SetItem(elt3,1,elt4);
2830 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2831 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2832 PyList_SetItem(elt2,j,elt3);
2834 PyTuple_SetItem(elt,1,elt2);
2835 PyList_SetItem(ret2,i,elt);
2840 std::vector<int> getTimeIds(PyObject *elts) const
2842 if(PyList_Check(elts))
2844 std::size_t sz=PyList_Size(elts);
2845 std::vector<int> ret(sz);
2846 for(std::size_t i=0;i<sz;i++)
2848 PyObject *elt=PyList_GetItem(elts,i);
2849 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2855 std::vector<int> ret(1);
2856 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2861 void __delitem__(PyObject *elts)
2863 if(PySlice_Check(elts))
2865 Py_ssize_t strt=2,stp=2,step=2;
2866 GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2867 self->eraseTimeStepIds2((int)strt,(int)stp,(int)step);
2871 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2872 if(!idsToRemove.empty())
2873 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2877 void eraseTimeStepIds(PyObject *li)
2881 std::vector<int> pos2;
2882 DataArrayInt32 *pos3=0;
2883 DataArrayIntTuple *pos4=0;
2884 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2889 self->eraseTimeStepIds(&pos1,&pos1+1);
2896 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2901 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2905 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2909 MEDFileAnyTypeFieldMultiTSIterator *__iter__()
2911 return self->iterator();
2914 PyObject *__getitem__(PyObject *elt0) const
2916 if(elt0 && PyList_Check(elt0))
2918 std::size_t sz=PyList_Size(elt0);
2919 MCAuto<DataArrayInt32> da=DataArrayInt32::New(); da->alloc(sz,1);
2920 int *pt=da->getPointer();
2921 for(std::size_t i=0;i<sz;i++,pt++)
2923 PyObject *elt1=PyList_GetItem(elt0,i);
2924 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2926 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2928 else if(elt0 && PySlice_Check(elt0))
2930 Py_ssize_t strt=2,stp=2,step=2;
2931 GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2932 return convertMEDFileFieldMultiTS(self->buildSubPartSlice((int)strt,(int)stp,(int)step),SWIG_POINTER_OWN | 0);
2935 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2938 bool changeMeshNames(PyObject *li)
2940 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2941 return self->changeMeshNames(modifTab);
2944 PyObject *splitComponents() const
2946 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2947 std::size_t sz=ret.size();
2948 PyObject *retPy=PyList_New(sz);
2949 for(std::size_t i=0;i<sz;i++)
2950 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2954 PyObject *splitDiscretizations() const
2956 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2957 std::size_t sz=ret.size();
2958 PyObject *retPy=PyList_New(sz);
2959 for(std::size_t i=0;i<sz;i++)
2960 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2964 PyObject *splitMultiDiscrPerGeoTypes() const
2966 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2967 std::size_t sz=ret.size();
2968 PyObject *retPy=PyList_New(sz);
2969 for(std::size_t i=0;i<sz;i++)
2970 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2974 void pushBackTimeSteps(PyObject *li)
2977 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2978 if(SWIG_IsOK(status))
2980 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2984 std::vector<MEDFileAnyTypeField1TS *> tmp;
2985 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2986 self->pushBackTimeSteps(tmp);
2990 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2992 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2993 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2994 return self->extractPart(extractDefCpp,mm);
2997 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li)
2999 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
3000 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
3001 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
3002 std::size_t sz=ret.size();
3003 PyObject *retPy=PyList_New(sz);
3004 for(std::size_t i=0;i<sz;i++)
3006 std::size_t sz2=ret[i].size();
3007 PyObject *ret1Py=PyList_New(sz2);
3008 for(std::size_t j=0;j<sz2;j++)
3010 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
3013 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
3015 PyList_SetItem(retPy,i,ret1Py);
3020 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh)
3022 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
3023 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
3024 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
3025 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
3026 if(ret2.size()!=ret.size())
3028 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
3029 throw INTERP_KERNEL::Exception(oss.str().c_str());
3031 std::size_t sz=ret.size();
3032 PyObject *retPy=PyList_New(sz);
3033 for(std::size_t i=0;i<sz;i++)
3035 std::size_t sz2=ret[i].size();
3036 PyObject *ret0Py=PyTuple_New(2);
3037 PyObject *ret1Py=PyList_New(sz2);
3038 for(std::size_t j=0;j<sz2;j++)
3040 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
3043 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
3045 PyTuple_SetItem(ret0Py,0,ret1Py);
3046 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
3047 PyList_SetItem(retPy,i,ret0Py);
3054 class MEDFileInt32FieldMultiTS;
3055 class MEDFileInt64FieldMultiTS;
3057 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3060 static MEDFileFieldMultiTS *New();
3061 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3062 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3063 static MEDFileFieldMultiTS *New(DataArrayByte *db);
3065 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
3066 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3067 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3068 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3069 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3070 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3072 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
3073 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3074 MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
3077 static MEDFileAnyTypeFieldMultiTS *Aggregate(PyObject *fmtssPy, PyObject *dtsPy)
3079 std::vector<const MEDFileAnyTypeFieldMultiTS *> fmtss;
3080 convertFromPyObjVectorOfObj<const MEDFileAnyTypeFieldMultiTS *>(fmtssPy,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",fmtss);
3081 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > dts2;
3082 convertPyToVectorVectorPairInt(dtsPy,dts2);
3083 std::vector< std::vector< std::pair<int,mcIdType> > > dts(MEDVectorVectorMIIterator(0,dts2),MEDVectorVectorMIIterator(dts2.size(),dts2));
3084 MCAuto<MEDFileAnyTypeFieldMultiTS> ret = MEDFileFieldMultiTS::Aggregate(fmtss,dts);
3088 MEDFileFieldMultiTS()
3090 return MEDFileFieldMultiTS::New();
3093 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true)
3095 return MEDFileFieldMultiTS::New(fileName,loadAll);
3098 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3100 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
3103 MEDFileFieldMultiTS(DataArrayByte *db)
3105 return MEDFileFieldMultiTS::New(db);
3108 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3110 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3111 std::size_t sz(tmp.size());
3112 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3113 for(std::size_t i=0;i<sz;i++)
3115 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3116 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3118 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3121 std::string __str__() const
3123 return self->simpleRepr();
3126 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3128 DataArrayIdType *ret1=0;
3129 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3130 PyObject *ret=PyTuple_New(2);
3131 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3132 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3136 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const
3138 std::vector<INTERP_KERNEL::NormalizedCellType> types;
3139 std::vector< std::vector<TypeOfField> > typesF;
3140 std::vector< std::vector<std::string> > pfls;
3141 std::vector< std::vector<std::string> > locs;
3142 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
3143 std::size_t sz=ret.size();
3144 PyObject *ret2=PyList_New(sz);
3145 for(std::size_t i=0;i<sz;i++)
3147 const std::vector<DataArrayDouble *>& dadsI=ret[i];
3148 const std::vector<TypeOfField>& typesFI=typesF[i];
3149 const std::vector<std::string>& pflsI=pfls[i];
3150 const std::vector<std::string>& locsI=locs[i];
3151 PyObject *elt=PyTuple_New(2);
3152 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
3153 std::size_t sz2=ret[i].size();
3154 PyObject *elt2=PyList_New(sz2);
3155 for(std::size_t j=0;j<sz2;j++)
3157 PyObject *elt3=PyTuple_New(4);
3158 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
3159 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3160 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
3161 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
3162 PyList_SetItem(elt2,j,elt3);
3164 PyTuple_SetItem(elt,1,elt2);
3165 PyList_SetItem(ret2,i,elt);
3169 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const
3171 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
3177 PyObject *getUndergroundDataArrayExt(int iteration, int order) const
3179 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > > elt1Cpp;
3180 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
3183 PyObject *ret=PyTuple_New(2);
3184 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3185 std::size_t sz=elt1Cpp.size();
3186 PyObject *elt=PyList_New(sz);
3187 for(std::size_t i=0;i<sz;i++)
3189 PyObject *elt1=PyTuple_New(2);
3190 PyObject *elt2=PyTuple_New(2);
3191 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
3192 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
3193 PyObject *elt3=PyTuple_New(2);
3194 PyTuple_SetItem(elt3,0,PyInt_FromLong(elt1Cpp[i].second.first));
3195 PyTuple_SetItem(elt3,1,PyInt_FromLong(elt1Cpp[i].second.second));
3196 PyTuple_SetItem(elt1,0,elt2);
3197 PyTuple_SetItem(elt1,1,elt3);
3198 PyList_SetItem(elt,i,elt1);
3200 PyTuple_SetItem(ret,1,elt);
3206 class MEDFileFieldsIterator
3213 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3215 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3218 PyErr_SetString(PyExc_StopIteration,"No more data.");
3225 class MEDFileInt32FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3228 static MEDFileInt32FieldMultiTS *New();
3229 static MEDFileInt32FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3230 static MEDFileInt32FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3231 static MEDFileInt32FieldMultiTS *New(DataArrayByte *db);
3233 void appendFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
3234 void appendFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3235 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3236 MEDCouplingFieldInt32 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3237 MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3238 MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3239 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3240 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3241 MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3244 MEDFileInt32FieldMultiTS()
3246 return MEDFileInt32FieldMultiTS::New();
3249 MEDFileInt32FieldMultiTS(const std::string& fileName, bool loadAll=true)
3251 return MEDFileInt32FieldMultiTS::New(fileName,loadAll);
3254 MEDFileInt32FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3256 return MEDFileInt32FieldMultiTS::New(fileName,fieldName,loadAll);
3259 MEDFileInt32FieldMultiTS(DataArrayByte *db)
3261 return MEDFileInt32FieldMultiTS::New(db);
3264 static MEDFileInt32FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3266 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3267 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3268 return MEDFileInt32FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3271 std::string __str__() const
3273 return self->simpleRepr();
3276 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3278 DataArrayIdType *ret1=0;
3279 DataArrayInt32 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3280 PyObject *ret=PyTuple_New(2);
3281 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int32>::TI, SWIG_POINTER_OWN | 0 ));
3282 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3286 DataArrayInt32 *getUndergroundDataArray(int iteration, int order) const
3288 DataArrayInt32 *ret=self->getUndergroundDataArray(iteration,order);
3296 class MEDFileInt64FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3299 static MEDFileInt64FieldMultiTS *New();
3300 static MEDFileInt64FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3301 static MEDFileInt64FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3302 static MEDFileInt64FieldMultiTS *New(DataArrayByte *db);
3304 void appendFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
3305 void appendFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3306 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3307 MEDCouplingFieldInt64 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3308 MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3309 MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3310 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3311 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3312 MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3315 MEDFileInt64FieldMultiTS()
3317 return MEDFileInt64FieldMultiTS::New();
3320 MEDFileInt64FieldMultiTS(const std::string& fileName, bool loadAll=true)
3322 return MEDFileInt64FieldMultiTS::New(fileName,loadAll);
3325 MEDFileInt64FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3327 return MEDFileInt64FieldMultiTS::New(fileName,fieldName,loadAll);
3330 MEDFileInt64FieldMultiTS(DataArrayByte *db)
3332 return MEDFileInt64FieldMultiTS::New(db);
3335 static MEDFileInt64FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3337 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3338 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3339 return MEDFileInt64FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3342 std::string __str__() const
3344 return self->simpleRepr();
3347 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3349 DataArrayIdType *ret1=0;
3350 DataArrayInt64 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3351 PyObject *ret=PyTuple_New(2);
3352 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int64>::TI, SWIG_POINTER_OWN | 0 ));
3353 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3357 DataArrayInt64 *getUndergroundDataArray(int iteration, int order) const
3359 DataArrayInt64 *ret=self->getUndergroundDataArray(iteration,order);
3367 class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3370 static MEDFileFloatFieldMultiTS *New();
3371 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3372 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3373 static MEDFileFloatFieldMultiTS *New(DataArrayByte *db);
3375 void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
3376 void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3377 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3378 MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const;
3379 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3380 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3381 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3382 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3383 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3386 MEDFileFloatFieldMultiTS()
3388 return MEDFileFloatFieldMultiTS::New();
3391 MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true)
3393 return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
3396 MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3398 return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
3401 MEDFileFloatFieldMultiTS(DataArrayByte *db)
3403 return MEDFileFloatFieldMultiTS::New(db);
3406 static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3408 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3409 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3410 return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3413 std::string __str__() const
3415 return self->simpleRepr();
3418 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3420 DataArrayIdType *ret1=0;
3421 DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3422 PyObject *ret=PyTuple_New(2);
3423 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
3424 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3428 DataArrayFloat *getUndergroundDataArray(int iteration, int order) const
3430 DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
3438 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3441 static MEDFileMeshSupports *New(const std::string& fileName);
3442 std::vector<std::string> getSupMeshNames() const;
3445 MEDFileUMesh *getSupMeshWithName(const std::string& name) const
3447 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3448 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3456 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3459 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms);
3461 MEDFileStructureElements();
3464 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3467 static MEDFileFields *New();
3468 static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
3469 static MEDFileFields *New(DataArrayByte *db);
3470 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities);
3471 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
3472 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
3473 MEDFileFields *deepCopy() const;
3474 MEDFileFields *shallowCpy() const;
3476 void loadArraysIfNecessary();
3477 void unloadArrays();
3478 void unloadArraysWithoutDataLoss();
3479 int getNumberOfFields() const;
3480 std::vector<std::string> getFieldsNames() const;
3481 std::vector<std::string> getMeshesNames() const;
3483 void resize(int newSize);
3484 void pushField(MEDFileAnyTypeFieldMultiTS *field);
3485 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
3486 int getPosFromFieldName(const std::string& fieldName) const;
3487 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
3488 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
3489 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
3490 bool presenceOfStructureElements() const;
3491 void aggregate(const MEDFileFields& other);
3492 void killStructureElements();
3493 void keepOnlyStructureElements();
3494 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
3495 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
3496 void destroyFieldAtPos(int i);
3497 bool removeFieldsWithoutAnyTimeStep();
3502 return MEDFileFields::New();
3505 MEDFileFields(const std::string& fileName, bool loadAll=true)
3507 return MEDFileFields::New(fileName,loadAll);
3510 MEDFileFields(DataArrayByte *db)
3512 return MEDFileFields::New(db);
3515 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities)
3517 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3520 std::string __str__() const
3522 return self->simpleRepr();
3525 MEDFileFields *partOfThisOnStructureElements() const
3527 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3531 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const
3533 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3537 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true)
3539 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3540 std::size_t sz(tmp.size());
3541 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3542 for(std::size_t i=0;i<sz;i++)
3544 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3545 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3547 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3550 PyObject *getMeshSENames() const
3552 std::vector< std::pair<std::string,std::string> > ps;
3553 self->getMeshSENames(ps);
3554 return convertVectPairStToPy(ps);
3557 PyObject *getCommonIterations() const
3560 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3561 PyObject *ret=PyTuple_New(2);
3562 PyObject *ret_0=PyList_New(ret0.size());
3564 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3566 PyObject *elt=PyTuple_New(2);
3567 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3568 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3569 PyList_SetItem(ret_0,rk,elt);
3571 PyTuple_SetItem(ret,0,ret_0);
3572 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3573 PyTuple_SetItem(ret,1,ret_1);
3577 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3579 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3580 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3583 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3585 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3586 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3589 PyObject *__getitem__(PyObject *obj)
3591 if(obj && PyList_Check(obj))
3593 std::size_t sz=PyList_Size(obj);
3594 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3595 int *pt=da->getPointer();
3596 for(std::size_t i=0;i<sz;i++,pt++)
3598 PyObject *elt1=PyList_GetItem(obj,i);
3599 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3601 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3604 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3607 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field)
3609 self->setFieldAtPos(obj,field);
3615 return self->getNumberOfFields();
3618 MEDFileFieldsIterator *__iter__()
3620 return self->iterator();
3623 bool changeMeshNames(PyObject *li)
3625 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3626 return self->changeMeshNames(modifTab);
3629 int getPosOfField(PyObject *elt0) const
3631 static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
3633 throw INTERP_KERNEL::Exception(msg);
3634 if(PyInt_Check(elt0))
3636 return (int)PyInt_AS_LONG(elt0);
3638 return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
3641 std::vector<int> getPosOfFields(PyObject *elts) const
3643 if(PyList_Check(elts))
3645 std::size_t sz=PyList_Size(elts);
3646 std::vector<int> ret(sz);
3647 for(std::size_t i=0;i<sz;i++)
3649 PyObject *elt=PyList_GetItem(elts,i);
3650 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3656 std::vector<int> ret(1);
3657 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3662 void pushFields(PyObject *fields)
3664 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3665 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3666 self->pushFields(tmp);
3669 void __delitem__(PyObject *elts)
3671 if(elts && PySlice_Check(elts))
3673 Py_ssize_t strt=2,stp=2,step=2;
3674 GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3675 self->destroyFieldsAtPos2((int)strt,(int)stp,(int)step);
3679 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3680 if(!idsToRemove.empty())
3681 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3685 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
3687 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
3688 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3689 return self->extractPart(extractDefCpp,mm);
3692 MEDFileFields *linearToQuadratic(const MEDFileMeshes *oldLin, const MEDFileMeshes *newQuad) const
3694 MCAuto<MEDFileFields> ret(self->linearToQuadratic(oldLin,newQuad));
3700 class MEDFileParameter1TS : public RefCountObject
3703 void setIteration(int it);
3704 int getIteration() const;
3705 void setOrder(int order);
3706 int getOrder() const;
3707 void setTimeValue(double time);
3708 void setTime(int dt, int it, double time);
3709 double getTime(int& dt, int& it);
3710 double getTimeValue() const;
3713 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3716 void setValue(double val);
3717 double getValue() const;
3718 std::string simpleRepr() const;
3721 std::string __str__() const
3723 return self->simpleRepr();
3728 class MEDFileParameterTinyInfo : public MEDFileWritable
3731 void setDescription(const std::string& name);
3732 std::string getDescription() const;
3733 void setTimeUnit(const std::string& unit);
3734 std::string getTimeUnit() const;
3737 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3740 static MEDFileParameterDouble1TS *New();
3741 static MEDFileParameterDouble1TS *New(const std::string& fileName);
3742 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName);
3743 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it);
3744 virtual MEDFileParameter1TS *deepCopy() const;
3745 virtual std::string simpleRepr() const;
3746 void setName(const std::string& name);
3747 std::string getName() const;
3748 void write(const std::string& fileName, int mode) const;
3751 MEDFileParameterDouble1TS()
3753 return MEDFileParameterDouble1TS::New();
3756 MEDFileParameterDouble1TS(const std::string& fileName)
3758 return MEDFileParameterDouble1TS::New(fileName);
3761 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName)
3763 return MEDFileParameterDouble1TS::New(fileName,paramName);
3766 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it)
3768 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3771 std::string __str__() const
3773 return self->simpleRepr();
3776 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const
3779 bool ret0=self->isEqual(other,eps,what);
3780 PyObject *res=PyList_New(2);
3781 PyObject *ret0Py=ret0?Py_True:Py_False;
3783 PyList_SetItem(res,0,ret0Py);
3784 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3790 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3793 static MEDFileParameterMultiTS *New();
3794 static MEDFileParameterMultiTS *New(const std::string& fileName);
3795 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName);
3796 std::string getName() const;
3797 void setName(const std::string& name);
3798 MEDFileParameterMultiTS *deepCopy() const;
3799 void write(const std::string& fileName, int mode) const;
3800 std::string simpleRepr() const;
3801 void appendValue(int dt, int it, double time, double val);
3802 double getDoubleValue(int iteration, int order) const;
3803 int getPosOfTimeStep(int iteration, int order) const;
3804 int getPosGivenTime(double time, double eps=1e-8) const;
3805 int getNumberOfTS() const;
3808 MEDFileParameterMultiTS()
3810 return MEDFileParameterMultiTS::New();
3813 MEDFileParameterMultiTS(const std::string& fileName)
3815 return MEDFileParameterMultiTS::New(fileName);
3818 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3820 return MEDFileParameterMultiTS::New(fileName,paramName);
3823 std::string __str__() const
3825 return self->simpleRepr();
3828 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const
3831 bool ret0=self->isEqual(other,eps,what);
3832 PyObject *res=PyList_New(2);
3833 PyObject *ret0Py=ret0?Py_True:Py_False;
3835 PyList_SetItem(res,0,ret0Py);
3836 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3840 void eraseTimeStepIds(PyObject *ids)
3844 std::vector<int> pos2;
3845 DataArrayInt *pos3=0;
3846 DataArrayIntTuple *pos4=0;
3847 convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3852 self->eraseTimeStepIds(&pos1,&pos1+1);
3859 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3864 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3868 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3872 int getTimeStepId(PyObject *elt0) const
3874 if(elt0 && PyInt_Check(elt0))
3876 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3879 else if(elt0 && PyTuple_Check(elt0))
3881 if(PyTuple_Size(elt0)==2)
3883 PyObject *o0=PyTuple_GetItem(elt0,0);
3884 PyObject *o1=PyTuple_GetItem(elt0,1);
3885 if(PyInt_Check(o0) && PyInt_Check(o1))
3887 int iter=(int)PyInt_AS_LONG(o0);
3888 int order=(int)PyInt_AS_LONG(o1);
3889 return self->getPosOfTimeStep(iter,order);
3892 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 !");
3895 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 !");
3897 else if(elt0 && PyFloat_Check(elt0))
3899 double val=PyFloat_AS_DOUBLE(elt0);
3900 return self->getPosGivenTime(val);
3903 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3906 MEDFileParameter1TS *__getitem__(PyObject *elt0) const
3908 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3914 std::vector<int> getTimeStepIds(PyObject *elts) const
3916 if(PyList_Check(elts))
3918 std::size_t sz=PyList_Size(elts);
3919 std::vector<int> ret(sz);
3920 for(std::size_t i=0;i<sz;i++)
3922 PyObject *elt=PyList_GetItem(elts,i);
3923 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3929 std::vector<int> ret(1);
3930 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3935 void __delitem__(PyObject *elts)
3937 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3938 if(!idsToRemove.empty())
3939 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3942 MEDFileParameter1TS *getTimeStepAtPos(int posId) const
3944 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3950 PyObject *getIterations() const
3952 std::vector< std::pair<int,int> > res=self->getIterations();
3953 PyObject *ret=PyList_New(res.size());
3955 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3957 PyObject *elt=PyTuple_New(2);
3958 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3959 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3960 PyList_SetItem(ret,rk,elt);
3965 PyObject *getTimeSteps() const
3967 std::vector<double> res2;
3968 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3969 PyObject *ret=PyList_New(res.size());
3971 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3973 PyObject *elt=PyTuple_New(3);
3974 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3975 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3976 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3977 PyList_SetItem(ret,rk,elt);
3984 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3987 static MEDFileParameters *New();
3988 static MEDFileParameters *New(const std::string& fileName);
3989 static MEDFileParameters *New(DataArrayByte *db);
3990 MEDFileParameters *deepCopy() const;
3991 std::vector<std::string> getParamsNames() const;
3992 std::string simpleRepr() const;
3993 void resize(int newSize);
3994 void pushParam(MEDFileParameterMultiTS *param);
3995 void setParamAtPos(int i, MEDFileParameterMultiTS *param);
3996 void destroyParamAtPos(int i);
3997 int getPosFromParamName(const std::string& paramName) const;
3998 int getNumberOfParams() const;
4003 return MEDFileParameters::New();
4006 MEDFileParameters(const std::string& fileName)
4008 return MEDFileParameters::New(fileName);
4011 MEDFileParameters(DataArrayByte *db)
4013 return MEDFileParameters::New(db);
4016 std::string __str__() const
4018 return self->simpleRepr();
4021 MEDFileParameterMultiTS *__getitem__(PyObject *obj)
4023 static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
4024 if(PyInt_Check(obj))
4026 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
4031 MEDFileParameterMultiTS *ret(self->getParamWithName(convertPyObjectToStr(obj,msg)));
4039 return self->getNumberOfParams();
4042 MEDFileParameterMultiTS *getParamAtPos(int i) const
4044 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
4050 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const
4052 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
4058 PyObject *isEqual(const MEDFileParameters *other, double eps) const
4061 bool ret0=self->isEqual(other,eps,what);
4062 PyObject *res=PyList_New(2);
4063 PyObject *ret0Py=ret0?Py_True:Py_False;
4065 PyList_SetItem(res,0,ret0Py);
4066 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
4072 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
4075 static MEDFileData *New(DataArrayByte *db);
4076 static MEDFileData *New(const std::string& fileName);
4077 static MEDFileData *New();
4078 MEDFileData *deepCopy() const;
4079 void setFields(MEDFileFields *fields);
4080 void setMeshes(MEDFileMeshes *meshes);
4081 void setParams(MEDFileParameters *params);
4082 int getNumberOfFields() const;
4083 int getNumberOfMeshes() const;
4084 int getNumberOfParams() const;
4086 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName);
4087 bool unPolyzeMeshes();
4088 void dealWithStructureElements();
4089 std::string getHeader() const;
4090 void setHeader(const std::string& header);
4094 MEDFileData(const std::string& fileName)
4096 return MEDFileData::New(fileName);
4099 MEDFileData(DataArrayByte *db)
4101 return MEDFileData::New(db);
4106 return MEDFileData::New();
4109 std::string __str__() const
4111 return self->simpleRepr();
4114 MEDFileMeshes *getMeshes() const
4116 MEDFileMeshes *ret=self->getMeshes();
4122 MEDFileParameters *getParams() const
4124 MEDFileParameters *ret=self->getParams();
4130 MEDFileFields *getFields() const
4132 MEDFileFields *ret=self->getFields();
4138 bool changeMeshNames(PyObject *li)
4140 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
4141 return self->changeMeshNames(modifTab);
4144 static MEDFileData *Aggregate(PyObject *mfds)
4146 std::vector<const MEDFileData *> mfdsCpp;
4147 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
4148 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
4154 class SauvReader : public RefCountObject
4157 static SauvReader* New(const std::string& fileName);
4158 MEDFileData * loadInMEDFileDS();
4161 SauvReader(const std::string& fileName)
4163 return SauvReader::New(fileName);
4168 class SauvWriter : public RefCountObject
4171 static SauvWriter * New();
4172 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0);
4173 void write(const std::string& fileName);
4174 void setCpyGrpIfOnASingleFamilyStatus(bool status);
4175 bool getCpyGrpIfOnASingleFamilyStatus() const;
4180 return SauvWriter::New();
4187 class MEDFileMeshStruct;
4189 class MEDFileField1TSStructItem
4192 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt);
4195 class MEDFileMeshStruct : public RefCountObject
4198 static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
4200 ~MEDFileMeshStruct();
4203 class MEDMeshMultiLev : public RefCountObject
4206 virtual MEDMeshMultiLev *prepare() const;
4207 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const;
4208 DataArrayIdType *retrieveGlobalNodeIdsIfAny() const;
4214 PyObject *retrieveFamilyIdsOnCells() const
4216 DataArrayIdType *famIds(0);
4217 bool isWithoutCopy(false);
4218 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
4219 PyObject *ret=PyTuple_New(2);
4220 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4222 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4223 PyTuple_SetItem(ret,1,ret1Py);
4227 PyObject *retrieveNumberIdsOnCells() const
4229 DataArrayIdType *numIds(0);
4230 bool isWithoutCopy(false);
4231 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
4232 PyObject *ret=PyTuple_New(2);
4233 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4235 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4236 PyTuple_SetItem(ret,1,ret1Py);
4240 PyObject *retrieveFamilyIdsOnNodes() const
4242 DataArrayIdType *famIds(0);
4243 bool isWithoutCopy(false);
4244 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
4245 PyObject *ret=PyTuple_New(2);
4246 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4248 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4249 PyTuple_SetItem(ret,1,ret1Py);
4253 PyObject *retrieveNumberIdsOnNodes() const
4255 DataArrayIdType *numIds(0);
4256 bool isWithoutCopy(false);
4257 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
4258 PyObject *ret=PyTuple_New(2);
4259 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4261 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4262 PyTuple_SetItem(ret,1,ret1Py);
4266 PyObject *getGeoTypes() const
4268 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
4269 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4270 PyObject *res(PyList_New(result.size()));
4271 for(int i=0;iL!=result.end(); i++, iL++)
4272 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4278 class MEDUMeshMultiLev : public MEDMeshMultiLev
4281 ~MEDUMeshMultiLev();
4285 PyObject *buildVTUArrays() const
4287 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayIdType *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
4288 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
4289 PyObject *ret0Py=ncc?Py_True:Py_False;
4291 PyObject *ret=PyTuple_New(7);
4292 PyTuple_SetItem(ret,0,ret0Py);
4293 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4294 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
4295 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4296 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4297 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4298 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4304 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
4307 ~MEDStructuredMeshMultiLev();
4310 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4313 ~MEDCMeshMultiLev();
4317 PyObject *buildVTUArrays() const
4320 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4321 std::size_t sz(objs.size());
4322 PyObject *ret(PyTuple_New(2));
4323 PyObject *ret0=PyList_New(sz);
4324 for(std::size_t i=0;i<sz;i++)
4325 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4326 PyTuple_SetItem(ret,0,ret0);
4327 PyObject *ret1Py(isInternal?Py_True:Py_False);
4329 PyTuple_SetItem(ret,1,ret1Py);
4335 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4338 ~MEDCurveLinearMeshMultiLev();
4342 PyObject *buildVTUArrays() const
4344 DataArrayDouble *ret0(0);
4345 std::vector<mcIdType> ret1;
4347 self->buildVTUArrays(ret0,ret1,ret2);
4348 std::size_t sz(ret1.size());
4349 PyObject *ret=PyTuple_New(3);
4350 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4351 PyObject *ret1Py=PyList_New(sz);
4352 for(std::size_t i=0;i<sz;i++)
4353 PyList_SetItem(ret1Py,i,PyInt_FromLong(ret1[i]));
4354 PyTuple_SetItem(ret,1,ret1Py);
4355 PyObject *ret2Py(ret2?Py_True:Py_False);
4357 PyTuple_SetItem(ret,2,ret2Py);
4363 class MEDFileFastCellSupportComparator : public RefCountObject
4366 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
4367 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4368 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4369 int getNumberOfTS() const;
4371 ~MEDFileFastCellSupportComparator();
4375 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const
4377 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4378 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4379 PyObject *res(PyList_New(result.size()));
4380 for(int i=0;iL!=result.end(); i++, iL++)
4381 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4387 class MeshFormatReader
4390 MeshFormatReader(const std::string& meshFileName, const std::vector<std::string>& fieldFileName);
4392 MEDFileData* loadInMedFileDS();
4393 void setMeshName(const std::string& theMeshName);
4394 std::string getMeshName() const;
4395 void setFile(const std::string& theFileName);
4396 void setFieldFileNames(const std::vector<std::string>& theFieldFileNames);
4397 std::vector<std::string> getFieldFileNames() const;
4399 class MeshFormatWriter
4402 MeshFormatWriter(const std::string& meshFileName, const std::vector<std::string>& fieldFileNames);
4404 void setMeshFileName(const std::string& meshFileName);
4405 std::string getMeshFileName() const;
4406 void setFieldFileNames(const std::vector<std::string>& fieldFileNames);
4407 std::vector<std::string> getFieldFileNames() const;
4408 void setMEDFileDS(MEDCoupling::MEDFileData* mfd);
4416 self.loadArraysIfNecessary()
4418 def exit1TS(self, exctype, exc, tb):
4419 self.unloadArraysWithoutDataLoss()
4421 MEDFileAnyTypeField1TS.__enter__=enter1TS
4422 MEDFileAnyTypeField1TS.__exit__=exit1TS
4423 MEDFileIntField1TS = MEDFileInt32Field1TS
4424 MEDFileIntFieldMultiTS = MEDFileInt32FieldMultiTS
4425 if MEDCouplingUse64BitIDs():
4426 MEDFileIDField1TS = MEDFileInt64Field1TS
4427 MEDFileIDFieldMultiTS = MEDFileInt64FieldMultiTS
4429 MEDFileIDField1TS = MEDFileInt32Field1TS
4430 MEDFileIDFieldMultiTS = MEDFileInt32FieldMultiTS