1 // Copyright (C) 2017-2022 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
21 #define MEDCOUPLING_EXPORT
22 #define MEDLOADER_EXPORT
24 #ifdef WITH_DOCSTRINGS
25 %include "MEDLoader_doc.i"
28 %include "MEDCouplingCommon.i"
31 #include "MEDLoader.hxx"
32 #include "MEDFileJoint.hxx"
33 #include "MEDFileMesh.hxx"
34 #include "MEDFileField.hxx"
35 #include "MEDFileParameter.hxx"
36 #include "MEDFileData.hxx"
37 #include "MEDFileEquivalence.hxx"
38 #include "MEDFileEntities.hxx"
39 #include "MEDFileMeshReadSelector.hxx"
40 #include "MEDFileFieldOverView.hxx"
41 #include "MEDCouplingTypemaps.i"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
45 #include "MeshFormatReader.hxx"
46 #include "MeshFormatWriter.hxx"
48 using namespace MEDCoupling;
51 #if SWIG_VERSION >= 0x010329
52 %template() std::vector<std::string>;
55 %typemap(out) MEDCoupling::MEDFileMesh*
57 $result=convertMEDFileMesh($1,$owner);
60 %typemap(out) MEDCoupling::MEDFileParameter1TS*
62 $result=convertMEDFileParameter1TS($1,$owner);
65 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
67 $result=convertMEDFileFieldMultiTS($1,$owner);
70 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
72 $result=convertMEDFileField1TS($1,$owner);
75 %typemap(out) MEDCoupling::MEDMeshMultiLev*
77 $result=convertMEDMeshMultiLev($1,$owner);
80 %newobject ReadUMeshFromFamiliesSwig;
81 %newobject ReadUMeshFromGroupsSwig;
82 %newobject ReadFieldSwig;
83 %newobject MEDCoupling::ReadUMeshFromFile;
84 %newobject MEDCoupling::ReadMeshFromFile;
85 %newobject MEDCoupling::ReadFieldCell;
86 %newobject MEDCoupling::ReadFieldNode;
87 %newobject MEDCoupling::ReadFieldGauss;
88 %newobject MEDCoupling::ReadFieldGaussNE;
89 %newobject MEDCoupling::MEDFileMesh::New;
90 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
91 %newobject MEDCoupling::MEDFileMesh::deepCopy;
92 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
93 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
94 %newobject MEDCoupling::MEDFileMesh::__getitem__;
95 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
96 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
97 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
98 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
101 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
102 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
103 %newobject MEDCoupling::MEDFileMesh::getGlobalNumFieldAtLevel;
104 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
105 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
106 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
107 %newobject MEDCoupling::MEDFileMesh::cartesianize;
108 %newobject MEDCoupling::MEDFileData::getJoints;
109 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
110 %newobject MEDCoupling::MEDFileUMesh::New;
111 %newobject MEDCoupling::MEDFileUMesh::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::MEDFileField1TS::New;
227 %newobject MEDCoupling::MEDFileField1TS::field;
228 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
229 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
230 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
231 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
232 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
233 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
234 %newobject MEDCoupling::MEDFileField1TS::convertToInt64;
236 %newobject MEDCoupling::MEDFileInt32Field1TS::New;
237 %newobject MEDCoupling::MEDFileInt32Field1TS::field;
238 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevel;
239 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtTopLevel;
240 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldOnMeshAtLevel;
241 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevelOld;
242 %newobject MEDCoupling::MEDFileInt32Field1TS::getUndergroundDataArray;
243 %newobject MEDCoupling::MEDFileInt32Field1TS::convertToDouble;
245 %newobject MEDCoupling::MEDFileInt64Field1TS::New;
246 %newobject MEDCoupling::MEDFileInt64Field1TS::field;
247 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevel;
248 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtTopLevel;
249 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldOnMeshAtLevel;
250 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevelOld;
251 %newobject MEDCoupling::MEDFileInt64Field1TS::getUndergroundDataArray;
252 %newobject MEDCoupling::MEDFileInt64Field1TS::convertToDouble;
254 %newobject MEDCoupling::MEDFileFloatField1TS::New;
255 %newobject MEDCoupling::MEDFileFloatField1TS::field;
256 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevel;
257 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtTopLevel;
258 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldOnMeshAtLevel;
259 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevelOld;
260 %newobject MEDCoupling::MEDFileFloatField1TS::getUndergroundDataArray;
261 %newobject MEDCoupling::MEDFileFloatField1TS::convertToDouble;
263 %newobject MEDCoupling::MEDFileData::New;
264 %newobject MEDCoupling::MEDFileData::deepCopy;
265 %newobject MEDCoupling::MEDFileData::getMeshes;
266 %newobject MEDCoupling::MEDFileData::getFields;
267 %newobject MEDCoupling::MEDFileData::getParams;
268 %newobject MEDCoupling::MEDFileData::Aggregate;
270 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
272 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
273 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
274 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
275 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
276 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
277 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
278 %newobject MEDCoupling::MEDFileParameters::New;
279 %newobject MEDCoupling::MEDFileParameters::deepCopy;
280 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
281 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
282 %newobject MEDCoupling::MEDFileParameters::__getitem__;
284 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
285 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
286 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
287 %newobject MEDCoupling::MEDFileJointCorrespondence::getCorrespondence;
288 %newobject MEDCoupling::MEDFileJointOneStep::New;
289 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
290 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
291 %newobject MEDCoupling::MEDFileJointOneStep::getCorrespondenceAtPos;
292 %newobject MEDCoupling::MEDFileJointOneStep::__getitem__;
293 %newobject MEDCoupling::MEDFileJoint::New;
294 %newobject MEDCoupling::MEDFileJoint::deepCopy;
295 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
296 %newobject MEDCoupling::MEDFileJoint::getStepAtPos;
297 %newobject MEDCoupling::MEDFileJoint::__getitem__;
298 %newobject MEDCoupling::MEDFileJoints::New;
299 %newobject MEDCoupling::MEDFileJoints::deepCopy;
300 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
301 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
302 %newobject MEDCoupling::MEDFileJoints::__getitem__;
303 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
304 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
305 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
306 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
307 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
308 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
309 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
310 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
311 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
313 %newobject MEDCoupling::SauvWriter::New;
314 %newobject MEDCoupling::SauvReader::New;
315 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
318 %newobject MEDCoupling::MEDFileMeshStruct::New;
319 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
320 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
321 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
322 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
323 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
325 %newobject MEDCoupling::MeshFormatReader::loadInMEDFileDS;
326 %newobject MEDCoupling::MeshFormatReader::MeshFormatReader;
327 %newobject MEDCoupling::MeshFormatWriter::MeshFormatWriter;
329 %feature("unref") MEDFileMesh "$this->decrRef();"
330 %feature("unref") MEDFileUMesh "$this->decrRef();"
331 %feature("unref") MEDFileCMesh "$this->decrRef();"
332 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
333 %feature("unref") MEDFileMeshes "$this->decrRef();"
334 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
335 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
336 %feature("unref") MEDFileField1TS "$this->decrRef();"
337 %feature("unref") MEDFileInt32Field1TS "$this->decrRef();"
338 %feature("unref") MEDFileInt64Field1TS "$this->decrRef();"
339 %feature("unref") MEDFileFloatField1TS "$this->decrRef();"
340 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
341 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
342 %feature("unref") MEDFileInt32FieldMultiTS "$this->decrRef();"
343 %feature("unref") MEDFileInt64FieldMultiTS "$this->decrRef();"
344 %feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();"
345 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
346 %feature("unref") MEDFileStructureElements "$this->decrRef();"
347 %feature("unref") MEDFileFields "$this->decrRef();"
348 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
349 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
350 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
351 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
352 %feature("unref") MEDFileParameters "$this->decrRef();"
353 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
354 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
355 %feature("unref") MEDFileJoint "$this->decrRef();"
356 %feature("unref") MEDFileJoints "$this->decrRef();"
357 %feature("unref") MEDFileEquivalences "$this->decrRef();"
358 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
359 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
360 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
361 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
362 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
363 %feature("unref") MEDFileData "$this->decrRef();"
364 %feature("unref") SauvReader "$this->decrRef();"
365 %feature("unref") SauvWriter "$this->decrRef();"
366 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
367 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
368 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
369 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
370 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
371 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
373 namespace MEDCoupling
376 std::string MEDFileVersionStr();
377 std::string MEDFileVersionOfFileStr(const std::string& fileName);
378 void SetEpsilonForNodeComp(double val);
379 void SetCompPolicyForCell(int val);
380 void SetTooLongStrPolicy(int val);
381 void CheckFileForRead(const std::string& fileName);
382 std::vector<std::string> GetMeshNames(const std::string& fileName);
383 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName);
384 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName);
385 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName);
386 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName);
387 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName);
388 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
389 std::vector<std::string> GetAllFieldNames(const std::string& fileName);
390 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName);
391 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
392 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
393 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order);
394 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj);
395 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
396 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
397 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
398 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
399 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName);
400 MEDCoupling::MEDCouplingField *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
401 MEDCoupling::MEDCouplingField *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
402 MEDCoupling::MEDCouplingField *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
403 MEDCoupling::MEDCouplingField *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
404 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch);
405 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
406 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
407 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
408 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
409 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingField *f);
412 %rename (MEDFileVersion) MEDFileVersionSwig;
413 %rename (GetFieldIterations) GetFieldIterationsSwig;
414 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
415 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
416 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
417 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
418 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
419 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
420 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
421 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
422 %rename (WriteUMeshes) WriteUMeshesSwig;
423 %rename (GetTypesOfField) GetTypesOfFieldSwig;
424 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
425 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
426 %rename (ReadField) ReadFieldSwig;
427 %rename (GetFamiliesGroupsInfo) GetFamiliesGroupsInfoSwig;
431 PyObject *MEDFileVersionSwig()
433 int major,minor,release;
434 MEDCoupling::MEDFileVersion(major,minor,release);
435 PyObject *ret(PyTuple_New(3));
436 PyTuple_SetItem(ret,0,SWIG_From_int(major));
437 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
438 PyTuple_SetItem(ret,2,SWIG_From_int(release));
442 int MEDFileSizeOfMedInt()
444 return 8*sizeof(med_int);
447 PyObject *GetFamiliesGroupsInfoSwig(const std::string& fileName, const std::string& meshName)
449 std::map<std::string,mcIdType> families;
450 std::map<std::string,std::vector<std::string>> groupsOnFam;
451 MEDCoupling::GetFamiliesGroupsInfo(fileName,meshName,families,groupsOnFam);
452 AutoPyPtr a(convertMapStringInt(families)),b(convertMapStringVectString(groupsOnFam));
453 AutoPyPtr ret(PyTuple_New(2));
454 PyTuple_SetItem(ret,0,a.retn());
455 PyTuple_SetItem(ret,1,b.retn());
459 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName)
461 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName));
465 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName)
467 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName));
471 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order)
473 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
477 MEDCoupling::MEDCouplingField *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
479 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
483 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
485 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
486 PyObject *ret=PyList_New(res.size());
488 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
490 PyObject *elt=PyTuple_New(2);
491 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
492 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
493 PyList_SetItem(ret,rk,elt);
498 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName)
500 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
501 PyObject *ret=PyList_New(res.size());
503 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
505 PyObject *elt=PyTuple_New(3);
506 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
507 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
508 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
509 PyList_SetItem(ret,rk,elt);
514 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
516 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
517 PyObject *ret=PyList_New(res.size());
519 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
521 PyObject *elt=PyTuple_New(2);
522 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
523 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
524 PyList_SetItem(ret,rk,elt);
529 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
531 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
532 PyObject *ret=PyList_New(res.size());
534 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
536 PyObject *elt=PyTuple_New(2);
537 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
538 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
539 PyList_SetItem(ret,rk,elt);
544 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName)
546 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
547 PyObject *ret=PyList_New(res.size());
549 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
551 PyObject *elt=PyTuple_New(2);
552 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
553 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
554 PyList_SetItem(ret,rk,elt);
559 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName)
561 int meshDim,spaceDim;
562 mcIdType numberOfNodes;
563 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
564 PyObject *ret=PyTuple_New(4);
565 PyObject *elt0=PyList_New(res.size());
567 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
569 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
571 PyObject *elt1=PyList_New(obj2.size());
572 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
574 PyObject *elt2=PyTuple_New(2);
575 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
576 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
577 PyList_SetItem(elt1,j,elt2);
579 PyList_SetItem(elt0,i,elt1);
581 PyTuple_SetItem(ret,0,elt0);
582 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
583 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
584 PyTuple_SetItem(ret,3,SWIG_From_long(numberOfNodes));
588 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
589 const std::string& fieldName, PyObject *liIts)
591 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
592 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
593 return convertFieldDoubleVecToPy(res);
596 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
598 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
599 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
600 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
603 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
605 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
606 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
607 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
610 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch)
612 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
613 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
614 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
617 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
619 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
620 std::size_t size=v.size();
621 PyObject *ret=PyList_New(size);
622 for(std::size_t i=0;i<size;i++)
623 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
627 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
629 std::vector<std::string> grps;
630 converPyListToVecString(li,grps);
631 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
634 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
636 std::vector<std::string> fams;
637 converPyListToVecString(li,fams);
638 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
642 namespace MEDCoupling
644 class MEDFileWritable
647 void copyOptionsFrom(const MEDFileWritable& other) const;
648 int getTooLongStrPolicy() const;
649 void setTooLongStrPolicy(int newVal);
650 int getZipConnPolicy();
651 void setZipConnPolicy(int newVal);
654 class MEDFileWritableStandAlone : public MEDFileWritable
657 void write(const std::string& fileName, int mode) const;
658 void write33(const std::string& fileName, int mode) const;
659 void write30(const std::string& fileName, int mode) const;
662 DataArrayByte *serialize() const
664 MCAuto<DataArrayByte> ret(self->serialize());
668 PyObject *__getstate__()
670 PyObject *ret(PyList_New(0));
674 void __setstate__(PyObject *inp)
680 class MEDFileMeshReadSelector
683 MEDFileMeshReadSelector();
684 MEDFileMeshReadSelector(unsigned int code);
685 mcIdType getNumberOfCoordsLoadSessions();
686 void setNumberOfCoordsLoadSessions(mcIdType newNbOfCoordsLoadSessions);
687 unsigned int getCode() const;
688 void setCode(unsigned int newCode);
689 bool isCellFamilyFieldReading() const;
690 bool isNodeFamilyFieldReading() const;
691 bool isCellNameFieldReading() const;
692 bool isNodeNameFieldReading() const;
693 bool isCellNumFieldReading() const;
694 bool isNodeNumFieldReading() const;
695 bool isGlobalNodeNumFieldReading() const;
696 void setCellFamilyFieldReading(bool b);
697 void setNodeFamilyFieldReading(bool b);
698 void setCellNameFieldReading(bool b);
699 void setNodeNameFieldReading(bool b);
700 void setCellNumFieldReading(bool b);
701 void setNodeNumFieldReading(bool b);
702 void setGlobalNodeNumFieldReading(bool b);
705 std::string __str__() const
707 std::ostringstream oss;
712 std::string __repr__() const
714 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
720 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
723 static MEDFileJointCorrespondence *New();
724 static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence) // nodes
726 static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence, // cells
727 INTERP_KERNEL::NormalizedCellType loc_geo_type,
728 INTERP_KERNEL::NormalizedCellType rem_geo_type)
730 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
731 MEDFileJointCorrespondence *deepCopy() const;
732 MEDFileJointCorrespondence *shallowCpy() const;
733 void setIsNodal(bool isNodal);
734 bool getIsNodal() const;
735 bool isEqual(const MEDFileJointCorrespondence *other) const;
736 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
737 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
738 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
739 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
740 void setCorrespondence(DataArrayIdType *corr);
741 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const;
742 std::string simpleRepr() const;
745 MEDFileJointCorrespondence()
747 return MEDFileJointCorrespondence::New();
749 MEDFileJointCorrespondence(DataArrayIdType* correspondence)
751 return MEDFileJointCorrespondence::New(correspondence);
753 MEDFileJointCorrespondence(DataArrayIdType* correspondence, // cells
754 INTERP_KERNEL::NormalizedCellType loc_geo_type,
755 INTERP_KERNEL::NormalizedCellType rem_geo_type)
757 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
760 std::string __str__() const
762 return self->simpleRepr();
765 DataArrayIdType *getCorrespondence() const
767 const DataArrayIdType *ret(self->getCorrespondence());
770 return const_cast<DataArrayIdType *>(ret);
775 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
778 static MEDFileJointOneStep *New(int dt=-1, int it=-1);
779 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1);
780 MEDFileJointOneStep *deepCopy() const;
781 MEDFileJointOneStep *shallowCpy() const;
782 bool isEqual(const MEDFileJointOneStep *other) const;
783 void setOrder(int order);
784 int getOrder() const;
785 void setIteration(int it);
786 int getIteration() const;
787 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
788 void clearCorrespondences();
789 int getNumberOfCorrespondences() const;
790 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const;
791 std::string simpleRepr() const;
794 MEDFileJointOneStep()
796 return MEDFileJointOneStep::New();
799 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number)
801 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
804 std::string __str__() const
806 return self->simpleRepr();
809 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const
811 MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
817 MEDFileJointCorrespondence *__getitem__(int i) const
819 return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
824 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
827 static MEDFileJoint *New();
828 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num);
829 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum);
830 MEDFileJoint *deepCopy() const;
831 MEDFileJoint *shallowCpy() const;
832 bool isEqual(const MEDFileJoint *other) const;
833 void setLocalMeshName(const std::string& name);
834 std::string getLocalMeshName() const;
835 void setRemoteMeshName(const std::string& name);
836 std::string getRemoteMeshName() const;
837 void setDescription(const std::string& name);
838 std::string getDescription() const;
839 void setJointName(const std::string& name);
840 std::string getJointName() const;
841 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
842 void setDomainNumber(const int& number);
843 int getDomainNumber() const;
844 void pushStep(MEDFileJointOneStep* step);
845 int getNumberOfSteps() const;
846 std::string simpleRepr() const;
851 return MEDFileJoint::New();
854 MEDFileJoint(const std::string& fileName, const std::string& mName, int num)
856 return MEDFileJoint::New(fileName,mName,num);
859 MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum)
861 return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
864 std::string __str__() const
866 return self->simpleRepr();
869 MEDFileJointOneStep *getStepAtPos(int i) const
871 MEDFileJointOneStep *ret(self->getStepAtPos(i));
877 MEDFileJointOneStep *__getitem__(int i)
879 return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
884 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
887 static MEDFileJoints *New();
888 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName);
889 MEDFileJoints *deepCopy() const;
890 std::string simpleRepr() const;
891 std::string getMeshName() const;
892 int getNumberOfJoints() const;
893 std::vector<std::string> getJointsNames() const;
894 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
895 void resize(int newSize);
896 void pushJoint(MEDFileJoint *joint);
897 void setJointAtPos(int i, MEDFileJoint *joint);
898 void destroyJointAtPos(int i);
903 return MEDFileJoints::New();
906 MEDFileJoints(const std::string& fileName, const std::string& meshName)
908 return MEDFileJoints::New(fileName,meshName);
911 std::string __str__() const
913 return self->simpleRepr();
916 MEDFileJoint *__getitem__(PyObject *obj)
918 static const char msg[]="MEDFileJoints::__getitem__ : only integer or string with meshname supported !";
921 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
926 MEDFileJoint *ret(self->getJointWithName(convertPyObjectToStr(obj,msg)));
934 return self->getNumberOfJoints();
937 MEDFileJoint *getJointAtPos(int i) const
939 MEDFileJoint *ret=self->getJointAtPos(i);
945 MEDFileJoint *getJointWithName(const std::string& paramName) const
947 MEDFileJoint *ret=self->getJointWithName(paramName);
955 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
958 MEDFileEquivalenceBase();
961 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
964 MEDFileEquivalenceData();
966 void setArray(DataArrayInt32 *data);
969 DataArrayInt32 *getArray()
971 DataArrayInt32 *ret(self->getArray());
972 if(ret) ret->incrRef();
978 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
981 MEDFileEquivalenceNode();
984 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
987 MEDFileEquivalenceCell();
990 std::size_t size() const;
991 void setArray(int meshDimRelToMax, DataArrayInt32 *da);
992 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt32 *da);
995 DataArrayInt32 *getArray(INTERP_KERNEL::NormalizedCellType type)
997 DataArrayInt32 *ret(self->getArray(type));
998 if(ret) ret->incrRef();
1002 PyObject *getTypes() const
1004 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
1005 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1006 PyObject *res=PyList_New(result.size());
1007 for(int i=0;iL!=result.end(); i++, iL++)
1008 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1014 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
1017 MEDFileEquivalencePair();
1019 std::string getName() const;
1020 void setName(const std::string& name);
1021 std::string getDescription() const;
1022 void setDescription(const std::string& descr);
1023 void setArray(int meshDimRelToMaxExt, DataArrayInt32 *da);;
1026 MEDFileEquivalenceCell *initCell()
1028 MEDFileEquivalenceCell *ret(self->initCell());
1029 if(ret) ret->incrRef();
1033 MEDFileEquivalenceNode *initNode()
1035 MEDFileEquivalenceNode *ret(self->initNode());
1036 if(ret) ret->incrRef();
1040 MEDFileEquivalenceCell *getCell()
1042 MEDFileEquivalenceCell *ret(self->getCell());
1043 if(ret) ret->incrRef();
1047 MEDFileEquivalenceNode *getNode()
1049 MEDFileEquivalenceNode *ret(self->getNode());
1050 if(ret) ret->incrRef();
1056 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
1059 MEDFileEquivalences();
1062 std::vector<std::string> getEquivalenceNames() const;
1063 void killEquivalenceWithName(const std::string& name);
1064 void killEquivalenceAt(int i);
1068 MEDFileEquivalencePair *getEquivalence(int i)
1070 MEDFileEquivalencePair *ret(self->getEquivalence(i));
1071 if(ret) ret->incrRef();
1074 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name)
1076 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
1077 if(ret) ret->incrRef();
1081 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name)
1083 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
1084 if(ret) ret->incrRef();
1090 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
1093 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1094 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1095 static MEDFileMesh *New(DataArrayByte *db);
1096 virtual MEDFileMesh *createNewEmpty() const;
1097 virtual MEDFileMesh *deepCopy() const;
1098 virtual MEDFileMesh *shallowCpy() const;
1099 virtual void clearNonDiscrAttributes() const;
1100 void setName(const std::string& name);
1101 std::string getName();
1102 std::string getUnivName() const;
1103 bool getUnivNameWrStatus() const;
1104 void setUnivNameWrStatus(bool newStatus);
1105 void setDescription(const std::string& name);
1106 std::string getDescription() const;
1107 void setOrder(int order);
1108 int getOrder() const;
1109 void setIteration(int it);
1111 void setTimeValue(double time);
1112 void setTime(int dt, int it, double time);
1113 double getTimeValue() const;
1114 void setTimeUnit(const std::string& unit);
1115 std::string getTimeUnit() const;
1116 void setAxisType(MEDCouplingAxisType at);
1117 MEDCouplingAxisType getAxisType() const;
1118 virtual int getNumberOfNodes() const;
1119 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const;
1120 virtual bool hasImplicitPart() const;
1121 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const;
1122 virtual void releaseImplicitPartIfAny() const;
1123 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const;
1124 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const;
1125 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const;
1126 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const;
1127 virtual std::vector<mcIdType> getDistributionOfTypes(int meshDimRelToMax) const;
1128 virtual MEDFileMesh *cartesianize() const;
1129 std::vector<int> getNonEmptyLevels() const;
1130 std::vector<int> getNonEmptyLevelsExt() const;
1131 int getSizeAtLevel(int meshDimRelToMaxExt) const;
1133 bool existsGroup(const std::string& groupName) const;
1134 bool existsFamily(int famId) const;
1135 bool existsFamily(const std::string& familyName) const;
1136 void setFamilyId(const std::string& familyName, int id);
1137 void setFamilyIdUnique(const std::string& familyName, int id);
1138 void addFamily(const std::string& familyName, int id);
1139 void addFamilyOnGrp(const std::string& grpName, const std::string& famName);
1140 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName);
1141 virtual bool keepFamIdsOnlyOnLevs(const std::vector<mcIdType>& famIds, const std::vector<int>& levs);
1142 void copyFamGrpMapsFrom(const MEDFileMesh& other);
1145 void clearFamGrpMaps();
1146 const std::map<std::string,int>& getFamilyInfo() const;
1147 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const;
1148 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const;
1149 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const;
1150 std::vector<mcIdType> getFamiliesIdsOnGroup(const std::string& name) const;
1151 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams);
1152 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<mcIdType>& famIds);
1153 std::vector<std::string> getGroupsOnFamily(const std::string& name) const;
1154 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps);
1155 std::vector<std::string> getGroupsNames() const;
1156 std::vector<std::string> getFamiliesNames() const;
1157 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
1158 std::vector<mcIdType> getGrpNonEmptyLevelsExt(const std::string& grp) const;
1159 std::vector<mcIdType> getGrpNonEmptyLevels(const std::string& grp) const;
1160 std::vector<mcIdType> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
1161 std::vector<mcIdType> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
1162 std::vector<mcIdType> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
1163 std::vector<mcIdType> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
1164 std::vector<mcIdType> getFamNonEmptyLevels(const std::string& fam) const;
1165 std::vector<mcIdType> getFamNonEmptyLevelsExt(const std::string& fam) const;
1166 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const;
1167 static std::string GetMagicFamilyStr();
1168 void assignFamilyNameWithGroupName();
1169 std::vector<std::string> removeEmptyGroups();
1170 void removeGroupAtLevel(int meshDimRelToMaxExt, const std::string& name);
1171 void removeGroup(const std::string& name);
1172 void removeFamily(const std::string& name);
1173 std::vector<std::string> removeOrphanGroups();
1174 std::vector<std::string> removeOrphanFamilies();
1175 void removeFamiliesReferedByNoGroups();
1176 void rearrangeFamilies();
1178 void checkOrphanFamilyZero() const;
1179 void changeGroupName(const std::string& oldName, const std::string& newName);
1180 void changeFamilyName(const std::string& oldName, const std::string& newName);
1181 void changeFamilyId(int oldId, int newId);
1182 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames);
1183 void setFamilyInfo(const std::map<std::string,mcIdType>& info);
1184 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1185 int getFamilyId(const std::string& name) const;
1186 int getMaxAbsFamilyId() const;
1187 int getMaxFamilyId() const;
1188 int getMinFamilyId() const;
1189 int getTheMaxAbsFamilyId() const;
1190 int getTheMaxFamilyId() const;
1191 int getTheMinFamilyId() const;
1192 virtual int getMaxAbsFamilyIdInArrays() const;
1193 virtual int getMaxFamilyIdInArrays() const;
1194 virtual int getMinFamilyIdInArrays() const;
1195 DataArrayIdType *getAllFamiliesIdsReferenced() const;
1196 DataArrayIdType *computeAllFamilyIdsInUse() const;
1197 std::vector<mcIdType> getFamiliesIds(const std::vector<std::string>& famNames) const;
1198 std::string getFamilyNameGivenId(int id) const;
1199 bool ensureDifferentFamIdsPerLevel();
1200 void normalizeFamIdsTrio();
1201 void normalizeFamIdsMEDFile();
1202 virtual int getMeshDimension() const;
1203 virtual std::string simpleRepr() const;
1204 virtual std::string advancedRepr() const;
1206 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const;
1207 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayIdType *famArr);
1208 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayIdType *renumArr);
1209 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr);
1210 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayIdType *globalNumArr);
1211 virtual void addNodeGroup(const DataArrayIdType *ids);
1212 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayIdType *ids);
1213 virtual DataArrayIdType *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1214 virtual DataArrayIdType *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1215 virtual DataArrayIdType *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1216 virtual DataArrayIdType *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1217 virtual DataArrayIdType *getNodeGroupArr(const std::string& grp, bool renum=false) const;
1218 virtual DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1219 virtual DataArrayIdType *getNodeFamilyArr(const std::string& fam, bool renum=false) const;
1220 virtual DataArrayIdType *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const;
1221 int getNumberOfJoints();
1222 MEDFileJoints *getJoints();
1223 void setJoints( MEDFileJoints* joints );
1224 void initializeEquivalences();
1225 void killEquivalences();
1226 bool presenceOfStructureElements() const;
1227 void killStructureElements();
1230 std::string __str__() const
1232 return self->simpleRepr();
1235 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const
1237 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1240 static INTERP_KERNEL::NormalizedCellType ConvertFromMEDFileGeoType(int geoType)
1242 med_geometry_type geoType2((med_geometry_type) geoType);
1243 return MEDFileMesh::ConvertFromMEDFileGeoType(geoType2);
1246 static int ConvertToMEDFileGeoType(INTERP_KERNEL::NormalizedCellType geoType)
1248 return (int) MEDFileMesh::ConvertToMEDFileGeoType(geoType);
1254 double tmp0=self->getTime(tmp1,tmp2);
1255 PyObject *res = PyList_New(3);
1256 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1257 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1258 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1262 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const
1265 bool ret0=self->isEqual(other,eps,what);
1266 PyObject *res=PyList_New(2);
1267 PyObject *ret0Py=ret0?Py_True:Py_False;
1269 PyList_SetItem(res,0,ret0Py);
1270 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1274 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false)
1276 std::vector<const DataArrayIdType *> grps;
1277 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grps);
1278 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1281 void addGroupsAtLevel(int meshDimRelToMaxExt, PyObject *grps)
1283 std::vector<const DataArrayIdType *> grpsCpp;
1284 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(grps,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grpsCpp);
1285 self->addGroupsAtLevel(meshDimRelToMaxExt,grpsCpp);
1288 PyObject *areFamsEqual(const MEDFileMesh *other) const
1291 bool ret0=self->areFamsEqual(other,what);
1292 PyObject *res=PyList_New(2);
1293 PyObject *ret0Py=ret0?Py_True:Py_False;
1295 PyList_SetItem(res,0,ret0Py);
1296 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1300 PyObject *areGrpsEqual(const MEDFileMesh *other) const
1303 bool ret0=self->areGrpsEqual(other,what);
1304 PyObject *res=PyList_New(2);
1305 PyObject *ret0Py=ret0?Py_True:Py_False;
1307 PyList_SetItem(res,0,ret0Py);
1308 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1312 PyObject *getAllGeoTypes() const
1314 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1315 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1316 PyObject *res=PyList_New(result.size());
1317 for(int i=0;iL!=result.end(); i++, iL++)
1318 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1322 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const
1324 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1325 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1326 PyObject *res=PyList_New(result.size());
1327 for(int i=0;iL!=result.end(); i++, iL++)
1328 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1332 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const
1334 const DataArrayIdType *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1337 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1340 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt)
1342 const DataArrayIdType *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1345 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1348 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const
1350 const DataArrayIdType *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1353 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1356 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const
1358 const DataArrayIdType *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1361 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1364 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const
1366 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1369 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1372 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created)
1375 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1376 PyObject *ret=PyTuple_New(2);
1377 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1378 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1382 PyObject *unPolyze()
1384 DataArrayIdType *ret3=0;
1385 std::vector<mcIdType> ret1,ret2;
1386 bool ret0=self->unPolyze(ret1,ret2,ret3);
1387 PyObject *ret=PyTuple_New(4);
1388 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1390 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1391 for(int j=0;j<(int)ret1.size()/3;j++)
1393 PyObject *retLev2=PyList_New(3);
1394 PyList_SetItem(retLev2,0,PyInt_FromLong(ret1[3*j]));
1395 PyList_SetItem(retLev2,1,PyInt_FromLong(ret1[3*j+1]));
1396 PyList_SetItem(retLev2,2,PyInt_FromLong(ret1[3*j+2]));
1397 PyList_SetItem(retLev1_0,j,retLev2);
1399 PyTuple_SetItem(ret,1,retLev1_0);
1401 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1402 for(int j=0;j<(int)ret2.size()/3;j++)
1404 PyObject *retLev2=PyList_New(3);
1405 PyList_SetItem(retLev2,0,PyInt_FromLong(ret2[3*j]));
1406 PyList_SetItem(retLev2,1,PyInt_FromLong(ret2[3*j+1]));
1407 PyList_SetItem(retLev2,2,PyInt_FromLong(ret2[3*j+2]));
1408 PyList_SetItem(retLev1_1,j,retLev2);
1410 PyTuple_SetItem(ret,2,retLev1_1);
1412 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1416 MEDFileEquivalences *getEquivalences()
1418 MEDFileEquivalences *ret(self->getEquivalences());
1419 if(ret) ret->incrRef();
1423 virtual DataArrayIdType *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const
1425 MCAuto<DataArrayIdType> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1431 class MEDFileUMesh : public MEDFileMesh
1434 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1435 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1436 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem);
1437 static MEDFileUMesh *New(DataArrayByte *db);
1438 static MEDFileUMesh *New();
1439 static const char *GetSpeStr4ExtMesh();
1441 int getSpaceDimension() const;
1442 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1443 void checkConsistency() const;
1444 void checkSMESHConsistency() const;
1445 void clearNodeAndCellNumbers();
1447 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1448 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1449 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1450 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1451 DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1452 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const;
1453 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const;
1454 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const;
1455 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const;
1456 void forceComputationOfParts() const;
1457 void computeRevNum() const;
1459 void setFamilyNameAttachedOnId(int id, const std::string& newFamName);
1460 void setCoords(DataArrayDouble *coords);
1461 void setCoordsForced(DataArrayDouble *coords);
1462 void eraseGroupsAtLevel(int meshDimRelToMaxExt);
1463 void removeMeshAtLevel(int meshDimRelToMax);
1464 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m);
1465 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false);
1466 void optimizeFamilies();
1467 DataArrayIdType *computeFetchedNodeIds() const;
1468 DataArrayIdType *zipCoords();
1469 DataArrayIdType *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1470 DataArrayIdType *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1471 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const;
1472 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const;
1473 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const;
1474 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const;
1477 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1479 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1482 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1484 return MEDFileUMesh::New(fileName,mrs);
1487 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem)
1489 return MEDFileUMesh::New(mem);
1492 MEDFileUMesh(DataArrayByte *db)
1494 return MEDFileUMesh::New(db);
1499 return MEDFileUMesh::New();
1502 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)
1504 std::vector<int> typesCpp1;
1505 convertPyToNewIntArr3(types,typesCpp1);
1506 std::size_t sz(typesCpp1.size());
1507 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1508 for(std::size_t ii=0;ii<sz;ii++)
1509 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1510 return MEDFileUMesh::LoadConnectivityOnlyPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs).retn();
1513 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)
1515 std::vector<int> typesCpp1;
1516 convertPyToNewIntArr3(types,typesCpp1);
1517 std::size_t sz(typesCpp1.size());
1518 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1519 for(std::size_t ii=0;ii<sz;ii++)
1520 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1521 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1524 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)
1526 MCAuto<DataArrayDouble> coords;
1527 MCAuto<PartDefinition> partCoords;
1528 MCAuto<DataArrayIdType> famCoords,numCoords;
1529 MCAuto<DataArrayAsciiChar> nameCoord;
1530 MEDFileUMesh::LoadPartCoords(fileName,mName,dt,it,infosOnComp,startNodeId,stopNodeId,coords,partCoords,famCoords,numCoords,nameCoord);
1531 PyObject *ret(PyTuple_New(5));
1532 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1533 PyTuple_SetItem(ret,1,convertPartDefinition(partCoords.retn(),SWIG_POINTER_OWN | 0));
1534 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(famCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1535 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(numCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1536 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(nameCoord.retn()),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 ));
1540 PyObject *__getstate__()
1542 std::vector<double> a0;
1543 std::vector<mcIdType> a1;
1544 std::vector<std::string> a2;
1545 std::vector< MCAuto<DataArrayIdType> > a3;
1546 MCAuto<DataArrayDouble> a4;
1547 self->serialize(a0,a1,a2,a3,a4);
1548 PyObject *ret(PyTuple_New(5));
1549 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1550 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1551 std::size_t sz(a2.size());
1552 PyObject *ret2(PyList_New(sz));
1553 for(std::size_t i=0;i<sz;i++)
1554 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1555 PyTuple_SetItem(ret,2,ret2);
1557 PyObject *ret3(PyList_New(sz));
1558 for(std::size_t i=0;i<sz;i++)
1560 DataArrayIdType *elt(a3[i]);
1563 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1565 PyTuple_SetItem(ret,3,ret3);
1566 DataArrayDouble *ret4(a4);
1569 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1573 void __setstate__(PyObject *inp)
1575 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1576 if(!PyTuple_Check(inp))
1577 throw INTERP_KERNEL::Exception(MSG);
1578 std::size_t sz(PyTuple_Size(inp));
1580 throw INTERP_KERNEL::Exception(MSG);
1581 std::vector<double> a0;
1582 std::vector<mcIdType> a1;
1583 std::vector<std::string> a2;
1584 std::vector< MCAuto<DataArrayIdType> > a3;
1585 MCAuto<DataArrayDouble> a4;
1587 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1589 fillArrayWithPyListDbl3(a0py,tmp,a0);
1590 convertPyToNewIntArr3(a1py,a1);
1591 fillStringVector(a2py,a2);
1593 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1595 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1596 if(!SWIG_IsOK(status))
1597 throw INTERP_KERNEL::Exception(MSG);
1598 a4=reinterpret_cast<DataArrayDouble *>(argp);
1599 if((DataArrayDouble *)a4)
1602 std::vector< DataArrayIdType * > a3Tmp;
1603 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayIdType *>(b0py,SWIGTITraits<mcIdType>::TI,"DataArrayInt",a3Tmp);
1604 std::size_t sz(a3Tmp.size());
1606 for(std::size_t i=0;i<sz;i++)
1610 a3Tmp[i]->incrRef();
1612 self->unserialize(a0,a1,a2,a3,a4);
1616 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh)
1619 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1620 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1623 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1626 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1629 self->setMeshAtLevel(meshDimRelToMax,m1);
1632 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1635 void __delitem__(int meshDimRelToMax)
1637 self->removeMeshAtLevel(meshDimRelToMax);
1640 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const
1642 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1644 DataArrayDouble *a,*a2;
1645 DataArrayDoubleTuple *aa,*aa2;
1646 std::vector<double> bb,bb2;
1648 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1649 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1650 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1654 static MEDFileUMesh *Aggregate(PyObject *meshes)
1656 std::vector<const MEDFileUMesh *> meshesCpp;
1657 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1658 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1662 PyObject *getAllDistributionOfTypes() const
1664 std::vector< std::pair<int,mcIdType> > ret(self->getAllDistributionOfTypes());
1665 return convertVecPairIntToPy(ret);
1668 DataArrayIdType *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const
1670 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1671 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1672 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1675 MEDFileUMesh *extractPart(PyObject *extractDef) const
1677 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1678 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1679 return self->extractPart(extractDefCpp);
1682 void setMeshes(PyObject *li, bool renum=false)
1684 std::vector<const MEDCouplingUMesh *> ms;
1685 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1686 self->setMeshes(ms,renum);
1689 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false)
1691 std::vector<const MEDCouplingUMesh *> ms;
1692 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1693 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1696 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false)
1698 std::vector<const MEDCouplingUMesh *> ms;
1699 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1700 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1703 DataArrayDouble *getCoords() const
1705 DataArrayDouble *ret=self->getCoords();
1711 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const
1713 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1716 return const_cast<PartDefinition *>(ret);
1719 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1)
1721 DataArrayIdType *ret0=0,*ret1=0,*ret2=0;
1722 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1723 PyObject *ret=PyTuple_New(3);
1724 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1725 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1726 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1730 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const
1732 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1738 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const
1740 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1741 std::size_t sz(tmp.size());
1742 PyObject *ret=PyList_New(sz);
1743 for(std::size_t i=0;i<sz;i++)
1747 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1754 class MEDFileStructuredMesh : public MEDFileMesh
1759 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const
1761 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1769 class MEDFileCMesh : public MEDFileStructuredMesh
1772 static MEDFileCMesh *New();
1773 static MEDFileCMesh *New(DataArrayByte *db);
1774 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1775 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1776 void setMesh(MEDCouplingCMesh *m);
1777 int getSpaceDimension() const;
1782 return MEDFileCMesh::New();
1785 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1787 return MEDFileCMesh::New(fileName,mrs);
1790 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1792 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1795 MEDFileCMesh(DataArrayByte *db)
1797 return MEDFileCMesh::New(db);
1800 PyObject *getMesh() const
1802 const MEDCouplingCMesh *tmp=self->getMesh();
1805 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1810 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1813 static MEDFileCurveLinearMesh *New();
1814 static MEDFileCurveLinearMesh *New(DataArrayByte *db);
1815 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1816 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1817 void setMesh(MEDCouplingCurveLinearMesh *m);
1818 int getSpaceDimension() const;
1819 int getMeshDimension() const;
1822 MEDFileCurveLinearMesh()
1824 return MEDFileCurveLinearMesh::New();
1827 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1829 return MEDFileCurveLinearMesh::New(fileName,mrs);
1832 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1834 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1837 MEDFileCurveLinearMesh(DataArrayByte *db)
1839 return MEDFileCurveLinearMesh::New(db);
1842 PyObject *getMesh() const
1844 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1847 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1852 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1855 static MEDFileMeshMultiTS *New();
1856 static MEDFileMeshMultiTS *New(const std::string& fileName);
1857 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName);
1858 MEDFileMeshMultiTS *deepCopy() const;
1859 std::string getName() const;
1860 void setOneTimeStep(MEDFileMesh *mesh1TimeStep);
1861 void cartesianizeMe();
1864 MEDFileMeshMultiTS()
1866 return MEDFileMeshMultiTS::New();
1869 MEDFileMeshMultiTS(const std::string& fileName)
1871 return MEDFileMeshMultiTS::New(fileName);
1874 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName)
1876 return MEDFileMeshMultiTS::New(fileName,mName);
1879 MEDFileMesh *getOneTimeStep() const
1881 MEDFileMesh *ret=self->getOneTimeStep();
1889 class MEDFileMeshesIterator
1896 MEDFileMesh *ret=self->nextt();
1900 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1904 PyErr_SetString(PyExc_StopIteration,"No more data.");
1911 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1914 static MEDFileMeshes *New();
1915 static MEDFileMeshes *New(DataArrayByte *db);
1916 MEDFileMeshes *deepCopy() const;
1917 int getNumberOfMeshes() const;
1918 std::vector<std::string> getMeshesNames() const;
1920 void resize(int newSize);
1921 void pushMesh(MEDFileMesh *mesh);
1922 void setMeshAtPos(int i, MEDFileMesh *mesh);
1923 void destroyMeshAtPos(int i);
1924 void cartesianizeMe();
1925 bool presenceOfStructureElements() const;
1926 void killStructureElements();
1931 return MEDFileMeshes::New();
1934 MEDFileMeshes(const std::string& fileName)
1936 return MEDFileMeshes::New(fileName);
1939 MEDFileMeshes(DataArrayByte *db)
1941 return MEDFileMeshes::New(db);
1944 std::string __str__() const
1946 return self->simpleRepr();
1949 MEDFileMesh *__getitem__(PyObject *obj)
1951 static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
1952 if(PyInt_Check(obj))
1954 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1959 MEDFileMesh *ret(self->getMeshWithName(convertPyObjectToStr(obj,msg)));
1965 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh)
1967 self->setMeshAtPos(obj,mesh);
1971 MEDFileMeshesIterator *__iter__()
1973 return self->iterator();
1978 return self->getNumberOfMeshes();
1981 MEDFileMesh *getMeshAtPos(int i) const
1983 MEDFileMesh *ret=self->getMeshAtPos(i);
1988 MEDFileMesh *getMeshWithName(const std::string& mname) const
1990 MEDFileMesh *ret=self->getMeshWithName(mname);
1998 class MEDFileFieldLoc : public RefCountObject
2001 std::string getName() const;
2002 int getDimension() const;
2003 int getNumberOfGaussPoints() const;
2004 int getNumberOfPointsInCells() const;
2005 const std::vector<double>& getRefCoords() const;
2006 const std::vector<double>& getGaussCoords() const;
2007 const std::vector<double>& getGaussWeights() const;
2008 bool isEqual(const MEDFileFieldLoc& other, double eps) const;
2011 std::string __str__() const
2013 return self->repr();
2018 class MEDFileFieldGlobsReal
2021 void resetContent();
2022 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
2023 void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
2024 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2025 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2026 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
2027 void checkGlobsCoherency() const;
2028 void checkGlobsPflsPartCoherency() const;
2029 void checkGlobsLocsPartCoherency() const;
2030 std::vector<std::string> getPfls() const;
2031 std::vector<std::string> getLocs() const;
2032 bool existsPfl(const std::string& pflName) const;
2033 bool existsLoc(const std::string& locName) const;
2034 std::string createNewNameOfPfl() const;
2035 std::string createNewNameOfLoc() const;
2036 std::vector< std::vector<int> > whichAreEqualProfiles() const;
2037 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
2038 virtual std::vector<std::string> getPflsReallyUsed() const;
2039 virtual std::vector<std::string> getLocsReallyUsed() const;
2040 virtual std::vector<std::string> getPflsReallyUsedMulti() const;
2041 virtual std::vector<std::string> getLocsReallyUsedMulti() const;
2042 void killProfileIds(const std::vector<int>& pflIds);
2043 void killLocalizationIds(const std::vector<int>& locIds);
2044 void changePflName(const std::string& oldName, const std::string& newName);
2045 void changeLocName(const std::string& oldName, const std::string& newName);
2046 int getNbOfGaussPtPerCell(int locId) const;
2047 int getLocalizationId(const std::string& loc) const;
2048 int getProfileId(const std::string& pfl) const;
2049 void killStructureElementsInGlobs();
2052 PyObject *getProfile(const std::string& pflName) const
2054 const DataArrayIdType *ret=self->getProfile(pflName);
2057 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2060 PyObject *getProfileFromId(int pflId) const
2062 const DataArrayIdType *ret=self->getProfileFromId(pflId);
2065 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2068 PyObject *getLocalizationFromId(int locId) const
2070 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
2073 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2076 PyObject *getLocalization(const std::string& locName) const
2078 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
2081 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2084 PyObject *zipPflsNames()
2086 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
2087 return convertVecPairVecStToPy(ret);
2090 PyObject *zipLocsNames(double eps)
2092 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
2093 return convertVecPairVecStToPy(ret);
2096 void changePflsNames(PyObject *li)
2098 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2099 self->changePflsNames(v);
2102 void changePflsRefsNamesGen(PyObject *li)
2104 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2105 self->changePflsRefsNamesGen(v);
2108 void changePflsNamesInStruct(PyObject *li)
2110 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2111 self->changePflsNamesInStruct(v);
2114 void changeLocsNames(PyObject *li)
2116 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2117 self->changeLocsNames(v);
2120 void changeLocsRefsNamesGen(PyObject *li)
2122 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2123 self->changeLocsRefsNamesGen(v);
2126 void changeLocsNamesInStruct(PyObject *li)
2128 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2129 self->changeLocsNamesInStruct(v);
2132 std::string simpleReprGlobs() const
2134 std::ostringstream oss;
2135 self->simpleReprGlobs(oss);
2141 class MEDFileEntities
2146 static MEDFileEntities *BuildFrom(PyObject *entities)
2148 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2149 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2151 std::size_t sz(inp0.size());
2153 for(std::size_t i=0;i<sz;i++)
2154 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2156 return MEDFileEntities::BuildFrom(&inp);
2163 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2166 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
2167 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2168 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2169 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
2171 void loadArraysIfNecessary();
2172 void unloadArrays();
2173 void unloadArraysWithoutDataLoss();
2174 int getDimension() const;
2175 int getIteration() const;
2176 int getOrder() const;
2177 std::string getName();
2178 void setName(const std::string& name);
2179 std::string getMeshName();
2180 void setMeshName(const std::string& newMeshName);
2181 int getMeshIteration() const;
2182 int getMeshOrder() const;
2183 int getNumberOfComponents() const;
2184 bool isDealingTS(int iteration, int order) const;
2185 void setInfo(const std::vector<std::string>& infos);
2186 const std::vector<std::string>& getInfo() const;
2187 bool presenceOfMultiDiscPerGeoType() const;
2188 void setTime(int iteration, int order, double val);
2189 virtual MEDFileAnyTypeField1TS *shallowCpy() const;
2190 MEDFileAnyTypeField1TS *deepCopy() const;
2191 std::string getDtUnit() const;
2192 void setDtUnit(const std::string& dtUnit);
2198 double tmp0=self->getTime(tmp1,tmp2);
2199 PyObject *res = PyList_New(3);
2200 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2201 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2202 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2206 PyObject *getDtIt() const
2208 std::pair<int,int> res=self->getDtIt();
2209 PyObject *elt=PyTuple_New(2);
2210 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2211 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2215 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false)
2217 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2220 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false)
2222 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2225 bool changeMeshNames(PyObject *li)
2227 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2228 return self->changeMeshNames(modifTab);
2231 PyObject *getTypesOfFieldAvailable() const
2233 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2234 PyObject *ret2=PyList_New(ret.size());
2235 for(int i=0;i<(int)ret.size();i++)
2236 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2240 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const
2242 std::vector<int> ret1;
2243 int ret0=self->getNonEmptyLevels(mname,ret1);
2244 PyObject *elt=PyTuple_New(2);
2245 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2246 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2250 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const
2252 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2253 std::vector< std::vector<TypeOfField> > typesF;
2254 std::vector< std::vector<std::string> > pfls;
2255 std::vector< std::vector<std::string> > locs;
2256 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2257 std::size_t sz=ret.size();
2258 PyObject *ret2=PyList_New(sz);
2259 for(std::size_t i=0;i<sz;i++)
2261 const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2262 const std::vector<TypeOfField>& typesFI=typesF[i];
2263 const std::vector<std::string>& pflsI=pfls[i];
2264 const std::vector<std::string>& locsI=locs[i];
2265 PyObject *elt=PyTuple_New(2);
2266 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2267 std::size_t sz2=ret[i].size();
2268 PyObject *elt2=PyList_New(sz2);
2269 for(std::size_t j=0;j<sz2;j++)
2271 PyObject *elt3=PyTuple_New(4);
2272 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2273 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2274 PyTuple_SetItem(elt3,1,elt4);
2275 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2276 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2277 PyList_SetItem(elt2,j,elt3);
2279 PyTuple_SetItem(elt,1,elt2);
2280 PyList_SetItem(ret2,i,elt);
2285 PyObject *splitComponents() const
2287 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2288 std::size_t sz=ret.size();
2289 PyObject *retPy=PyList_New(sz);
2290 for(std::size_t i=0;i<sz;i++)
2291 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2295 PyObject *splitDiscretizations() const
2297 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2298 std::size_t sz=ret.size();
2299 PyObject *retPy=PyList_New(sz);
2300 for(std::size_t i=0;i<sz;i++)
2301 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2305 PyObject *splitMultiDiscrPerGeoTypes() const
2307 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2308 std::size_t sz=ret.size();
2309 PyObject *retPy=PyList_New(sz);
2310 for(std::size_t i=0;i<sz;i++)
2311 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2315 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2317 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2318 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2319 return self->extractPart(extractDefCpp,mm);
2324 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2327 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2328 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2329 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
2330 static MEDFileField1TS *New(DataArrayByte *db);
2331 static MEDFileField1TS *New();
2332 MEDCoupling::MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const;
2333 MEDCoupling::MEDFileInt64Field1TS *convertToInt64(bool isDeepCpyGlobs=true) const;
2334 void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf);
2335 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
2336 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2337 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2338 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2339 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2340 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2342 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
2343 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2344 void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2345 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
2346 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
2349 MEDFileField1TS(const std::string& fileName, bool loadAll=true)
2351 return MEDFileField1TS::New(fileName,loadAll);
2354 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2356 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2359 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2361 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2364 MEDFileField1TS(DataArrayByte *db)
2366 return MEDFileField1TS::New(db);
2371 return MEDFileField1TS::New();
2374 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field)
2376 const DataArrayDouble *arr=0;
2378 arr=field->getArray();
2379 self->copyTinyInfoFrom(field,arr);
2382 std::string __str__() const
2384 return self->simpleRepr();
2387 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2389 return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
2392 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const
2394 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2395 std::vector< std::vector<TypeOfField> > typesF;
2396 std::vector< std::vector<std::string> > pfls;
2397 std::vector< std::vector<std::string> > locs;
2398 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2399 std::size_t sz=ret.size();
2400 PyObject *ret2=PyList_New(sz);
2401 for(std::size_t i=0;i<sz;i++)
2403 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2404 const std::vector<TypeOfField>& typesFI=typesF[i];
2405 const std::vector<std::string>& pflsI=pfls[i];
2406 const std::vector<std::string>& locsI=locs[i];
2407 PyObject *elt=PyTuple_New(2);
2408 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2409 std::size_t sz2=ret[i].size();
2410 PyObject *elt2=PyList_New(sz2);
2411 for(std::size_t j=0;j<sz2;j++)
2413 PyObject *elt3=PyTuple_New(4);
2414 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2415 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2416 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2417 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2418 PyList_SetItem(elt2,j,elt3);
2420 PyTuple_SetItem(elt,1,elt2);
2421 PyList_SetItem(ret2,i,elt);
2426 DataArrayDouble *getUndergroundDataArray() const
2428 DataArrayDouble *ret=self->getUndergroundDataArray();
2434 PyObject *getUndergroundDataArrayExt() const
2436 return MEDFileField1TS_getUndergroundDataArrayExt<double>(self);
2441 class MEDFileInt32Field1TS : public MEDFileAnyTypeField1TS
2444 static MEDFileInt32Field1TS *New();
2445 static MEDFileInt32Field1TS *New(const std::string& fileName, bool loadAll=true);
2446 static MEDFileInt32Field1TS *New(DataArrayByte *db);
2447 static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2448 static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2449 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2451 void setFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
2452 void setFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2453 void setFieldProfileFlatly(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2454 void copyTimeInfoFrom(MEDCouplingFieldInt32 *mcf);
2455 MEDCouplingFieldInt32 *field(const MEDFileMesh *mesh) const;
2456 MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2457 MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2458 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2459 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2460 MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2463 MEDFileInt32Field1TS()
2465 return MEDFileInt32Field1TS::New();
2468 MEDFileInt32Field1TS(const std::string& fileName, bool loadAll=true)
2470 return MEDFileInt32Field1TS::New(fileName,loadAll);
2473 MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2475 return MEDFileInt32Field1TS::New(fileName,fieldName,loadAll);
2478 MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2480 return MEDFileInt32Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2483 MEDFileInt32Field1TS(DataArrayByte *db)
2485 return MEDFileInt32Field1TS::New(db);
2488 std::string __str__() const
2490 return self->simpleRepr();
2493 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2495 return MEDFileField1TS_getFieldWithProfile<Int32>(self,type,meshDimRelToMax,mesh);
2498 DataArrayInt32 *getUndergroundDataArray() const
2500 DataArrayInt32 *ret=self->getUndergroundDataArray();
2506 PyObject *getUndergroundDataArrayExt() const
2508 return MEDFileField1TS_getUndergroundDataArrayExt<Int32>(self);
2513 class MEDFileInt64Field1TS : public MEDFileAnyTypeField1TS
2516 static MEDFileInt64Field1TS *New();
2517 static MEDFileInt64Field1TS *New(const std::string& fileName, bool loadAll=true);
2518 static MEDFileInt64Field1TS *New(DataArrayByte *db);
2519 static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2520 static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2521 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2523 void setFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
2524 void setFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2525 void setFieldProfileFlatly(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2526 void copyTimeInfoFrom(MEDCouplingFieldInt64 *mcf);
2527 MEDCouplingFieldInt64 *field(const MEDFileMesh *mesh) const;
2528 MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2529 MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2530 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2531 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2532 MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2535 MEDFileInt64Field1TS()
2537 return MEDFileInt64Field1TS::New();
2540 MEDFileInt64Field1TS(const std::string& fileName, bool loadAll=true)
2542 return MEDFileInt64Field1TS::New(fileName,loadAll);
2545 MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2547 return MEDFileInt64Field1TS::New(fileName,fieldName,loadAll);
2550 MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2552 return MEDFileInt64Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2555 MEDFileInt64Field1TS(DataArrayByte *db)
2557 return MEDFileInt64Field1TS::New(db);
2560 std::string __str__() const
2562 return self->simpleRepr();
2565 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2567 return MEDFileField1TS_getFieldWithProfile<Int64>(self,type,meshDimRelToMax,mesh);
2570 DataArrayInt64 *getUndergroundDataArray() const
2572 DataArrayInt64 *ret=self->getUndergroundDataArray();
2578 PyObject *getUndergroundDataArrayExt() const
2580 return MEDFileField1TS_getUndergroundDataArrayExt<Int64>(self);
2585 class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
2588 static MEDFileFloatField1TS *New();
2589 static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true);
2590 static MEDFileFloatField1TS *New(DataArrayByte *db);
2591 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2592 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2593 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2595 void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
2596 void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2597 void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2598 void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf);
2599 MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const;
2600 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2601 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2602 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2603 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2604 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2607 MEDFileFloatField1TS()
2609 return MEDFileFloatField1TS::New();
2612 MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true)
2614 return MEDFileFloatField1TS::New(fileName,loadAll);
2617 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2619 return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
2622 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2624 return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
2627 MEDFileFloatField1TS(DataArrayByte *db)
2629 return MEDFileFloatField1TS::New(db);
2632 std::string __str__() const
2634 return self->simpleRepr();
2637 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2639 return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
2642 DataArrayFloat *getUndergroundDataArray() const
2644 DataArrayFloat *ret=self->getUndergroundDataArray();
2650 PyObject *getUndergroundDataArrayExt() const
2652 return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
2657 class MEDFileAnyTypeFieldMultiTSIterator
2664 MEDFileAnyTypeField1TS *ret=self->nextt();
2666 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2669 PyErr_SetString(PyExc_StopIteration,"No more data.");
2676 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2679 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
2680 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2681 MEDFileAnyTypeFieldMultiTS *deepCopy() const;
2682 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
2683 std::string getName() const;
2684 void setName(const std::string& name);
2685 std::string getDtUnit() const;
2686 void setDtUnit(const std::string& dtUnit);
2687 std::string getMeshName() const;
2688 void setMeshName(const std::string& newMeshName);
2689 void setInfo(const std::vector<std::string>& infos);
2690 const std::vector<std::string>& getInfo() const;
2691 bool presenceOfMultiDiscPerGeoType() const;
2692 int getNumberOfComponents() const;
2693 int getNumberOfTS() const;
2694 void eraseEmptyTS();
2695 int getPosOfTimeStep(int iteration, int order) const;
2696 int getPosGivenTime(double time, double eps=1e-8) const;
2698 void loadArraysIfNecessary();
2699 void unloadArrays();
2700 void unloadArraysWithoutDataLoss();
2702 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
2703 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
2704 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
2705 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
2706 void synchronizeNameScope();
2707 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const;
2712 return self->getNumberOfTS();
2715 int getTimeId(PyObject *elt0) const
2717 if(elt0 && PyInt_Check(elt0))
2719 int pos=(int)PyInt_AS_LONG(elt0);
2722 else if(elt0 && PyTuple_Check(elt0))
2724 if(PyTuple_Size(elt0)==2)
2726 PyObject *o0=PyTuple_GetItem(elt0,0);
2727 PyObject *o1=PyTuple_GetItem(elt0,1);
2728 if(PyInt_Check(o0) && PyInt_Check(o1))
2730 int iter=(int)PyInt_AS_LONG(o0);
2731 int order=(int)PyInt_AS_LONG(o1);
2732 return self->getPosOfTimeStep(iter,order);
2735 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 !");
2738 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 !");
2740 else if(elt0 && PyFloat_Check(elt0))
2742 double val=PyFloat_AS_DOUBLE(elt0);
2743 return self->getPosGivenTime(val);
2746 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2749 PyObject *getIterations() const
2751 std::vector< std::pair<int,int> > res(self->getIterations());
2752 return convertVecPairIntToPy(res);
2755 PyObject *getTimeSteps() const
2757 std::vector<double> ret1;
2758 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2759 std::size_t sz=ret.size();
2760 PyObject *ret2=PyList_New(sz);
2761 for(std::size_t i=0;i<sz;i++)
2763 PyObject *elt=PyTuple_New(3);
2764 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2765 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2766 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2767 PyList_SetItem(ret2,i,elt);
2772 PyObject *getTypesOfFieldAvailable() const
2774 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2775 PyObject *ret2=PyList_New(ret.size());
2776 for(int i=0;i<(int)ret.size();i++)
2778 const std::vector<TypeOfField>& rett=ret[i];
2779 PyObject *ret3=PyList_New(rett.size());
2780 for(int j=0;j<(int)rett.size();j++)
2781 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2782 PyList_SetItem(ret2,i,ret3);
2787 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const
2789 std::vector<int> ret1;
2790 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2791 PyObject *elt=PyTuple_New(2);
2792 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2793 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2797 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const
2799 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2800 std::vector< std::vector<TypeOfField> > typesF;
2801 std::vector< std::vector<std::string> > pfls;
2802 std::vector< std::vector<std::string> > locs;
2803 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2804 std::size_t sz=ret.size();
2805 PyObject *ret2=PyList_New(sz);
2806 for(std::size_t i=0;i<sz;i++)
2808 const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2809 const std::vector<TypeOfField>& typesFI=typesF[i];
2810 const std::vector<std::string>& pflsI=pfls[i];
2811 const std::vector<std::string>& locsI=locs[i];
2812 PyObject *elt=PyTuple_New(2);
2813 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2814 std::size_t sz2=ret[i].size();
2815 PyObject *elt2=PyList_New(sz2);
2816 for(std::size_t j=0;j<sz2;j++)
2818 PyObject *elt3=PyTuple_New(4);
2819 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2820 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2821 PyTuple_SetItem(elt3,1,elt4);
2822 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2823 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2824 PyList_SetItem(elt2,j,elt3);
2826 PyTuple_SetItem(elt,1,elt2);
2827 PyList_SetItem(ret2,i,elt);
2832 std::vector<int> getTimeIds(PyObject *elts) const
2834 if(PyList_Check(elts))
2836 std::size_t sz=PyList_Size(elts);
2837 std::vector<int> ret(sz);
2838 for(std::size_t i=0;i<sz;i++)
2840 PyObject *elt=PyList_GetItem(elts,i);
2841 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2847 std::vector<int> ret(1);
2848 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2853 void __delitem__(PyObject *elts)
2855 if(PySlice_Check(elts))
2857 Py_ssize_t strt=2,stp=2,step=2;
2858 GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2859 self->eraseTimeStepIds2((int)strt,(int)stp,(int)step);
2863 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2864 if(!idsToRemove.empty())
2865 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2869 void eraseTimeStepIds(PyObject *li)
2873 std::vector<int> pos2;
2874 DataArrayInt32 *pos3=0;
2875 DataArrayIntTuple *pos4=0;
2876 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2881 self->eraseTimeStepIds(&pos1,&pos1+1);
2888 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2893 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2897 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2901 MEDFileAnyTypeFieldMultiTSIterator *__iter__()
2903 return self->iterator();
2906 PyObject *__getitem__(PyObject *elt0) const
2908 if(elt0 && PyList_Check(elt0))
2910 std::size_t sz=PyList_Size(elt0);
2911 MCAuto<DataArrayInt32> da=DataArrayInt32::New(); da->alloc(sz,1);
2912 int *pt=da->getPointer();
2913 for(std::size_t i=0;i<sz;i++,pt++)
2915 PyObject *elt1=PyList_GetItem(elt0,i);
2916 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2918 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2920 else if(elt0 && PySlice_Check(elt0))
2922 Py_ssize_t strt=2,stp=2,step=2;
2923 GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2924 return convertMEDFileFieldMultiTS(self->buildSubPartSlice((int)strt,(int)stp,(int)step),SWIG_POINTER_OWN | 0);
2927 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2930 bool changeMeshNames(PyObject *li)
2932 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2933 return self->changeMeshNames(modifTab);
2936 PyObject *splitComponents() const
2938 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2939 std::size_t sz=ret.size();
2940 PyObject *retPy=PyList_New(sz);
2941 for(std::size_t i=0;i<sz;i++)
2942 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2946 PyObject *splitDiscretizations() const
2948 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2949 std::size_t sz=ret.size();
2950 PyObject *retPy=PyList_New(sz);
2951 for(std::size_t i=0;i<sz;i++)
2952 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2956 PyObject *splitMultiDiscrPerGeoTypes() const
2958 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2959 std::size_t sz=ret.size();
2960 PyObject *retPy=PyList_New(sz);
2961 for(std::size_t i=0;i<sz;i++)
2962 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2966 void pushBackTimeSteps(PyObject *li)
2969 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2970 if(SWIG_IsOK(status))
2972 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2976 std::vector<MEDFileAnyTypeField1TS *> tmp;
2977 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2978 self->pushBackTimeSteps(tmp);
2982 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2984 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2985 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2986 return self->extractPart(extractDefCpp,mm);
2989 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li)
2991 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2992 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2993 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2994 std::size_t sz=ret.size();
2995 PyObject *retPy=PyList_New(sz);
2996 for(std::size_t i=0;i<sz;i++)
2998 std::size_t sz2=ret[i].size();
2999 PyObject *ret1Py=PyList_New(sz2);
3000 for(std::size_t j=0;j<sz2;j++)
3002 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
3005 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
3007 PyList_SetItem(retPy,i,ret1Py);
3012 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh)
3014 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
3015 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
3016 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
3017 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
3018 if(ret2.size()!=ret.size())
3020 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
3021 throw INTERP_KERNEL::Exception(oss.str().c_str());
3023 std::size_t sz=ret.size();
3024 PyObject *retPy=PyList_New(sz);
3025 for(std::size_t i=0;i<sz;i++)
3027 std::size_t sz2=ret[i].size();
3028 PyObject *ret0Py=PyTuple_New(2);
3029 PyObject *ret1Py=PyList_New(sz2);
3030 for(std::size_t j=0;j<sz2;j++)
3032 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
3035 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
3037 PyTuple_SetItem(ret0Py,0,ret1Py);
3038 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
3039 PyList_SetItem(retPy,i,ret0Py);
3046 class MEDFileInt32FieldMultiTS;
3047 class MEDFileInt64FieldMultiTS;
3049 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3052 static MEDFileFieldMultiTS *New();
3053 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3054 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3055 static MEDFileFieldMultiTS *New(DataArrayByte *db);
3057 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
3058 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3059 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3060 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3061 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3062 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3064 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
3065 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3066 MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
3069 static MEDFileAnyTypeFieldMultiTS *Aggregate(PyObject *fmtssPy, PyObject *dtsPy)
3071 std::vector<const MEDFileAnyTypeFieldMultiTS *> fmtss;
3072 convertFromPyObjVectorOfObj<const MEDFileAnyTypeFieldMultiTS *>(fmtssPy,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",fmtss);
3073 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > dts2;
3074 convertPyToVectorVectorPairInt(dtsPy,dts2);
3075 std::vector< std::vector< std::pair<int,mcIdType> > > dts(MEDVectorVectorMIIterator(0,dts2),MEDVectorVectorMIIterator(dts2.size(),dts2));
3076 MCAuto<MEDFileAnyTypeFieldMultiTS> ret = MEDFileFieldMultiTS::Aggregate(fmtss,dts);
3080 MEDFileFieldMultiTS()
3082 return MEDFileFieldMultiTS::New();
3085 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true)
3087 return MEDFileFieldMultiTS::New(fileName,loadAll);
3090 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3092 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
3095 MEDFileFieldMultiTS(DataArrayByte *db)
3097 return MEDFileFieldMultiTS::New(db);
3100 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3102 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3103 std::size_t sz(tmp.size());
3104 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3105 for(std::size_t i=0;i<sz;i++)
3107 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3108 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3110 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3113 std::string __str__() const
3115 return self->simpleRepr();
3118 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3120 DataArrayIdType *ret1=0;
3121 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3122 PyObject *ret=PyTuple_New(2);
3123 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3124 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3128 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const
3130 std::vector<INTERP_KERNEL::NormalizedCellType> types;
3131 std::vector< std::vector<TypeOfField> > typesF;
3132 std::vector< std::vector<std::string> > pfls;
3133 std::vector< std::vector<std::string> > locs;
3134 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
3135 std::size_t sz=ret.size();
3136 PyObject *ret2=PyList_New(sz);
3137 for(std::size_t i=0;i<sz;i++)
3139 const std::vector<DataArrayDouble *>& dadsI=ret[i];
3140 const std::vector<TypeOfField>& typesFI=typesF[i];
3141 const std::vector<std::string>& pflsI=pfls[i];
3142 const std::vector<std::string>& locsI=locs[i];
3143 PyObject *elt=PyTuple_New(2);
3144 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
3145 std::size_t sz2=ret[i].size();
3146 PyObject *elt2=PyList_New(sz2);
3147 for(std::size_t j=0;j<sz2;j++)
3149 PyObject *elt3=PyTuple_New(4);
3150 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
3151 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3152 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
3153 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
3154 PyList_SetItem(elt2,j,elt3);
3156 PyTuple_SetItem(elt,1,elt2);
3157 PyList_SetItem(ret2,i,elt);
3161 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const
3163 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
3169 PyObject *getUndergroundDataArrayExt(int iteration, int order) const
3171 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > > elt1Cpp;
3172 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
3175 PyObject *ret=PyTuple_New(2);
3176 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3177 std::size_t sz=elt1Cpp.size();
3178 PyObject *elt=PyList_New(sz);
3179 for(std::size_t i=0;i<sz;i++)
3181 PyObject *elt1=PyTuple_New(2);
3182 PyObject *elt2=PyTuple_New(2);
3183 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
3184 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
3185 PyObject *elt3=PyTuple_New(2);
3186 PyTuple_SetItem(elt3,0,PyInt_FromLong(elt1Cpp[i].second.first));
3187 PyTuple_SetItem(elt3,1,PyInt_FromLong(elt1Cpp[i].second.second));
3188 PyTuple_SetItem(elt1,0,elt2);
3189 PyTuple_SetItem(elt1,1,elt3);
3190 PyList_SetItem(elt,i,elt1);
3192 PyTuple_SetItem(ret,1,elt);
3198 class MEDFileFieldsIterator
3205 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3207 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3210 PyErr_SetString(PyExc_StopIteration,"No more data.");
3217 class MEDFileInt32FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3220 static MEDFileInt32FieldMultiTS *New();
3221 static MEDFileInt32FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3222 static MEDFileInt32FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3223 static MEDFileInt32FieldMultiTS *New(DataArrayByte *db);
3225 void appendFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
3226 void appendFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3227 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3228 MEDCouplingFieldInt32 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3229 MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3230 MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3231 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3232 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3233 MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3236 MEDFileInt32FieldMultiTS()
3238 return MEDFileInt32FieldMultiTS::New();
3241 MEDFileInt32FieldMultiTS(const std::string& fileName, bool loadAll=true)
3243 return MEDFileInt32FieldMultiTS::New(fileName,loadAll);
3246 MEDFileInt32FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3248 return MEDFileInt32FieldMultiTS::New(fileName,fieldName,loadAll);
3251 MEDFileInt32FieldMultiTS(DataArrayByte *db)
3253 return MEDFileInt32FieldMultiTS::New(db);
3256 static MEDFileInt32FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3258 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3259 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3260 return MEDFileInt32FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3263 std::string __str__() const
3265 return self->simpleRepr();
3268 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3270 DataArrayIdType *ret1=0;
3271 DataArrayInt32 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3272 PyObject *ret=PyTuple_New(2);
3273 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int32>::TI, SWIG_POINTER_OWN | 0 ));
3274 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3278 DataArrayInt32 *getUndergroundDataArray(int iteration, int order) const
3280 DataArrayInt32 *ret=self->getUndergroundDataArray(iteration,order);
3288 class MEDFileInt64FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3291 static MEDFileInt64FieldMultiTS *New();
3292 static MEDFileInt64FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3293 static MEDFileInt64FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3294 static MEDFileInt64FieldMultiTS *New(DataArrayByte *db);
3296 void appendFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
3297 void appendFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3298 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3299 MEDCouplingFieldInt64 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3300 MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3301 MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3302 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3303 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3304 MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3307 MEDFileInt64FieldMultiTS()
3309 return MEDFileInt64FieldMultiTS::New();
3312 MEDFileInt64FieldMultiTS(const std::string& fileName, bool loadAll=true)
3314 return MEDFileInt64FieldMultiTS::New(fileName,loadAll);
3317 MEDFileInt64FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3319 return MEDFileInt64FieldMultiTS::New(fileName,fieldName,loadAll);
3322 MEDFileInt64FieldMultiTS(DataArrayByte *db)
3324 return MEDFileInt64FieldMultiTS::New(db);
3327 static MEDFileInt64FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3329 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3330 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3331 return MEDFileInt64FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3334 std::string __str__() const
3336 return self->simpleRepr();
3339 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3341 DataArrayIdType *ret1=0;
3342 DataArrayInt64 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3343 PyObject *ret=PyTuple_New(2);
3344 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int64>::TI, SWIG_POINTER_OWN | 0 ));
3345 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3349 DataArrayInt64 *getUndergroundDataArray(int iteration, int order) const
3351 DataArrayInt64 *ret=self->getUndergroundDataArray(iteration,order);
3359 class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3362 static MEDFileFloatFieldMultiTS *New();
3363 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3364 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3365 static MEDFileFloatFieldMultiTS *New(DataArrayByte *db);
3367 void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
3368 void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3369 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3370 MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const;
3371 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3372 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3373 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3374 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3375 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3378 MEDFileFloatFieldMultiTS()
3380 return MEDFileFloatFieldMultiTS::New();
3383 MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true)
3385 return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
3388 MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3390 return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
3393 MEDFileFloatFieldMultiTS(DataArrayByte *db)
3395 return MEDFileFloatFieldMultiTS::New(db);
3398 static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3400 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3401 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3402 return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3405 std::string __str__() const
3407 return self->simpleRepr();
3410 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3412 DataArrayIdType *ret1=0;
3413 DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3414 PyObject *ret=PyTuple_New(2);
3415 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
3416 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3420 DataArrayFloat *getUndergroundDataArray(int iteration, int order) const
3422 DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
3430 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3433 static MEDFileMeshSupports *New(const std::string& fileName);
3434 std::vector<std::string> getSupMeshNames() const;
3437 MEDFileUMesh *getSupMeshWithName(const std::string& name) const
3439 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3440 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3448 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3451 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms);
3453 MEDFileStructureElements();
3456 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3459 static MEDFileFields *New();
3460 static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
3461 static MEDFileFields *New(DataArrayByte *db);
3462 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities);
3463 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
3464 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
3465 MEDFileFields *deepCopy() const;
3466 MEDFileFields *shallowCpy() const;
3468 void loadArraysIfNecessary();
3469 void unloadArrays();
3470 void unloadArraysWithoutDataLoss();
3471 int getNumberOfFields() const;
3472 std::vector<std::string> getFieldsNames() const;
3473 std::vector<std::string> getMeshesNames() const;
3475 void resize(int newSize);
3476 void pushField(MEDFileAnyTypeFieldMultiTS *field);
3477 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
3478 int getPosFromFieldName(const std::string& fieldName) const;
3479 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
3480 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
3481 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
3482 bool presenceOfStructureElements() const;
3483 void aggregate(const MEDFileFields& other);
3484 void killStructureElements();
3485 void keepOnlyStructureElements();
3486 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
3487 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
3488 void destroyFieldAtPos(int i);
3489 bool removeFieldsWithoutAnyTimeStep();
3494 return MEDFileFields::New();
3497 MEDFileFields(const std::string& fileName, bool loadAll=true)
3499 return MEDFileFields::New(fileName,loadAll);
3502 MEDFileFields(DataArrayByte *db)
3504 return MEDFileFields::New(db);
3507 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities)
3509 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3512 std::string __str__() const
3514 return self->simpleRepr();
3517 MEDFileFields *partOfThisOnStructureElements() const
3519 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3523 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const
3525 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3529 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true)
3531 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3532 std::size_t sz(tmp.size());
3533 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3534 for(std::size_t i=0;i<sz;i++)
3536 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3537 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3539 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3542 PyObject *getMeshSENames() const
3544 std::vector< std::pair<std::string,std::string> > ps;
3545 self->getMeshSENames(ps);
3546 return convertVectPairStToPy(ps);
3549 PyObject *getCommonIterations() const
3552 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3553 PyObject *ret=PyTuple_New(2);
3554 PyObject *ret_0=PyList_New(ret0.size());
3556 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3558 PyObject *elt=PyTuple_New(2);
3559 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3560 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3561 PyList_SetItem(ret_0,rk,elt);
3563 PyTuple_SetItem(ret,0,ret_0);
3564 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3565 PyTuple_SetItem(ret,1,ret_1);
3569 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3571 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3572 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3575 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3577 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3578 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3581 PyObject *__getitem__(PyObject *obj)
3583 if(obj && PyList_Check(obj))
3585 std::size_t sz=PyList_Size(obj);
3586 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3587 int *pt=da->getPointer();
3588 for(std::size_t i=0;i<sz;i++,pt++)
3590 PyObject *elt1=PyList_GetItem(obj,i);
3591 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3593 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3596 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3599 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field)
3601 self->setFieldAtPos(obj,field);
3607 return self->getNumberOfFields();
3610 MEDFileFieldsIterator *__iter__()
3612 return self->iterator();
3615 bool changeMeshNames(PyObject *li)
3617 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3618 return self->changeMeshNames(modifTab);
3621 int getPosOfField(PyObject *elt0) const
3623 static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
3625 throw INTERP_KERNEL::Exception(msg);
3626 if(PyInt_Check(elt0))
3628 return (int)PyInt_AS_LONG(elt0);
3630 return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
3633 std::vector<int> getPosOfFields(PyObject *elts) const
3635 if(PyList_Check(elts))
3637 std::size_t sz=PyList_Size(elts);
3638 std::vector<int> ret(sz);
3639 for(std::size_t i=0;i<sz;i++)
3641 PyObject *elt=PyList_GetItem(elts,i);
3642 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3648 std::vector<int> ret(1);
3649 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3654 void pushFields(PyObject *fields)
3656 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3657 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3658 self->pushFields(tmp);
3661 void __delitem__(PyObject *elts)
3663 if(elts && PySlice_Check(elts))
3665 Py_ssize_t strt=2,stp=2,step=2;
3666 GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3667 self->destroyFieldsAtPos2((int)strt,(int)stp,(int)step);
3671 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3672 if(!idsToRemove.empty())
3673 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3677 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
3679 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
3680 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3681 return self->extractPart(extractDefCpp,mm);
3684 MEDFileFields *linearToQuadratic(const MEDFileMeshes *oldLin, const MEDFileMeshes *newQuad) const
3686 MCAuto<MEDFileFields> ret(self->linearToQuadratic(oldLin,newQuad));
3692 class MEDFileParameter1TS : public RefCountObject
3695 void setIteration(int it);
3696 int getIteration() const;
3697 void setOrder(int order);
3698 int getOrder() const;
3699 void setTimeValue(double time);
3700 void setTime(int dt, int it, double time);
3701 double getTime(int& dt, int& it);
3702 double getTimeValue() const;
3705 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3708 void setValue(double val);
3709 double getValue() const;
3710 std::string simpleRepr() const;
3713 std::string __str__() const
3715 return self->simpleRepr();
3720 class MEDFileParameterTinyInfo : public MEDFileWritable
3723 void setDescription(const std::string& name);
3724 std::string getDescription() const;
3725 void setTimeUnit(const std::string& unit);
3726 std::string getTimeUnit() const;
3729 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3732 static MEDFileParameterDouble1TS *New();
3733 static MEDFileParameterDouble1TS *New(const std::string& fileName);
3734 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName);
3735 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it);
3736 virtual MEDFileParameter1TS *deepCopy() const;
3737 virtual std::string simpleRepr() const;
3738 void setName(const std::string& name);
3739 std::string getName() const;
3740 void write(const std::string& fileName, int mode) const;
3743 MEDFileParameterDouble1TS()
3745 return MEDFileParameterDouble1TS::New();
3748 MEDFileParameterDouble1TS(const std::string& fileName)
3750 return MEDFileParameterDouble1TS::New(fileName);
3753 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName)
3755 return MEDFileParameterDouble1TS::New(fileName,paramName);
3758 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it)
3760 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3763 std::string __str__() const
3765 return self->simpleRepr();
3768 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const
3771 bool ret0=self->isEqual(other,eps,what);
3772 PyObject *res=PyList_New(2);
3773 PyObject *ret0Py=ret0?Py_True:Py_False;
3775 PyList_SetItem(res,0,ret0Py);
3776 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3782 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3785 static MEDFileParameterMultiTS *New();
3786 static MEDFileParameterMultiTS *New(const std::string& fileName);
3787 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName);
3788 std::string getName() const;
3789 void setName(const std::string& name);
3790 MEDFileParameterMultiTS *deepCopy() const;
3791 void write(const std::string& fileName, int mode) const;
3792 std::string simpleRepr() const;
3793 void appendValue(int dt, int it, double time, double val);
3794 double getDoubleValue(int iteration, int order) const;
3795 int getPosOfTimeStep(int iteration, int order) const;
3796 int getPosGivenTime(double time, double eps=1e-8) const;
3797 int getNumberOfTS() const;
3800 MEDFileParameterMultiTS()
3802 return MEDFileParameterMultiTS::New();
3805 MEDFileParameterMultiTS(const std::string& fileName)
3807 return MEDFileParameterMultiTS::New(fileName);
3810 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3812 return MEDFileParameterMultiTS::New(fileName,paramName);
3815 std::string __str__() const
3817 return self->simpleRepr();
3820 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const
3823 bool ret0=self->isEqual(other,eps,what);
3824 PyObject *res=PyList_New(2);
3825 PyObject *ret0Py=ret0?Py_True:Py_False;
3827 PyList_SetItem(res,0,ret0Py);
3828 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3832 void eraseTimeStepIds(PyObject *ids)
3836 std::vector<int> pos2;
3837 DataArrayInt *pos3=0;
3838 DataArrayIntTuple *pos4=0;
3839 convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3844 self->eraseTimeStepIds(&pos1,&pos1+1);
3851 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3856 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3860 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3864 int getTimeStepId(PyObject *elt0) const
3866 if(elt0 && PyInt_Check(elt0))
3868 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3871 else if(elt0 && PyTuple_Check(elt0))
3873 if(PyTuple_Size(elt0)==2)
3875 PyObject *o0=PyTuple_GetItem(elt0,0);
3876 PyObject *o1=PyTuple_GetItem(elt0,1);
3877 if(PyInt_Check(o0) && PyInt_Check(o1))
3879 int iter=(int)PyInt_AS_LONG(o0);
3880 int order=(int)PyInt_AS_LONG(o1);
3881 return self->getPosOfTimeStep(iter,order);
3884 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 !");
3887 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 !");
3889 else if(elt0 && PyFloat_Check(elt0))
3891 double val=PyFloat_AS_DOUBLE(elt0);
3892 return self->getPosGivenTime(val);
3895 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3898 MEDFileParameter1TS *__getitem__(PyObject *elt0) const
3900 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3906 std::vector<int> getTimeStepIds(PyObject *elts) const
3908 if(PyList_Check(elts))
3910 std::size_t sz=PyList_Size(elts);
3911 std::vector<int> ret(sz);
3912 for(std::size_t i=0;i<sz;i++)
3914 PyObject *elt=PyList_GetItem(elts,i);
3915 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3921 std::vector<int> ret(1);
3922 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3927 void __delitem__(PyObject *elts)
3929 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3930 if(!idsToRemove.empty())
3931 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3934 MEDFileParameter1TS *getTimeStepAtPos(int posId) const
3936 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3942 PyObject *getIterations() const
3944 std::vector< std::pair<int,int> > res=self->getIterations();
3945 PyObject *ret=PyList_New(res.size());
3947 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3949 PyObject *elt=PyTuple_New(2);
3950 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3951 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3952 PyList_SetItem(ret,rk,elt);
3957 PyObject *getTimeSteps() const
3959 std::vector<double> res2;
3960 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3961 PyObject *ret=PyList_New(res.size());
3963 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3965 PyObject *elt=PyTuple_New(3);
3966 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3967 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3968 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3969 PyList_SetItem(ret,rk,elt);
3976 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3979 static MEDFileParameters *New();
3980 static MEDFileParameters *New(const std::string& fileName);
3981 static MEDFileParameters *New(DataArrayByte *db);
3982 MEDFileParameters *deepCopy() const;
3983 std::vector<std::string> getParamsNames() const;
3984 std::string simpleRepr() const;
3985 void resize(int newSize);
3986 void pushParam(MEDFileParameterMultiTS *param);
3987 void setParamAtPos(int i, MEDFileParameterMultiTS *param);
3988 void destroyParamAtPos(int i);
3989 int getPosFromParamName(const std::string& paramName) const;
3990 int getNumberOfParams() const;
3995 return MEDFileParameters::New();
3998 MEDFileParameters(const std::string& fileName)
4000 return MEDFileParameters::New(fileName);
4003 MEDFileParameters(DataArrayByte *db)
4005 return MEDFileParameters::New(db);
4008 std::string __str__() const
4010 return self->simpleRepr();
4013 MEDFileParameterMultiTS *__getitem__(PyObject *obj)
4015 static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
4016 if(PyInt_Check(obj))
4018 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
4023 MEDFileParameterMultiTS *ret(self->getParamWithName(convertPyObjectToStr(obj,msg)));
4031 return self->getNumberOfParams();
4034 MEDFileParameterMultiTS *getParamAtPos(int i) const
4036 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
4042 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const
4044 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
4050 PyObject *isEqual(const MEDFileParameters *other, double eps) const
4053 bool ret0=self->isEqual(other,eps,what);
4054 PyObject *res=PyList_New(2);
4055 PyObject *ret0Py=ret0?Py_True:Py_False;
4057 PyList_SetItem(res,0,ret0Py);
4058 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
4064 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
4067 static MEDFileData *New(DataArrayByte *db);
4068 static MEDFileData *New(const std::string& fileName);
4069 static MEDFileData *New();
4070 MEDFileData *deepCopy() const;
4071 void setFields(MEDFileFields *fields);
4072 void setMeshes(MEDFileMeshes *meshes);
4073 void setParams(MEDFileParameters *params);
4074 int getNumberOfFields() const;
4075 int getNumberOfMeshes() const;
4076 int getNumberOfParams() const;
4078 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName);
4079 bool unPolyzeMeshes();
4080 void dealWithStructureElements();
4081 std::string getHeader() const;
4082 void setHeader(const std::string& header);
4086 MEDFileData(const std::string& fileName)
4088 return MEDFileData::New(fileName);
4091 MEDFileData(DataArrayByte *db)
4093 return MEDFileData::New(db);
4098 return MEDFileData::New();
4101 std::string __str__() const
4103 return self->simpleRepr();
4106 MEDFileMeshes *getMeshes() const
4108 MEDFileMeshes *ret=self->getMeshes();
4114 MEDFileParameters *getParams() const
4116 MEDFileParameters *ret=self->getParams();
4122 MEDFileFields *getFields() const
4124 MEDFileFields *ret=self->getFields();
4130 bool changeMeshNames(PyObject *li)
4132 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
4133 return self->changeMeshNames(modifTab);
4136 static MEDFileData *Aggregate(PyObject *mfds)
4138 std::vector<const MEDFileData *> mfdsCpp;
4139 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
4140 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
4146 class SauvReader : public RefCountObject
4149 static SauvReader* New(const std::string& fileName);
4150 MEDFileData * loadInMEDFileDS();
4153 SauvReader(const std::string& fileName)
4155 return SauvReader::New(fileName);
4160 class SauvWriter : public RefCountObject
4163 static SauvWriter * New();
4164 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0);
4165 void write(const std::string& fileName);
4166 void setCpyGrpIfOnASingleFamilyStatus(bool status);
4167 bool getCpyGrpIfOnASingleFamilyStatus() const;
4172 return SauvWriter::New();
4179 class MEDFileMeshStruct;
4181 class MEDFileField1TSStructItem
4184 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt);
4187 class MEDFileMeshStruct : public RefCountObject
4190 static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
4192 ~MEDFileMeshStruct();
4195 class MEDMeshMultiLev : public RefCountObject
4198 virtual MEDMeshMultiLev *prepare() const;
4199 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const;
4200 DataArrayIdType *retrieveGlobalNodeIdsIfAny() const;
4206 PyObject *retrieveFamilyIdsOnCells() const
4208 DataArrayIdType *famIds(0);
4209 bool isWithoutCopy(false);
4210 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
4211 PyObject *ret=PyTuple_New(2);
4212 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4214 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4215 PyTuple_SetItem(ret,1,ret1Py);
4219 PyObject *retrieveNumberIdsOnCells() const
4221 DataArrayIdType *numIds(0);
4222 bool isWithoutCopy(false);
4223 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
4224 PyObject *ret=PyTuple_New(2);
4225 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4227 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4228 PyTuple_SetItem(ret,1,ret1Py);
4232 PyObject *retrieveFamilyIdsOnNodes() const
4234 DataArrayIdType *famIds(0);
4235 bool isWithoutCopy(false);
4236 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
4237 PyObject *ret=PyTuple_New(2);
4238 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4240 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4241 PyTuple_SetItem(ret,1,ret1Py);
4245 PyObject *retrieveNumberIdsOnNodes() const
4247 DataArrayIdType *numIds(0);
4248 bool isWithoutCopy(false);
4249 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
4250 PyObject *ret=PyTuple_New(2);
4251 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4253 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4254 PyTuple_SetItem(ret,1,ret1Py);
4258 PyObject *getGeoTypes() const
4260 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
4261 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4262 PyObject *res(PyList_New(result.size()));
4263 for(int i=0;iL!=result.end(); i++, iL++)
4264 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4270 class MEDUMeshMultiLev : public MEDMeshMultiLev
4273 ~MEDUMeshMultiLev();
4277 PyObject *buildVTUArrays() const
4279 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayIdType *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
4280 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
4281 PyObject *ret0Py=ncc?Py_True:Py_False;
4283 PyObject *ret=PyTuple_New(7);
4284 PyTuple_SetItem(ret,0,ret0Py);
4285 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4286 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
4287 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4288 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4289 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4290 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4296 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
4299 ~MEDStructuredMeshMultiLev();
4302 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4305 ~MEDCMeshMultiLev();
4309 PyObject *buildVTUArrays() const
4312 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4313 std::size_t sz(objs.size());
4314 PyObject *ret(PyTuple_New(2));
4315 PyObject *ret0=PyList_New(sz);
4316 for(std::size_t i=0;i<sz;i++)
4317 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4318 PyTuple_SetItem(ret,0,ret0);
4319 PyObject *ret1Py(isInternal?Py_True:Py_False);
4321 PyTuple_SetItem(ret,1,ret1Py);
4327 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4330 ~MEDCurveLinearMeshMultiLev();
4334 PyObject *buildVTUArrays() const
4336 DataArrayDouble *ret0(0);
4337 std::vector<mcIdType> ret1;
4339 self->buildVTUArrays(ret0,ret1,ret2);
4340 std::size_t sz(ret1.size());
4341 PyObject *ret=PyTuple_New(3);
4342 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4343 PyObject *ret1Py=PyList_New(sz);
4344 for(std::size_t i=0;i<sz;i++)
4345 PyList_SetItem(ret1Py,i,PyInt_FromLong(ret1[i]));
4346 PyTuple_SetItem(ret,1,ret1Py);
4347 PyObject *ret2Py(ret2?Py_True:Py_False);
4349 PyTuple_SetItem(ret,2,ret2Py);
4355 class MEDFileFastCellSupportComparator : public RefCountObject
4358 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
4359 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4360 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4361 int getNumberOfTS() const;
4363 ~MEDFileFastCellSupportComparator();
4367 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const
4369 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4370 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4371 PyObject *res(PyList_New(result.size()));
4372 for(int i=0;iL!=result.end(); i++, iL++)
4373 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4379 class MeshFormatReader
4382 MeshFormatReader(const std::string& meshFileName, const std::vector<std::string>& fieldFileName);
4384 MEDFileData* loadInMedFileDS();
4385 void setMeshName(const std::string& theMeshName);
4386 std::string getMeshName() const;
4387 void setFile(const std::string& theFileName);
4388 void setFieldFileNames(const std::vector<std::string>& theFieldFileNames);
4389 std::vector<std::string> getFieldFileNames() const;
4391 class MeshFormatWriter
4394 MeshFormatWriter(const std::string& meshFileName, const std::vector<std::string>& fieldFileNames);
4396 void setMeshFileName(const std::string& meshFileName);
4397 std::string getMeshFileName() const;
4398 void setFieldFileNames(const std::vector<std::string>& fieldFileNames);
4399 std::vector<std::string> getFieldFileNames() const;
4400 void setMEDFileDS(MEDCoupling::MEDFileData* mfd);
4410 def exit1TS(self, exctype, exc, tb):
4413 MEDFileAnyTypeField1TS.__enter__=enter1TS
4414 MEDFileAnyTypeField1TS.__exit__=exit1TS
4415 MEDFileIntField1TS = MEDFileInt32Field1TS
4416 MEDFileIntFieldMultiTS = MEDFileInt32FieldMultiTS
4417 if MEDCouplingUse64BitIDs():
4418 MEDFileIDField1TS = MEDFileInt64Field1TS
4419 MEDFileIDFieldMultiTS = MEDFileInt64FieldMultiTS
4421 MEDFileIDField1TS = MEDFileInt32Field1TS
4422 MEDFileIDFieldMultiTS = MEDFileInt32FieldMultiTS