1 // Copyright (C) 2017-2024 CEA, EDF
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
21 #define MEDCOUPLING_EXPORT
22 #define MEDLOADER_EXPORT
24 #ifdef WITH_DOCSTRINGS
25 %include "MEDLoader_doc.i"
28 %include "MEDCouplingCommon.i"
31 #include "MEDLoader.hxx"
32 #include "MEDFileJoint.hxx"
33 #include "MEDFileMesh.hxx"
34 #include "MEDFileField.hxx"
35 #include "MEDFileParameter.hxx"
36 #include "MEDFileData.hxx"
37 #include "MEDFileEquivalence.hxx"
38 #include "MEDFileEntities.hxx"
39 #include "MEDFileMeshReadSelector.hxx"
40 #include "MEDFileFieldOverView.hxx"
41 #include "MEDCouplingTypemaps.i"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
45 #include "MeshFormatReader.hxx"
46 #include "MeshFormatWriter.hxx"
48 using namespace MEDCoupling;
51 #if SWIG_VERSION >= 0x010329
52 %template() std::vector<std::string>;
55 %typemap(out) MEDCoupling::MEDFileMesh*
57 $result=convertMEDFileMesh($1,$owner);
60 %typemap(out) MEDCoupling::MEDFileParameter1TS*
62 $result=convertMEDFileParameter1TS($1,$owner);
65 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
67 $result=convertMEDFileFieldMultiTS($1,$owner);
70 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
72 $result=convertMEDFileField1TS($1,$owner);
75 %typemap(out) MEDCoupling::MEDMeshMultiLev*
77 $result=convertMEDMeshMultiLev($1,$owner);
80 %newobject ReadUMeshFromFamiliesSwig;
81 %newobject ReadUMeshFromGroupsSwig;
82 %newobject ReadFieldSwig;
83 %newobject MEDCoupling::ReadUMeshFromFile;
84 %newobject MEDCoupling::ReadMeshFromFile;
85 %newobject MEDCoupling::ReadFieldCell;
86 %newobject MEDCoupling::ReadFieldNode;
87 %newobject MEDCoupling::ReadFieldGauss;
88 %newobject MEDCoupling::ReadFieldGaussNE;
89 %newobject MEDCoupling::MEDFileMesh::New;
90 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
91 %newobject MEDCoupling::MEDFileMesh::deepCopy;
92 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
93 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
94 %newobject MEDCoupling::MEDFileMesh::__getitem__;
95 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
96 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
97 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
98 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
101 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
102 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
103 %newobject MEDCoupling::MEDFileMesh::getGlobalNumFieldAtLevel;
104 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
105 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
106 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
107 %newobject MEDCoupling::MEDFileMesh::cartesianize;
108 %newobject MEDCoupling::MEDFileData::getJoints;
109 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
110 %newobject MEDCoupling::MEDFileUMesh::New;
111 %newobject MEDCoupling::MEDFileUMesh::LoadConnectivityOnlyPartOf;
112 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
113 %newobject MEDCoupling::MEDFileUMesh::getCoords;
114 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
115 %newobject MEDCoupling::MEDFileUMesh::getGroup;
116 %newobject MEDCoupling::MEDFileUMesh::getGroups;
117 %newobject MEDCoupling::MEDFileUMesh::getFamily;
118 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
119 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
120 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
121 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
122 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
123 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
124 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
125 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
126 %newobject MEDCoupling::MEDFileUMesh::computeFetchedNodeIds;
127 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
128 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
129 %newobject MEDCoupling::MEDFileUMesh::extractPart;
130 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
131 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
132 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
133 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
134 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
135 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
136 %newobject MEDCoupling::MEDFileCMesh::New;
137 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
138 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
139 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
140 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
141 %newobject MEDCoupling::MEDFileMeshes::New;
142 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
143 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
144 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
145 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
146 %newobject MEDCoupling::MEDFileMeshes::__iter__;
148 %newobject MEDCoupling::MEDFileMeshSupports::New;
149 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
151 %newobject MEDCoupling::MEDFileStructureElements::New;
153 %newobject MEDCoupling::MEDFileFields::New;
154 %newobject MEDCoupling::MEDFileFields::NewAdv;
155 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
156 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
157 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
158 %newobject MEDCoupling::MEDFileFields::deepCopy;
159 %newobject MEDCoupling::MEDFileFields::shallowCpy;
160 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
161 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
162 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
163 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
164 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
165 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
166 %newobject MEDCoupling::MEDFileFields::__iter__;
167 %newobject MEDCoupling::MEDFileFields::extractPart;
168 %newobject MEDCoupling::MEDFileFields::linearToQuadratic;
170 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
173 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
174 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
175 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
176 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
177 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
178 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
179 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
182 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
183 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
184 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
185 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
186 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
187 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
188 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
189 %newobject MEDCoupling::MEDFileFieldMultiTS::Aggregate;
191 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::New;
192 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::field;
193 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::LoadSpecificEntities;
194 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getUndergroundDataArray;
195 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::convertToDouble;
196 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevel;
197 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtTopLevel;
198 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldOnMeshAtLevel;
199 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevelOld;
201 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::New;
202 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::field;
203 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::LoadSpecificEntities;
204 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getUndergroundDataArray;
205 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::convertToDouble;
206 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevel;
207 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtTopLevel;
208 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldOnMeshAtLevel;
209 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevelOld;
211 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::New;
212 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::field;
213 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::LoadSpecificEntities;
214 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getUndergroundDataArray;
215 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::convertToDouble;
216 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevel;
217 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtTopLevel;
218 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldOnMeshAtLevel;
219 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevelOld;
221 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
222 %newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
223 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
224 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
225 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
226 %newobject MEDCoupling::MEDFileAnyTypeField1TS::buildNewEmpty;
227 %newobject MEDCoupling::MEDFileField1TS::New;
228 %newobject MEDCoupling::MEDFileField1TS::field;
229 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
230 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
231 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
232 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
233 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
234 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
235 %newobject MEDCoupling::MEDFileField1TS::convertToInt64;
237 %newobject MEDCoupling::MEDFileInt32Field1TS::New;
238 %newobject MEDCoupling::MEDFileInt32Field1TS::field;
239 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevel;
240 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtTopLevel;
241 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldOnMeshAtLevel;
242 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevelOld;
243 %newobject MEDCoupling::MEDFileInt32Field1TS::getUndergroundDataArray;
244 %newobject MEDCoupling::MEDFileInt32Field1TS::convertToDouble;
246 %newobject MEDCoupling::MEDFileInt64Field1TS::New;
247 %newobject MEDCoupling::MEDFileInt64Field1TS::field;
248 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevel;
249 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtTopLevel;
250 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldOnMeshAtLevel;
251 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevelOld;
252 %newobject MEDCoupling::MEDFileInt64Field1TS::getUndergroundDataArray;
253 %newobject MEDCoupling::MEDFileInt64Field1TS::convertToDouble;
255 %newobject MEDCoupling::MEDFileFloatField1TS::New;
256 %newobject MEDCoupling::MEDFileFloatField1TS::field;
257 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevel;
258 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtTopLevel;
259 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldOnMeshAtLevel;
260 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevelOld;
261 %newobject MEDCoupling::MEDFileFloatField1TS::getUndergroundDataArray;
262 %newobject MEDCoupling::MEDFileFloatField1TS::convertToDouble;
264 %newobject MEDCoupling::MEDFileData::New;
265 %newobject MEDCoupling::MEDFileData::deepCopy;
266 %newobject MEDCoupling::MEDFileData::getMeshes;
267 %newobject MEDCoupling::MEDFileData::getFields;
268 %newobject MEDCoupling::MEDFileData::getParams;
269 %newobject MEDCoupling::MEDFileData::Aggregate;
271 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
273 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
274 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
275 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
276 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
277 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
278 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
279 %newobject MEDCoupling::MEDFileParameters::New;
280 %newobject MEDCoupling::MEDFileParameters::deepCopy;
281 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
282 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
283 %newobject MEDCoupling::MEDFileParameters::__getitem__;
285 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
286 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
287 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
288 %newobject MEDCoupling::MEDFileJointCorrespondence::getCorrespondence;
289 %newobject MEDCoupling::MEDFileJointOneStep::New;
290 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
291 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
292 %newobject MEDCoupling::MEDFileJointOneStep::getCorrespondenceAtPos;
293 %newobject MEDCoupling::MEDFileJointOneStep::__getitem__;
294 %newobject MEDCoupling::MEDFileJoint::New;
295 %newobject MEDCoupling::MEDFileJoint::deepCopy;
296 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
297 %newobject MEDCoupling::MEDFileJoint::getStepAtPos;
298 %newobject MEDCoupling::MEDFileJoint::__getitem__;
299 %newobject MEDCoupling::MEDFileJoints::New;
300 %newobject MEDCoupling::MEDFileJoints::deepCopy;
301 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
302 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
303 %newobject MEDCoupling::MEDFileJoints::__getitem__;
304 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
305 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
306 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
307 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
308 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
309 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
310 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
311 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
312 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
314 %newobject MEDCoupling::SauvWriter::New;
315 %newobject MEDCoupling::SauvReader::New;
316 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
319 %newobject MEDCoupling::MEDFileMeshStruct::New;
320 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
321 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
322 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
323 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
324 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
326 %newobject MEDCoupling::MeshFormatReader::loadInMEDFileDS;
327 %newobject MEDCoupling::MeshFormatReader::MeshFormatReader;
328 %newobject MEDCoupling::MeshFormatWriter::MeshFormatWriter;
330 %feature("unref") MEDFileMesh "$this->decrRef();"
331 %feature("unref") MEDFileUMesh "$this->decrRef();"
332 %feature("unref") MEDFileCMesh "$this->decrRef();"
333 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
334 %feature("unref") MEDFileMeshes "$this->decrRef();"
335 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
336 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
337 %feature("unref") MEDFileField1TS "$this->decrRef();"
338 %feature("unref") MEDFileInt32Field1TS "$this->decrRef();"
339 %feature("unref") MEDFileInt64Field1TS "$this->decrRef();"
340 %feature("unref") MEDFileFloatField1TS "$this->decrRef();"
341 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
342 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
343 %feature("unref") MEDFileInt32FieldMultiTS "$this->decrRef();"
344 %feature("unref") MEDFileInt64FieldMultiTS "$this->decrRef();"
345 %feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();"
346 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
347 %feature("unref") MEDFileStructureElements "$this->decrRef();"
348 %feature("unref") MEDFileFields "$this->decrRef();"
349 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
350 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
351 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
352 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
353 %feature("unref") MEDFileParameters "$this->decrRef();"
354 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
355 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
356 %feature("unref") MEDFileJoint "$this->decrRef();"
357 %feature("unref") MEDFileJoints "$this->decrRef();"
358 %feature("unref") MEDFileEquivalences "$this->decrRef();"
359 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
360 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
361 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
362 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
363 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
364 %feature("unref") MEDFileData "$this->decrRef();"
365 %feature("unref") SauvReader "$this->decrRef();"
366 %feature("unref") SauvWriter "$this->decrRef();"
367 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
368 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
369 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
370 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
371 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
372 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
374 namespace MEDCoupling
377 std::string MEDFileVersionStr();
378 std::string MEDFileVersionOfFileStr(const std::string& fileName);
379 void SetEpsilonForNodeComp(double val);
380 void SetCompPolicyForCell(int val);
381 void SetTooLongStrPolicy(int val);
382 void CheckFileForRead(const std::string& fileName);
383 std::vector<std::string> GetMeshNames(const std::string& fileName);
384 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName);
385 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName);
386 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName);
387 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName);
388 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName);
389 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
390 std::vector<std::string> GetAllFieldNames(const std::string& fileName);
391 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName);
392 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
393 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
394 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order);
395 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj);
396 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
397 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
398 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
399 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
400 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName);
401 MEDCoupling::MEDCouplingField *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
402 MEDCoupling::MEDCouplingField *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
403 MEDCoupling::MEDCouplingField *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
404 MEDCoupling::MEDCouplingField *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
405 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch);
406 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
407 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
408 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
409 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
410 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingField *f);
413 %rename (MEDFileVersion) MEDFileVersionSwig;
414 %rename (GetFieldIterations) GetFieldIterationsSwig;
415 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
416 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
417 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
418 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
419 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
420 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
421 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
422 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
423 %rename (WriteUMeshes) WriteUMeshesSwig;
424 %rename (GetTypesOfField) GetTypesOfFieldSwig;
425 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
426 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
427 %rename (ReadField) ReadFieldSwig;
428 %rename (GetFamiliesGroupsInfo) GetFamiliesGroupsInfoSwig;
432 PyObject *MEDFileVersionSwig()
434 int major,minor,release;
435 MEDCoupling::MEDFileVersion(major,minor,release);
436 PyObject *ret(PyTuple_New(3));
437 PyTuple_SetItem(ret,0,SWIG_From_int(major));
438 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
439 PyTuple_SetItem(ret,2,SWIG_From_int(release));
443 int MEDFileSizeOfMedInt()
445 return 8*sizeof(med_int);
448 PyObject *GetFamiliesGroupsInfoSwig(const std::string& fileName, const std::string& meshName)
450 std::map<std::string,mcIdType> families;
451 std::map<std::string,std::vector<std::string>> groupsOnFam;
452 MEDCoupling::GetFamiliesGroupsInfo(fileName,meshName,families,groupsOnFam);
453 AutoPyPtr a(convertMapStringInt(families)),b(convertMapStringVectString(groupsOnFam));
454 AutoPyPtr ret(PyTuple_New(2));
455 PyTuple_SetItem(ret,0,a.retn());
456 PyTuple_SetItem(ret,1,b.retn());
460 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName)
462 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName));
466 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName)
468 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName));
472 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order)
474 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
478 MEDCoupling::MEDCouplingField *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
480 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
484 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
486 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
487 PyObject *ret=PyList_New(res.size());
489 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
491 PyObject *elt=PyTuple_New(2);
492 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
493 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
494 PyList_SetItem(ret,rk,elt);
499 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName)
501 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
502 PyObject *ret=PyList_New(res.size());
504 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
506 PyObject *elt=PyTuple_New(3);
507 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
508 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
509 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
510 PyList_SetItem(ret,rk,elt);
515 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
517 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
518 PyObject *ret=PyList_New(res.size());
520 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
522 PyObject *elt=PyTuple_New(2);
523 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
524 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
525 PyList_SetItem(ret,rk,elt);
530 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
532 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
533 PyObject *ret=PyList_New(res.size());
535 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
537 PyObject *elt=PyTuple_New(2);
538 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
539 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
540 PyList_SetItem(ret,rk,elt);
545 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName)
547 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
548 PyObject *ret=PyList_New(res.size());
550 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
552 PyObject *elt=PyTuple_New(2);
553 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
554 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
555 PyList_SetItem(ret,rk,elt);
560 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName)
562 int meshDim,spaceDim;
563 mcIdType numberOfNodes;
564 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
565 PyObject *ret=PyTuple_New(4);
566 PyObject *elt0=PyList_New(res.size());
568 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
570 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
572 PyObject *elt1=PyList_New(obj2.size());
573 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
575 PyObject *elt2=PyTuple_New(2);
576 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
577 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
578 PyList_SetItem(elt1,j,elt2);
580 PyList_SetItem(elt0,i,elt1);
582 PyTuple_SetItem(ret,0,elt0);
583 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
584 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
585 PyTuple_SetItem(ret,3,SWIG_From_long(numberOfNodes));
589 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
590 const std::string& fieldName, PyObject *liIts)
592 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
593 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
594 return convertFieldDoubleVecToPy(res);
597 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
599 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
600 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
601 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
604 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
606 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
607 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
608 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
611 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch)
613 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
614 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
615 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
618 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
620 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
621 std::size_t size=v.size();
622 PyObject *ret=PyList_New(size);
623 for(std::size_t i=0;i<size;i++)
624 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
628 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
630 std::vector<std::string> grps;
631 converPyListToVecString(li,grps);
632 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
635 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
637 std::vector<std::string> fams;
638 converPyListToVecString(li,fams);
639 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
643 namespace MEDCoupling
645 class MEDFileWritable
648 void copyOptionsFrom(const MEDFileWritable& other) const;
649 int getTooLongStrPolicy() const;
650 void setTooLongStrPolicy(int newVal);
651 int getZipConnPolicy();
652 void setZipConnPolicy(int newVal);
655 class MEDFileWritableStandAlone : public MEDFileWritable
658 void write(const std::string& fileName, int mode) const;
659 void write33(const std::string& fileName, int mode) const;
660 void write30(const std::string& fileName, int mode) const;
663 DataArrayByte *serialize() const
665 MCAuto<DataArrayByte> ret(self->serialize());
669 PyObject *__getstate__()
671 PyObject *ret(PyList_New(0));
675 void __setstate__(PyObject *inp)
681 class MEDFileMeshReadSelector
684 MEDFileMeshReadSelector();
685 MEDFileMeshReadSelector(unsigned int code);
686 mcIdType getNumberOfCoordsLoadSessions();
687 void setNumberOfCoordsLoadSessions(mcIdType newNbOfCoordsLoadSessions);
688 unsigned int getCode() const;
689 void setCode(unsigned int newCode);
690 bool isCellFamilyFieldReading() const;
691 bool isNodeFamilyFieldReading() const;
692 bool isCellNameFieldReading() const;
693 bool isNodeNameFieldReading() const;
694 bool isCellNumFieldReading() const;
695 bool isNodeNumFieldReading() const;
696 bool isGlobalNodeNumFieldReading() const;
697 void setCellFamilyFieldReading(bool b);
698 void setNodeFamilyFieldReading(bool b);
699 void setCellNameFieldReading(bool b);
700 void setNodeNameFieldReading(bool b);
701 void setCellNumFieldReading(bool b);
702 void setNodeNumFieldReading(bool b);
703 void setGlobalNodeNumFieldReading(bool b);
706 std::string __str__() const
708 std::ostringstream oss;
713 std::string __repr__() const
715 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
721 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
724 static MEDFileJointCorrespondence *New();
725 static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence) // nodes
727 static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence, // cells
728 INTERP_KERNEL::NormalizedCellType loc_geo_type,
729 INTERP_KERNEL::NormalizedCellType rem_geo_type)
731 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
732 MEDFileJointCorrespondence *deepCopy() const;
733 MEDFileJointCorrespondence *shallowCpy() const;
734 void setIsNodal(bool isNodal);
735 bool getIsNodal() const;
736 bool isEqual(const MEDFileJointCorrespondence *other) const;
737 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
738 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
739 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
740 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
741 void setCorrespondence(DataArrayIdType *corr);
742 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const;
743 std::string simpleRepr() const;
746 MEDFileJointCorrespondence()
748 return MEDFileJointCorrespondence::New();
750 MEDFileJointCorrespondence(DataArrayIdType* correspondence)
752 return MEDFileJointCorrespondence::New(correspondence);
754 MEDFileJointCorrespondence(DataArrayIdType* correspondence, // cells
755 INTERP_KERNEL::NormalizedCellType loc_geo_type,
756 INTERP_KERNEL::NormalizedCellType rem_geo_type)
758 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
761 std::string __str__() const
763 return self->simpleRepr();
766 DataArrayIdType *getCorrespondence() const
768 const DataArrayIdType *ret(self->getCorrespondence());
771 return const_cast<DataArrayIdType *>(ret);
776 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
779 static MEDFileJointOneStep *New(int dt=-1, int it=-1);
780 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1);
781 MEDFileJointOneStep *deepCopy() const;
782 MEDFileJointOneStep *shallowCpy() const;
783 bool isEqual(const MEDFileJointOneStep *other) const;
784 void setOrder(int order);
785 int getOrder() const;
786 void setIteration(int it);
787 int getIteration() const;
788 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
789 void clearCorrespondences();
790 int getNumberOfCorrespondences() const;
791 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const;
792 std::string simpleRepr() const;
795 MEDFileJointOneStep()
797 return MEDFileJointOneStep::New();
800 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number)
802 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
805 std::string __str__() const
807 return self->simpleRepr();
810 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const
812 MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
818 MEDFileJointCorrespondence *__getitem__(int i) const
820 return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
825 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
828 static MEDFileJoint *New();
829 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num);
830 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum);
831 MEDFileJoint *deepCopy() const;
832 MEDFileJoint *shallowCpy() const;
833 bool isEqual(const MEDFileJoint *other) const;
834 void setLocalMeshName(const std::string& name);
835 std::string getLocalMeshName() const;
836 void setRemoteMeshName(const std::string& name);
837 std::string getRemoteMeshName() const;
838 void setDescription(const std::string& name);
839 std::string getDescription() const;
840 void setJointName(const std::string& name);
841 std::string getJointName() const;
842 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
843 void setDomainNumber(const int& number);
844 int getDomainNumber() const;
845 void pushStep(MEDFileJointOneStep* step);
846 int getNumberOfSteps() const;
847 std::string simpleRepr() const;
852 return MEDFileJoint::New();
855 MEDFileJoint(const std::string& fileName, const std::string& mName, int num)
857 return MEDFileJoint::New(fileName,mName,num);
860 MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum)
862 return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
865 std::string __str__() const
867 return self->simpleRepr();
870 MEDFileJointOneStep *getStepAtPos(int i) const
872 MEDFileJointOneStep *ret(self->getStepAtPos(i));
878 MEDFileJointOneStep *__getitem__(int i)
880 return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
885 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
888 static MEDFileJoints *New();
889 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName);
890 MEDFileJoints *deepCopy() const;
891 std::string simpleRepr() const;
892 std::string getMeshName() const;
893 int getNumberOfJoints() const;
894 std::vector<std::string> getJointsNames() const;
895 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
896 void resize(int newSize);
897 void pushJoint(MEDFileJoint *joint);
898 void setJointAtPos(int i, MEDFileJoint *joint);
899 void destroyJointAtPos(int i);
904 return MEDFileJoints::New();
907 MEDFileJoints(const std::string& fileName, const std::string& meshName)
909 return MEDFileJoints::New(fileName,meshName);
912 std::string __str__() const
914 return self->simpleRepr();
917 MEDFileJoint *__getitem__(PyObject *obj)
919 static const char msg[]="MEDFileJoints::__getitem__ : only integer or string with meshname supported !";
922 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
927 MEDFileJoint *ret(self->getJointWithName(convertPyObjectToStr(obj,msg)));
935 return self->getNumberOfJoints();
938 MEDFileJoint *getJointAtPos(int i) const
940 MEDFileJoint *ret=self->getJointAtPos(i);
946 MEDFileJoint *getJointWithName(const std::string& paramName) const
948 MEDFileJoint *ret=self->getJointWithName(paramName);
956 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
959 MEDFileEquivalenceBase();
962 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
965 MEDFileEquivalenceData();
967 void setArray(DataArrayInt32 *data);
970 DataArrayInt32 *getArray()
972 DataArrayInt32 *ret(self->getArray());
973 if(ret) ret->incrRef();
979 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
982 MEDFileEquivalenceNode();
985 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
988 MEDFileEquivalenceCell();
991 std::size_t size() const;
992 void setArray(int meshDimRelToMax, DataArrayInt32 *da);
993 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt32 *da);
996 DataArrayInt32 *getArray(INTERP_KERNEL::NormalizedCellType type)
998 DataArrayInt32 *ret(self->getArray(type));
999 if(ret) ret->incrRef();
1003 PyObject *getTypes() const
1005 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
1006 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1007 PyObject *res=PyList_New(result.size());
1008 for(int i=0;iL!=result.end(); i++, iL++)
1009 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1015 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
1018 MEDFileEquivalencePair();
1020 std::string getName() const;
1021 void setName(const std::string& name);
1022 std::string getDescription() const;
1023 void setDescription(const std::string& descr);
1024 void setArray(int meshDimRelToMaxExt, DataArrayInt32 *da);;
1027 MEDFileEquivalenceCell *initCell()
1029 MEDFileEquivalenceCell *ret(self->initCell());
1030 if(ret) ret->incrRef();
1034 MEDFileEquivalenceNode *initNode()
1036 MEDFileEquivalenceNode *ret(self->initNode());
1037 if(ret) ret->incrRef();
1041 MEDFileEquivalenceCell *getCell()
1043 MEDFileEquivalenceCell *ret(self->getCell());
1044 if(ret) ret->incrRef();
1048 MEDFileEquivalenceNode *getNode()
1050 MEDFileEquivalenceNode *ret(self->getNode());
1051 if(ret) ret->incrRef();
1057 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
1060 MEDFileEquivalences();
1063 std::vector<std::string> getEquivalenceNames() const;
1064 void killEquivalenceWithName(const std::string& name);
1065 void killEquivalenceAt(int i);
1069 MEDFileEquivalencePair *getEquivalence(int i)
1071 MEDFileEquivalencePair *ret(self->getEquivalence(i));
1072 if(ret) ret->incrRef();
1075 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name)
1077 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
1078 if(ret) ret->incrRef();
1082 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name)
1084 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
1085 if(ret) ret->incrRef();
1091 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
1094 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1095 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1096 static MEDFileMesh *New(DataArrayByte *db);
1097 virtual MEDFileMesh *createNewEmpty() const;
1098 virtual MEDFileMesh *deepCopy() const;
1099 virtual MEDFileMesh *shallowCpy() const;
1100 virtual void clearNonDiscrAttributes() const;
1101 void setName(const std::string& name);
1102 std::string getName();
1103 std::string getUnivName() const;
1104 bool getUnivNameWrStatus() const;
1105 void setUnivNameWrStatus(bool newStatus);
1106 void setDescription(const std::string& name);
1107 std::string getDescription() const;
1108 void setOrder(int order);
1109 int getOrder() const;
1110 void setIteration(int it);
1112 void setTimeValue(double time);
1113 void setTime(int dt, int it, double time);
1114 double getTimeValue() const;
1115 void setTimeUnit(const std::string& unit);
1116 std::string getTimeUnit() const;
1117 void setAxisType(MEDCouplingAxisType at);
1118 MEDCouplingAxisType getAxisType() const;
1119 virtual int getNumberOfNodes() const;
1120 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const;
1121 virtual bool hasImplicitPart() const;
1122 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const;
1123 virtual void releaseImplicitPartIfAny() const;
1124 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const;
1125 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const;
1126 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const;
1127 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const;
1128 virtual std::vector<mcIdType> getDistributionOfTypes(int meshDimRelToMax) const;
1129 virtual MEDFileMesh *cartesianize() const;
1130 std::vector<int> getNonEmptyLevels() const;
1131 std::vector<int> getNonEmptyLevelsExt() const;
1132 int getSizeAtLevel(int meshDimRelToMaxExt) const;
1134 bool existsGroup(const std::string& groupName) const;
1135 bool existsFamily(int famId) const;
1136 bool existsFamily(const std::string& familyName) const;
1137 void setFamilyId(const std::string& familyName, int id);
1138 void setFamilyIdUnique(const std::string& familyName, int id);
1139 void addFamily(const std::string& familyName, int id);
1140 void addFamilyOnGrp(const std::string& grpName, const std::string& famName);
1141 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName);
1142 virtual bool keepFamIdsOnlyOnLevs(const std::vector<mcIdType>& famIds, const std::vector<int>& levs);
1143 void copyFamGrpMapsFrom(const MEDFileMesh& other);
1146 void clearFamGrpMaps();
1147 const std::map<std::string,int>& getFamilyInfo() const;
1148 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const;
1149 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const;
1150 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const;
1151 std::vector<mcIdType> getFamiliesIdsOnGroup(const std::string& name) const;
1152 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams);
1153 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<mcIdType>& famIds);
1154 std::vector<std::string> getGroupsOnFamily(const std::string& name) const;
1155 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps);
1156 std::vector<std::string> getGroupsNames() const;
1157 std::vector<std::string> getFamiliesNames() const;
1158 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
1159 std::vector<mcIdType> getGrpNonEmptyLevelsExt(const std::string& grp) const;
1160 std::vector<mcIdType> getGrpNonEmptyLevels(const std::string& grp) const;
1161 std::vector<mcIdType> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
1162 std::vector<mcIdType> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
1163 std::vector<mcIdType> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
1164 std::vector<mcIdType> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
1165 std::vector<mcIdType> getFamNonEmptyLevels(const std::string& fam) const;
1166 std::vector<mcIdType> getFamNonEmptyLevelsExt(const std::string& fam) const;
1167 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const;
1168 static std::string GetMagicFamilyStr();
1169 void assignFamilyNameWithGroupName();
1170 std::vector<std::string> removeEmptyGroups();
1171 void removeGroupAtLevel(int meshDimRelToMaxExt, const std::string& name);
1172 void removeGroup(const std::string& name);
1173 void removeFamily(const std::string& name);
1174 std::vector<std::string> removeOrphanGroups();
1175 std::vector<std::string> removeOrphanFamilies();
1176 void removeFamiliesReferedByNoGroups();
1177 void rearrangeFamilies();
1179 void checkOrphanFamilyZero() const;
1180 void changeGroupName(const std::string& oldName, const std::string& newName);
1181 void changeFamilyName(const std::string& oldName, const std::string& newName);
1182 void changeFamilyId(int oldId, int newId);
1183 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames);
1184 void setFamilyInfo(const std::map<std::string,mcIdType>& info);
1185 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1186 int getFamilyId(const std::string& name) const;
1187 int getMaxAbsFamilyId() const;
1188 int getMaxFamilyId() const;
1189 int getMinFamilyId() const;
1190 int getTheMaxAbsFamilyId() const;
1191 int getTheMaxFamilyId() const;
1192 int getTheMinFamilyId() const;
1193 virtual int getMaxAbsFamilyIdInArrays() const;
1194 virtual int getMaxFamilyIdInArrays() const;
1195 virtual int getMinFamilyIdInArrays() const;
1196 DataArrayIdType *getAllFamiliesIdsReferenced() const;
1197 DataArrayIdType *computeAllFamilyIdsInUse() const;
1198 std::vector<mcIdType> getFamiliesIds(const std::vector<std::string>& famNames) const;
1199 std::string getFamilyNameGivenId(int id) const;
1200 bool ensureDifferentFamIdsPerLevel();
1201 void normalizeFamIdsTrio();
1202 void normalizeFamIdsMEDFile();
1203 virtual int getMeshDimension() const;
1204 virtual std::string simpleRepr() const;
1205 virtual std::string advancedRepr() const;
1207 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const;
1208 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayIdType *famArr);
1209 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayIdType *renumArr);
1210 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr);
1211 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayIdType *globalNumArr);
1212 virtual void addNodeGroup(const DataArrayIdType *ids);
1213 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayIdType *ids);
1214 virtual DataArrayIdType *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1215 virtual DataArrayIdType *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1216 virtual DataArrayIdType *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1217 virtual DataArrayIdType *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1218 virtual DataArrayIdType *getNodeGroupArr(const std::string& grp, bool renum=false) const;
1219 virtual DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1220 virtual DataArrayIdType *getNodeFamilyArr(const std::string& fam, bool renum=false) const;
1221 virtual DataArrayIdType *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const;
1222 int getNumberOfJoints();
1223 MEDFileJoints *getJoints();
1224 void setJoints( MEDFileJoints* joints );
1225 void initializeEquivalences();
1226 void killEquivalences();
1227 bool presenceOfStructureElements() const;
1228 void killStructureElements();
1231 std::string __str__() const
1233 return self->simpleRepr();
1236 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const
1238 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1241 static INTERP_KERNEL::NormalizedCellType ConvertFromMEDFileGeoType(int geoType)
1243 med_geometry_type geoType2((med_geometry_type) geoType);
1244 return MEDFileMesh::ConvertFromMEDFileGeoType(geoType2);
1247 static int ConvertToMEDFileGeoType(INTERP_KERNEL::NormalizedCellType geoType)
1249 return (int) MEDFileMesh::ConvertToMEDFileGeoType(geoType);
1255 double tmp0=self->getTime(tmp1,tmp2);
1256 PyObject *res = PyList_New(3);
1257 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1258 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1259 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1263 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const
1266 bool ret0=self->isEqual(other,eps,what);
1267 PyObject *res=PyList_New(2);
1268 PyObject *ret0Py=ret0?Py_True:Py_False;
1270 PyList_SetItem(res,0,ret0Py);
1271 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1275 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false)
1277 std::vector<const DataArrayIdType *> grps;
1278 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grps);
1279 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1282 void addGroupsAtLevel(int meshDimRelToMaxExt, PyObject *grps)
1284 std::vector<const DataArrayIdType *> grpsCpp;
1285 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(grps,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grpsCpp);
1286 self->addGroupsAtLevel(meshDimRelToMaxExt,grpsCpp);
1289 PyObject *areFamsEqual(const MEDFileMesh *other) const
1292 bool ret0=self->areFamsEqual(other,what);
1293 PyObject *res=PyList_New(2);
1294 PyObject *ret0Py=ret0?Py_True:Py_False;
1296 PyList_SetItem(res,0,ret0Py);
1297 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1301 PyObject *areGrpsEqual(const MEDFileMesh *other) const
1304 bool ret0=self->areGrpsEqual(other,what);
1305 PyObject *res=PyList_New(2);
1306 PyObject *ret0Py=ret0?Py_True:Py_False;
1308 PyList_SetItem(res,0,ret0Py);
1309 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1313 PyObject *getAllGeoTypes() const
1315 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1316 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1317 PyObject *res=PyList_New(result.size());
1318 for(int i=0;iL!=result.end(); i++, iL++)
1319 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1323 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const
1325 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1326 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1327 PyObject *res=PyList_New(result.size());
1328 for(int i=0;iL!=result.end(); i++, iL++)
1329 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1333 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const
1335 const DataArrayIdType *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1338 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1341 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt)
1343 const DataArrayIdType *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1346 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1349 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const
1351 const DataArrayIdType *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1354 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1357 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const
1359 const DataArrayIdType *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1362 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1365 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const
1367 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1370 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1373 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created)
1376 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1377 PyObject *ret=PyTuple_New(2);
1378 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1379 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1383 PyObject *unPolyze()
1385 DataArrayIdType *ret3=0;
1386 std::vector<mcIdType> ret1,ret2;
1387 bool ret0=self->unPolyze(ret1,ret2,ret3);
1388 PyObject *ret=PyTuple_New(4);
1389 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1391 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1392 for(int j=0;j<(int)ret1.size()/3;j++)
1394 PyObject *retLev2=PyList_New(3);
1395 PyList_SetItem(retLev2,0,PyInt_FromLong(ret1[3*j]));
1396 PyList_SetItem(retLev2,1,PyInt_FromLong(ret1[3*j+1]));
1397 PyList_SetItem(retLev2,2,PyInt_FromLong(ret1[3*j+2]));
1398 PyList_SetItem(retLev1_0,j,retLev2);
1400 PyTuple_SetItem(ret,1,retLev1_0);
1402 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1403 for(int j=0;j<(int)ret2.size()/3;j++)
1405 PyObject *retLev2=PyList_New(3);
1406 PyList_SetItem(retLev2,0,PyInt_FromLong(ret2[3*j]));
1407 PyList_SetItem(retLev2,1,PyInt_FromLong(ret2[3*j+1]));
1408 PyList_SetItem(retLev2,2,PyInt_FromLong(ret2[3*j+2]));
1409 PyList_SetItem(retLev1_1,j,retLev2);
1411 PyTuple_SetItem(ret,2,retLev1_1);
1413 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1417 MEDFileEquivalences *getEquivalences()
1419 MEDFileEquivalences *ret(self->getEquivalences());
1420 if(ret) ret->incrRef();
1424 virtual DataArrayIdType *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const
1426 MCAuto<DataArrayIdType> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1432 class MEDFileUMesh : public MEDFileMesh
1435 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1436 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1437 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem);
1438 static MEDFileUMesh *New(DataArrayByte *db);
1439 static MEDFileUMesh *New();
1440 static const char *GetSpeStr4ExtMesh();
1442 int getSpaceDimension() const;
1443 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1444 void checkConsistency() const;
1445 void checkSMESHConsistency() const;
1446 void clearNodeAndCellNumbers();
1448 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1449 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1450 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1451 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1452 DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1453 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const;
1454 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const;
1455 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const;
1456 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const;
1457 void declarePartsUpdated() const;
1458 void forceComputationOfParts() const;
1459 void computeRevNum() const;
1461 void setFamilyNameAttachedOnId(int id, const std::string& newFamName);
1462 void setCoords(DataArrayDouble *coords);
1463 void setCoordsForced(DataArrayDouble *coords);
1464 void eraseGroupsAtLevel(int meshDimRelToMaxExt);
1465 void removeMeshAtLevel(int meshDimRelToMax);
1466 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m);
1467 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false);
1468 void optimizeFamilies();
1469 DataArrayIdType *computeFetchedNodeIds() const;
1470 DataArrayIdType *zipCoords();
1471 DataArrayIdType *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1472 DataArrayIdType *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1473 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const;
1474 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const;
1475 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const;
1476 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const;
1479 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1481 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1484 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1486 return MEDFileUMesh::New(fileName,mrs);
1489 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem)
1491 return MEDFileUMesh::New(mem);
1494 MEDFileUMesh(DataArrayByte *db)
1496 return MEDFileUMesh::New(db);
1501 return MEDFileUMesh::New();
1504 static MEDFileUMesh *LoadConnectivityOnlyPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<mcIdType>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1506 std::vector<int> typesCpp1;
1507 convertPyToNewIntArr3(types,typesCpp1);
1508 std::size_t sz(typesCpp1.size());
1509 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1510 for(std::size_t ii=0;ii<sz;ii++)
1511 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1512 return MEDFileUMesh::LoadConnectivityOnlyPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs).retn();
1515 static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<mcIdType>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1517 std::vector<int> typesCpp1;
1518 convertPyToNewIntArr3(types,typesCpp1);
1519 std::size_t sz(typesCpp1.size());
1520 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1521 for(std::size_t ii=0;ii<sz;ii++)
1522 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1523 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1526 static PyObject *LoadPartCoords(const std::string& fileName, const std::string& mName, int dt, int it, const std::vector<std::string>& infosOnComp, mcIdType startNodeId, mcIdType stopNodeId)
1528 MCAuto<DataArrayDouble> coords;
1529 MCAuto<PartDefinition> partCoords;
1530 MCAuto<DataArrayIdType> famCoords,numCoords;
1531 MCAuto<DataArrayAsciiChar> nameCoord;
1532 MEDFileUMesh::LoadPartCoords(fileName,mName,dt,it,infosOnComp,startNodeId,stopNodeId,coords,partCoords,famCoords,numCoords,nameCoord);
1533 PyObject *ret(PyTuple_New(5));
1534 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1535 PyTuple_SetItem(ret,1,convertPartDefinition(partCoords.retn(),SWIG_POINTER_OWN | 0));
1536 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(famCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1537 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(numCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1538 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(nameCoord.retn()),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 ));
1542 PyObject *__getstate__()
1544 std::vector<double> a0;
1545 std::vector<mcIdType> a1;
1546 std::vector<std::string> a2;
1547 std::vector< MCAuto<DataArrayIdType> > a3;
1548 MCAuto<DataArrayDouble> a4;
1549 self->serialize(a0,a1,a2,a3,a4);
1550 PyObject *ret(PyTuple_New(5));
1551 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1552 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1553 std::size_t sz(a2.size());
1554 PyObject *ret2(PyList_New(sz));
1555 for(std::size_t i=0;i<sz;i++)
1556 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1557 PyTuple_SetItem(ret,2,ret2);
1559 PyObject *ret3(PyList_New(sz));
1560 for(std::size_t i=0;i<sz;i++)
1562 DataArrayIdType *elt(a3[i]);
1565 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1567 PyTuple_SetItem(ret,3,ret3);
1568 DataArrayDouble *ret4(a4);
1571 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1575 void __setstate__(PyObject *inp)
1577 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1578 if(!PyTuple_Check(inp))
1579 throw INTERP_KERNEL::Exception(MSG);
1580 std::size_t sz(PyTuple_Size(inp));
1582 throw INTERP_KERNEL::Exception(MSG);
1583 std::vector<double> a0;
1584 std::vector<mcIdType> a1;
1585 std::vector<std::string> a2;
1586 std::vector< MCAuto<DataArrayIdType> > a3;
1587 MCAuto<DataArrayDouble> a4;
1589 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1591 fillArrayWithPyListDbl3(a0py,tmp,a0);
1592 convertPyToNewIntArr3(a1py,a1);
1593 fillStringVector(a2py,a2);
1595 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1597 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1598 if(!SWIG_IsOK(status))
1599 throw INTERP_KERNEL::Exception(MSG);
1600 a4=reinterpret_cast<DataArrayDouble *>(argp);
1601 if((DataArrayDouble *)a4)
1604 std::vector< DataArrayIdType * > a3Tmp;
1605 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayIdType *>(b0py,SWIGTITraits<mcIdType>::TI,"DataArrayInt",a3Tmp);
1606 std::size_t sz(a3Tmp.size());
1608 for(std::size_t i=0;i<sz;i++)
1612 a3Tmp[i]->incrRef();
1614 self->unserialize(a0,a1,a2,a3,a4);
1618 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh)
1621 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1622 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1625 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1628 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1631 self->setMeshAtLevel(meshDimRelToMax,m1);
1634 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1637 void __delitem__(int meshDimRelToMax)
1639 self->removeMeshAtLevel(meshDimRelToMax);
1642 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const
1644 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1646 DataArrayDouble *a,*a2;
1647 DataArrayDoubleTuple *aa,*aa2;
1648 std::vector<double> bb,bb2;
1650 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1651 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1652 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1656 static MEDFileUMesh *Aggregate(PyObject *meshes)
1658 std::vector<const MEDFileUMesh *> meshesCpp;
1659 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1660 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1664 PyObject *getAllDistributionOfTypes() const
1666 std::vector< std::pair<int,mcIdType> > ret(self->getAllDistributionOfTypes());
1667 return convertVecPairIntToPy(ret);
1670 DataArrayIdType *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const
1672 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1673 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1674 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1677 MEDFileUMesh *extractPart(PyObject *extractDef) const
1679 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1680 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1681 return self->extractPart(extractDefCpp);
1684 void setMeshes(PyObject *li, bool renum=false)
1686 std::vector<const MEDCouplingUMesh *> ms;
1687 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1688 self->setMeshes(ms,renum);
1691 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false)
1693 std::vector<const MEDCouplingUMesh *> ms;
1694 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1695 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1698 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false)
1700 std::vector<const MEDCouplingUMesh *> ms;
1701 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1702 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1705 DataArrayDouble *getCoords() const
1707 DataArrayDouble *ret=self->getCoords();
1713 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const
1715 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1718 return const_cast<PartDefinition *>(ret);
1721 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1)
1723 DataArrayIdType *ret0=0,*ret1=0,*ret2=0;
1724 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1725 PyObject *ret=PyTuple_New(3);
1726 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1727 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1728 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1732 PyObject * crackAlong(const std::string& grpNameM1, bool grpMustBeFullyDup=true)
1734 const std::unordered_map<mcIdType, std::unordered_map<mcIdType, mcIdType>> cellOld2NewNode = self->crackAlong(grpNameM1, grpMustBeFullyDup);
1735 PyObject * cellOld2NewNodePy = PyDict_New();
1736 for (const auto & cellIt: cellOld2NewNode) {
1737 PyObject * old2NewPy = PyDict_New();
1738 for (const auto & keyVal: cellIt.second) {
1739 PyDict_SetItem(old2NewPy, PyInt_FromLong(keyVal.first), PyInt_FromLong(keyVal.second));
1741 PyDict_SetItem(cellOld2NewNodePy, PyInt_FromLong(cellIt.first), old2NewPy);
1743 return cellOld2NewNodePy;
1746 // void OpenCrack(const std::unordered_map<mcIdType, std::unordered_map<mcIdType, mcIdType>>& c2o2nN, double factor=0.9)
1748 // self->OpenCrack(c2o2nN, factor);
1751 void openCrack(PyObject* c2o2nNPy, double factor=0.9)
1753 if (!PyDict_Check(c2o2nNPy))
1754 throw INTERP_KERNEL::Exception("c2o2nNPy is not a python dict");
1756 std::unordered_map<mcIdType, std::unordered_map<mcIdType, mcIdType>> c2o2nN;
1757 Py_ssize_t i_cells = 0;
1758 PyObject *cell, *val;
1760 while (PyDict_Next(c2o2nNPy, &i_cells, &cell, &val)) {
1761 if (!PyInt_Check(cell))
1762 throw INTERP_KERNEL::Exception("One of c2o2nNPy cell id is not an int.");
1764 if (!PyDict_Check(val))
1765 throw INTERP_KERNEL::Exception("One of c2o2nNPy val is not a python dict");
1766 std::unordered_map<mcIdType, mcIdType> o2nN {};
1767 Py_ssize_t i_node = 0;
1768 PyObject *oldN, *newN;
1770 while (PyDict_Next(val, &i_node, &oldN, &newN)) {
1771 if (!PyInt_Check(oldN))
1772 throw INTERP_KERNEL::Exception(
1773 "One of c2o2nNPy old node id is not an int.");
1774 if (!PyInt_Check(newN))
1775 throw INTERP_KERNEL::Exception(
1776 "One of c2o2nNPy new node id is not an int.");
1777 o2nN[PyInt_AsLong(oldN)] = PyInt_AsLong(newN);
1780 c2o2nN[PyInt_AsLong(cell)] = o2nN;
1783 self->openCrack(c2o2nN, factor);
1786 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const
1788 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1794 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const
1796 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1797 std::size_t sz(tmp.size());
1798 PyObject *ret=PyList_New(sz);
1799 for(std::size_t i=0;i<sz;i++)
1803 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1810 class MEDFileStructuredMesh : public MEDFileMesh
1815 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const
1817 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1825 class MEDFileCMesh : public MEDFileStructuredMesh
1828 static MEDFileCMesh *New();
1829 static MEDFileCMesh *New(DataArrayByte *db);
1830 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1831 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1832 void setMesh(MEDCouplingCMesh *m);
1833 int getSpaceDimension() const;
1838 return MEDFileCMesh::New();
1841 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1843 return MEDFileCMesh::New(fileName,mrs);
1846 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1848 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1851 MEDFileCMesh(DataArrayByte *db)
1853 return MEDFileCMesh::New(db);
1856 PyObject *getMesh() const
1858 const MEDCouplingCMesh *tmp=self->getMesh();
1861 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1866 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1869 static MEDFileCurveLinearMesh *New();
1870 static MEDFileCurveLinearMesh *New(DataArrayByte *db);
1871 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1872 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1873 void setMesh(MEDCouplingCurveLinearMesh *m);
1874 int getSpaceDimension() const;
1875 int getMeshDimension() const;
1878 MEDFileCurveLinearMesh()
1880 return MEDFileCurveLinearMesh::New();
1883 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1885 return MEDFileCurveLinearMesh::New(fileName,mrs);
1888 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1890 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1893 MEDFileCurveLinearMesh(DataArrayByte *db)
1895 return MEDFileCurveLinearMesh::New(db);
1898 PyObject *getMesh() const
1900 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1903 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1908 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1911 static MEDFileMeshMultiTS *New();
1912 static MEDFileMeshMultiTS *New(const std::string& fileName);
1913 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName);
1914 MEDFileMeshMultiTS *deepCopy() const;
1915 std::string getName() const;
1916 void setOneTimeStep(MEDFileMesh *mesh1TimeStep);
1917 void cartesianizeMe();
1920 MEDFileMeshMultiTS()
1922 return MEDFileMeshMultiTS::New();
1925 MEDFileMeshMultiTS(const std::string& fileName)
1927 return MEDFileMeshMultiTS::New(fileName);
1930 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName)
1932 return MEDFileMeshMultiTS::New(fileName,mName);
1935 MEDFileMesh *getOneTimeStep() const
1937 MEDFileMesh *ret=self->getOneTimeStep();
1945 class MEDFileMeshesIterator
1952 MEDFileMesh *ret=self->nextt();
1956 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1960 PyErr_SetString(PyExc_StopIteration,"No more data.");
1967 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1970 static MEDFileMeshes *New();
1971 static MEDFileMeshes *New(DataArrayByte *db);
1972 MEDFileMeshes *deepCopy() const;
1973 int getNumberOfMeshes() const;
1974 std::vector<std::string> getMeshesNames() const;
1976 void resize(int newSize);
1977 void pushMesh(MEDFileMesh *mesh);
1978 void setMeshAtPos(int i, MEDFileMesh *mesh);
1979 void destroyMeshAtPos(int i);
1980 void cartesianizeMe();
1981 bool presenceOfStructureElements() const;
1982 void killStructureElements();
1987 return MEDFileMeshes::New();
1990 MEDFileMeshes(const std::string& fileName)
1992 return MEDFileMeshes::New(fileName);
1995 MEDFileMeshes(DataArrayByte *db)
1997 return MEDFileMeshes::New(db);
2000 std::string __str__() const
2002 return self->simpleRepr();
2005 MEDFileMesh *__getitem__(PyObject *obj)
2007 static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
2008 if(PyInt_Check(obj))
2010 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
2015 MEDFileMesh *ret(self->getMeshWithName(convertPyObjectToStr(obj,msg)));
2021 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh)
2023 self->setMeshAtPos(obj,mesh);
2027 MEDFileMeshesIterator *__iter__()
2029 return self->iterator();
2034 return self->getNumberOfMeshes();
2037 MEDFileMesh *getMeshAtPos(int i) const
2039 MEDFileMesh *ret=self->getMeshAtPos(i);
2044 MEDFileMesh *getMeshWithName(const std::string& mname) const
2046 MEDFileMesh *ret=self->getMeshWithName(mname);
2054 class MEDFileFieldLoc : public RefCountObject
2057 std::string getName() const;
2058 int getDimension() const;
2059 int getNumberOfGaussPoints() const;
2060 int getNumberOfPointsInCells() const;
2061 const std::vector<double>& getRefCoords() const;
2062 const std::vector<double>& getGaussCoords() const;
2063 const std::vector<double>& getGaussWeights() const;
2064 bool isEqual(const MEDFileFieldLoc& other, double eps) const;
2067 std::string __str__() const
2069 return self->repr();
2074 class MEDFileFieldGlobsReal
2077 void resetContent();
2078 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
2079 void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
2080 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2081 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2082 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
2083 void checkGlobsCoherency() const;
2084 void checkGlobsPflsPartCoherency() const;
2085 void checkGlobsLocsPartCoherency() const;
2086 std::vector<std::string> getPfls() const;
2087 std::vector<std::string> getLocs() const;
2088 bool existsPfl(const std::string& pflName) const;
2089 bool existsLoc(const std::string& locName) const;
2090 std::string createNewNameOfPfl() const;
2091 std::string createNewNameOfLoc() const;
2092 std::vector< std::vector<int> > whichAreEqualProfiles() const;
2093 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
2094 virtual std::vector<std::string> getPflsReallyUsed() const;
2095 virtual std::vector<std::string> getLocsReallyUsed() const;
2096 virtual std::vector<std::string> getPflsReallyUsedMulti() const;
2097 virtual std::vector<std::string> getLocsReallyUsedMulti() const;
2098 void killProfileIds(const std::vector<int>& pflIds);
2099 void killLocalizationIds(const std::vector<int>& locIds);
2100 void changePflName(const std::string& oldName, const std::string& newName);
2101 void changeLocName(const std::string& oldName, const std::string& newName);
2102 int getNbOfGaussPtPerCell(int locId) const;
2103 int getLocalizationId(const std::string& loc) const;
2104 int getProfileId(const std::string& pfl) const;
2105 void killStructureElementsInGlobs();
2108 PyObject *getProfile(const std::string& pflName) const
2110 const DataArrayIdType *ret=self->getProfile(pflName);
2113 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2116 PyObject *getProfileFromId(int pflId) const
2118 const DataArrayIdType *ret=self->getProfileFromId(pflId);
2121 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2124 PyObject *getLocalizationFromId(int locId) const
2126 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
2129 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2132 PyObject *getLocalization(const std::string& locName) const
2134 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
2137 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2140 PyObject *zipPflsNames()
2142 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
2143 return convertVecPairVecStToPy(ret);
2146 PyObject *zipLocsNames(double eps)
2148 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
2149 return convertVecPairVecStToPy(ret);
2152 void changePflsNames(PyObject *li)
2154 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2155 self->changePflsNames(v);
2158 void changePflsRefsNamesGen(PyObject *li)
2160 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2161 self->changePflsRefsNamesGen(v);
2164 void changePflsNamesInStruct(PyObject *li)
2166 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2167 self->changePflsNamesInStruct(v);
2170 void changeLocsNames(PyObject *li)
2172 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2173 self->changeLocsNames(v);
2176 void changeLocsRefsNamesGen(PyObject *li)
2178 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2179 self->changeLocsRefsNamesGen(v);
2182 void changeLocsNamesInStruct(PyObject *li)
2184 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2185 self->changeLocsNamesInStruct(v);
2188 std::string simpleReprGlobs() const
2190 std::ostringstream oss;
2191 self->simpleReprGlobs(oss);
2197 class MEDFileEntities
2202 static MEDFileEntities *BuildFrom(PyObject *entities)
2204 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2205 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2207 std::size_t sz(inp0.size());
2209 for(std::size_t i=0;i<sz;i++)
2210 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2212 return MEDFileEntities::BuildFrom(&inp);
2219 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2222 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
2223 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2224 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2225 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
2227 void loadArraysIfNecessary();
2228 void unloadArrays();
2229 void unloadArraysWithoutDataLoss();
2230 int getDimension() const;
2231 int getIteration() const;
2232 int getOrder() const;
2233 std::string getName();
2234 void setName(const std::string& name);
2235 std::string getMeshName();
2236 void setMeshName(const std::string& newMeshName);
2237 int getMeshIteration() const;
2238 int getMeshOrder() const;
2239 int getNumberOfComponents() const;
2240 bool isDealingTS(int iteration, int order) const;
2241 void setInfo(const std::vector<std::string>& infos);
2242 const std::vector<std::string>& getInfo() const;
2243 bool presenceOfMultiDiscPerGeoType() const;
2244 void setTime(int iteration, int order, double val);
2245 virtual MEDFileAnyTypeField1TS *shallowCpy() const;
2246 MEDFileAnyTypeField1TS *deepCopy() const;
2247 std::string getDtUnit() const;
2248 void setDtUnit(const std::string& dtUnit);
2254 double tmp0=self->getTime(tmp1,tmp2);
2255 PyObject *res = PyList_New(3);
2256 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2257 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2258 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2262 PyObject *getDtIt() const
2264 std::pair<int,int> res=self->getDtIt();
2265 PyObject *elt=PyTuple_New(2);
2266 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2267 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2271 MEDFileAnyTypeField1TS *buildNewEmpty() const
2273 MCAuto<MEDFileAnyTypeField1TS> ret = self->buildNewEmpty();
2277 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false)
2279 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2282 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false)
2284 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2287 bool changeMeshNames(PyObject *li)
2289 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2290 return self->changeMeshNames(modifTab);
2293 PyObject *getTypesOfFieldAvailable() const
2295 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2296 PyObject *ret2=PyList_New(ret.size());
2297 for(int i=0;i<(int)ret.size();i++)
2298 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2302 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const
2304 std::vector<int> ret1;
2305 int ret0=self->getNonEmptyLevels(mname,ret1);
2306 PyObject *elt=PyTuple_New(2);
2307 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2308 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2312 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const
2314 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2315 std::vector< std::vector<TypeOfField> > typesF;
2316 std::vector< std::vector<std::string> > pfls;
2317 std::vector< std::vector<std::string> > locs;
2318 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2319 std::size_t sz=ret.size();
2320 PyObject *ret2=PyList_New(sz);
2321 for(std::size_t i=0;i<sz;i++)
2323 const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2324 const std::vector<TypeOfField>& typesFI=typesF[i];
2325 const std::vector<std::string>& pflsI=pfls[i];
2326 const std::vector<std::string>& locsI=locs[i];
2327 PyObject *elt=PyTuple_New(2);
2328 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2329 std::size_t sz2=ret[i].size();
2330 PyObject *elt2=PyList_New(sz2);
2331 for(std::size_t j=0;j<sz2;j++)
2333 PyObject *elt3=PyTuple_New(4);
2334 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2335 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2336 PyTuple_SetItem(elt3,1,elt4);
2337 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2338 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2339 PyList_SetItem(elt2,j,elt3);
2341 PyTuple_SetItem(elt,1,elt2);
2342 PyList_SetItem(ret2,i,elt);
2347 PyObject *splitComponents() const
2349 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2350 std::size_t sz=ret.size();
2351 PyObject *retPy=PyList_New(sz);
2352 for(std::size_t i=0;i<sz;i++)
2353 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2357 PyObject *splitDiscretizations() const
2359 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2360 std::size_t sz=ret.size();
2361 PyObject *retPy=PyList_New(sz);
2362 for(std::size_t i=0;i<sz;i++)
2363 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2367 PyObject *splitMultiDiscrPerGeoTypes() const
2369 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2370 std::size_t sz=ret.size();
2371 PyObject *retPy=PyList_New(sz);
2372 for(std::size_t i=0;i<sz;i++)
2373 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2377 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2379 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2380 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2381 return self->extractPart(extractDefCpp,mm);
2386 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2389 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2390 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2391 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
2392 static MEDFileField1TS *New(DataArrayByte *db);
2393 static MEDFileField1TS *New();
2394 MEDCoupling::MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const;
2395 MEDCoupling::MEDFileInt64Field1TS *convertToInt64(bool isDeepCpyGlobs=true) const;
2396 void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf);
2397 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
2398 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2399 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2400 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2401 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2402 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2404 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
2405 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2406 void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2407 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
2408 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
2411 MEDFileField1TS(const std::string& fileName, bool loadAll=true)
2413 return MEDFileField1TS::New(fileName,loadAll);
2416 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2418 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2421 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2423 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2426 MEDFileField1TS(DataArrayByte *db)
2428 return MEDFileField1TS::New(db);
2433 return MEDFileField1TS::New();
2436 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field)
2438 const DataArrayDouble *arr=0;
2440 arr=field->getArray();
2441 self->copyTinyInfoFrom(field,arr);
2444 std::string __str__() const
2446 return self->simpleRepr();
2449 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2451 return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
2454 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const
2456 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2457 std::vector< std::vector<TypeOfField> > typesF;
2458 std::vector< std::vector<std::string> > pfls;
2459 std::vector< std::vector<std::string> > locs;
2460 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2461 std::size_t sz=ret.size();
2462 PyObject *ret2=PyList_New(sz);
2463 for(std::size_t i=0;i<sz;i++)
2465 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2466 const std::vector<TypeOfField>& typesFI=typesF[i];
2467 const std::vector<std::string>& pflsI=pfls[i];
2468 const std::vector<std::string>& locsI=locs[i];
2469 PyObject *elt=PyTuple_New(2);
2470 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2471 std::size_t sz2=ret[i].size();
2472 PyObject *elt2=PyList_New(sz2);
2473 for(std::size_t j=0;j<sz2;j++)
2475 PyObject *elt3=PyTuple_New(4);
2476 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2477 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2478 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2479 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2480 PyList_SetItem(elt2,j,elt3);
2482 PyTuple_SetItem(elt,1,elt2);
2483 PyList_SetItem(ret2,i,elt);
2488 DataArrayDouble *getUndergroundDataArray() const
2490 DataArrayDouble *ret=self->getUndergroundDataArray();
2496 PyObject *getUndergroundDataArrayExt() const
2498 return MEDFileField1TS_getUndergroundDataArrayExt<double>(self);
2503 class MEDFileInt32Field1TS : public MEDFileAnyTypeField1TS
2506 static MEDFileInt32Field1TS *New();
2507 static MEDFileInt32Field1TS *New(const std::string& fileName, bool loadAll=true);
2508 static MEDFileInt32Field1TS *New(DataArrayByte *db);
2509 static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2510 static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2511 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2513 void setFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
2514 void setFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2515 void setFieldProfileFlatly(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2516 void copyTimeInfoFrom(MEDCouplingFieldInt32 *mcf);
2517 MEDCouplingFieldInt32 *field(const MEDFileMesh *mesh) const;
2518 MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2519 MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2520 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2521 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2522 MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2525 MEDFileInt32Field1TS()
2527 return MEDFileInt32Field1TS::New();
2530 MEDFileInt32Field1TS(const std::string& fileName, bool loadAll=true)
2532 return MEDFileInt32Field1TS::New(fileName,loadAll);
2535 MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2537 return MEDFileInt32Field1TS::New(fileName,fieldName,loadAll);
2540 MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2542 return MEDFileInt32Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2545 MEDFileInt32Field1TS(DataArrayByte *db)
2547 return MEDFileInt32Field1TS::New(db);
2550 std::string __str__() const
2552 return self->simpleRepr();
2555 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2557 return MEDFileField1TS_getFieldWithProfile<Int32>(self,type,meshDimRelToMax,mesh);
2560 DataArrayInt32 *getUndergroundDataArray() const
2562 DataArrayInt32 *ret=self->getUndergroundDataArray();
2568 PyObject *getUndergroundDataArrayExt() const
2570 return MEDFileField1TS_getUndergroundDataArrayExt<Int32>(self);
2575 class MEDFileInt64Field1TS : public MEDFileAnyTypeField1TS
2578 static MEDFileInt64Field1TS *New();
2579 static MEDFileInt64Field1TS *New(const std::string& fileName, bool loadAll=true);
2580 static MEDFileInt64Field1TS *New(DataArrayByte *db);
2581 static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2582 static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2583 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2585 void setFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
2586 void setFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2587 void setFieldProfileFlatly(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2588 void copyTimeInfoFrom(MEDCouplingFieldInt64 *mcf);
2589 MEDCouplingFieldInt64 *field(const MEDFileMesh *mesh) const;
2590 MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2591 MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2592 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2593 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2594 MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2597 MEDFileInt64Field1TS()
2599 return MEDFileInt64Field1TS::New();
2602 MEDFileInt64Field1TS(const std::string& fileName, bool loadAll=true)
2604 return MEDFileInt64Field1TS::New(fileName,loadAll);
2607 MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2609 return MEDFileInt64Field1TS::New(fileName,fieldName,loadAll);
2612 MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2614 return MEDFileInt64Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2617 MEDFileInt64Field1TS(DataArrayByte *db)
2619 return MEDFileInt64Field1TS::New(db);
2622 std::string __str__() const
2624 return self->simpleRepr();
2627 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2629 return MEDFileField1TS_getFieldWithProfile<Int64>(self,type,meshDimRelToMax,mesh);
2632 DataArrayInt64 *getUndergroundDataArray() const
2634 DataArrayInt64 *ret=self->getUndergroundDataArray();
2640 PyObject *getUndergroundDataArrayExt() const
2642 return MEDFileField1TS_getUndergroundDataArrayExt<Int64>(self);
2647 class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
2650 static MEDFileFloatField1TS *New();
2651 static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true);
2652 static MEDFileFloatField1TS *New(DataArrayByte *db);
2653 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2654 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2655 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2657 void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
2658 void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2659 void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2660 void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf);
2661 MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const;
2662 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2663 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2664 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2665 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2666 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2669 MEDFileFloatField1TS()
2671 return MEDFileFloatField1TS::New();
2674 MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true)
2676 return MEDFileFloatField1TS::New(fileName,loadAll);
2679 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2681 return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
2684 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2686 return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
2689 MEDFileFloatField1TS(DataArrayByte *db)
2691 return MEDFileFloatField1TS::New(db);
2694 std::string __str__() const
2696 return self->simpleRepr();
2699 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2701 return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
2704 DataArrayFloat *getUndergroundDataArray() const
2706 DataArrayFloat *ret=self->getUndergroundDataArray();
2712 PyObject *getUndergroundDataArrayExt() const
2714 return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
2719 class MEDFileAnyTypeFieldMultiTSIterator
2726 MEDFileAnyTypeField1TS *ret=self->nextt();
2728 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2731 PyErr_SetString(PyExc_StopIteration,"No more data.");
2738 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2741 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
2742 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2743 MEDFileAnyTypeFieldMultiTS *deepCopy() const;
2744 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
2745 std::string getName() const;
2746 void setName(const std::string& name);
2747 std::string getDtUnit() const;
2748 void setDtUnit(const std::string& dtUnit);
2749 std::string getMeshName() const;
2750 void setMeshName(const std::string& newMeshName);
2751 void setInfo(const std::vector<std::string>& infos);
2752 const std::vector<std::string>& getInfo() const;
2753 bool presenceOfMultiDiscPerGeoType() const;
2754 int getNumberOfComponents() const;
2755 int getNumberOfTS() const;
2756 void eraseEmptyTS();
2757 int getPosOfTimeStep(int iteration, int order) const;
2758 int getPosGivenTime(double time, double eps=1e-8) const;
2760 void loadArraysIfNecessary();
2761 void unloadArrays();
2762 void unloadArraysWithoutDataLoss();
2764 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
2765 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
2766 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
2767 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
2768 void synchronizeNameScope();
2769 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const;
2774 return self->getNumberOfTS();
2777 int getTimeId(PyObject *elt0) const
2779 if(elt0 && PyInt_Check(elt0))
2781 int pos=(int)PyInt_AS_LONG(elt0);
2784 else if(elt0 && PyTuple_Check(elt0))
2786 if(PyTuple_Size(elt0)==2)
2788 PyObject *o0=PyTuple_GetItem(elt0,0);
2789 PyObject *o1=PyTuple_GetItem(elt0,1);
2790 if(PyInt_Check(o0) && PyInt_Check(o1))
2792 int iter=(int)PyInt_AS_LONG(o0);
2793 int order=(int)PyInt_AS_LONG(o1);
2794 return self->getPosOfTimeStep(iter,order);
2797 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 !");
2800 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 !");
2802 else if(elt0 && PyFloat_Check(elt0))
2804 double val=PyFloat_AS_DOUBLE(elt0);
2805 return self->getPosGivenTime(val);
2808 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2811 PyObject *getIterations() const
2813 std::vector< std::pair<int,int> > res(self->getIterations());
2814 return convertVecPairIntToPy(res);
2817 PyObject *getTimeSteps() const
2819 std::vector<double> ret1;
2820 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2821 std::size_t sz=ret.size();
2822 PyObject *ret2=PyList_New(sz);
2823 for(std::size_t i=0;i<sz;i++)
2825 PyObject *elt=PyTuple_New(3);
2826 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2827 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2828 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2829 PyList_SetItem(ret2,i,elt);
2834 PyObject *getTypesOfFieldAvailable() const
2836 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2837 PyObject *ret2=PyList_New(ret.size());
2838 for(int i=0;i<(int)ret.size();i++)
2840 const std::vector<TypeOfField>& rett=ret[i];
2841 PyObject *ret3=PyList_New(rett.size());
2842 for(int j=0;j<(int)rett.size();j++)
2843 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2844 PyList_SetItem(ret2,i,ret3);
2849 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const
2851 std::vector<int> ret1;
2852 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2853 PyObject *elt=PyTuple_New(2);
2854 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2855 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2859 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const
2861 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2862 std::vector< std::vector<TypeOfField> > typesF;
2863 std::vector< std::vector<std::string> > pfls;
2864 std::vector< std::vector<std::string> > locs;
2865 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2866 std::size_t sz=ret.size();
2867 PyObject *ret2=PyList_New(sz);
2868 for(std::size_t i=0;i<sz;i++)
2870 const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2871 const std::vector<TypeOfField>& typesFI=typesF[i];
2872 const std::vector<std::string>& pflsI=pfls[i];
2873 const std::vector<std::string>& locsI=locs[i];
2874 PyObject *elt=PyTuple_New(2);
2875 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2876 std::size_t sz2=ret[i].size();
2877 PyObject *elt2=PyList_New(sz2);
2878 for(std::size_t j=0;j<sz2;j++)
2880 PyObject *elt3=PyTuple_New(4);
2881 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2882 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2883 PyTuple_SetItem(elt3,1,elt4);
2884 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2885 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2886 PyList_SetItem(elt2,j,elt3);
2888 PyTuple_SetItem(elt,1,elt2);
2889 PyList_SetItem(ret2,i,elt);
2894 std::vector<int> getTimeIds(PyObject *elts) const
2896 if(PyList_Check(elts))
2898 std::size_t sz=PyList_Size(elts);
2899 std::vector<int> ret(sz);
2900 for(std::size_t i=0;i<sz;i++)
2902 PyObject *elt=PyList_GetItem(elts,i);
2903 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2909 std::vector<int> ret(1);
2910 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2915 void __delitem__(PyObject *elts)
2917 if(PySlice_Check(elts))
2919 Py_ssize_t strt=2,stp=2,step=2;
2920 GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2921 self->eraseTimeStepIds2((int)strt,(int)stp,(int)step);
2925 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2926 if(!idsToRemove.empty())
2927 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2931 void eraseTimeStepIds(PyObject *li)
2935 std::vector<int> pos2;
2936 DataArrayInt32 *pos3=0;
2937 DataArrayIntTuple *pos4=0;
2938 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2943 self->eraseTimeStepIds(&pos1,&pos1+1);
2950 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2955 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2959 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2963 MEDFileAnyTypeFieldMultiTSIterator *__iter__()
2965 return self->iterator();
2968 PyObject *__getitem__(PyObject *elt0) const
2970 if(elt0 && PyList_Check(elt0))
2972 std::size_t sz=PyList_Size(elt0);
2973 MCAuto<DataArrayInt32> da=DataArrayInt32::New(); da->alloc(sz,1);
2974 int *pt=da->getPointer();
2975 for(std::size_t i=0;i<sz;i++,pt++)
2977 PyObject *elt1=PyList_GetItem(elt0,i);
2978 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2980 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2982 else if(elt0 && PySlice_Check(elt0))
2984 Py_ssize_t strt=2,stp=2,step=2;
2985 GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2986 return convertMEDFileFieldMultiTS(self->buildSubPartSlice((int)strt,(int)stp,(int)step),SWIG_POINTER_OWN | 0);
2989 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2992 bool changeMeshNames(PyObject *li)
2994 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2995 return self->changeMeshNames(modifTab);
2998 PyObject *splitComponents() const
3000 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
3001 std::size_t sz=ret.size();
3002 PyObject *retPy=PyList_New(sz);
3003 for(std::size_t i=0;i<sz;i++)
3004 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
3008 PyObject *splitDiscretizations() const
3010 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
3011 std::size_t sz=ret.size();
3012 PyObject *retPy=PyList_New(sz);
3013 for(std::size_t i=0;i<sz;i++)
3014 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
3018 PyObject *splitMultiDiscrPerGeoTypes() const
3020 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
3021 std::size_t sz=ret.size();
3022 PyObject *retPy=PyList_New(sz);
3023 for(std::size_t i=0;i<sz;i++)
3024 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
3028 void pushBackTimeSteps(PyObject *li)
3031 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
3032 if(SWIG_IsOK(status))
3034 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
3038 std::vector<MEDFileAnyTypeField1TS *> tmp;
3039 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
3040 self->pushBackTimeSteps(tmp);
3044 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
3046 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
3047 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3048 return self->extractPart(extractDefCpp,mm);
3051 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li)
3053 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
3054 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
3055 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
3056 std::size_t sz=ret.size();
3057 PyObject *retPy=PyList_New(sz);
3058 for(std::size_t i=0;i<sz;i++)
3060 std::size_t sz2=ret[i].size();
3061 PyObject *ret1Py=PyList_New(sz2);
3062 for(std::size_t j=0;j<sz2;j++)
3064 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
3067 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
3069 PyList_SetItem(retPy,i,ret1Py);
3074 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh)
3076 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
3077 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
3078 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
3079 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
3080 if(ret2.size()!=ret.size())
3082 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
3083 throw INTERP_KERNEL::Exception(oss.str().c_str());
3085 std::size_t sz=ret.size();
3086 PyObject *retPy=PyList_New(sz);
3087 for(std::size_t i=0;i<sz;i++)
3089 std::size_t sz2=ret[i].size();
3090 PyObject *ret0Py=PyTuple_New(2);
3091 PyObject *ret1Py=PyList_New(sz2);
3092 for(std::size_t j=0;j<sz2;j++)
3094 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
3097 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
3099 PyTuple_SetItem(ret0Py,0,ret1Py);
3100 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
3101 PyList_SetItem(retPy,i,ret0Py);
3108 class MEDFileInt32FieldMultiTS;
3109 class MEDFileInt64FieldMultiTS;
3111 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3114 static MEDFileFieldMultiTS *New();
3115 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3116 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3117 static MEDFileFieldMultiTS *New(DataArrayByte *db);
3119 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
3120 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3121 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3122 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3123 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3124 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3126 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
3127 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3128 MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
3131 static MEDFileAnyTypeFieldMultiTS *Aggregate(PyObject *fmtssPy, PyObject *dtsPy)
3133 std::vector<const MEDFileAnyTypeFieldMultiTS *> fmtss;
3134 convertFromPyObjVectorOfObj<const MEDFileAnyTypeFieldMultiTS *>(fmtssPy,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",fmtss);
3135 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > dts2;
3136 convertPyToVectorVectorPairInt(dtsPy,dts2);
3137 std::vector< std::vector< std::pair<int,mcIdType> > > dts(MEDVectorVectorMIIterator(0,dts2),MEDVectorVectorMIIterator(dts2.size(),dts2));
3138 MCAuto<MEDFileAnyTypeFieldMultiTS> ret = MEDFileFieldMultiTS::Aggregate(fmtss,dts);
3142 MEDFileFieldMultiTS()
3144 return MEDFileFieldMultiTS::New();
3147 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true)
3149 return MEDFileFieldMultiTS::New(fileName,loadAll);
3152 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3154 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
3157 MEDFileFieldMultiTS(DataArrayByte *db)
3159 return MEDFileFieldMultiTS::New(db);
3162 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3164 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3165 std::size_t sz(tmp.size());
3166 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3167 for(std::size_t i=0;i<sz;i++)
3169 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3170 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3172 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3175 std::string __str__() const
3177 return self->simpleRepr();
3180 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3182 DataArrayIdType *ret1=0;
3183 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3184 PyObject *ret=PyTuple_New(2);
3185 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3186 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3190 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const
3192 std::vector<INTERP_KERNEL::NormalizedCellType> types;
3193 std::vector< std::vector<TypeOfField> > typesF;
3194 std::vector< std::vector<std::string> > pfls;
3195 std::vector< std::vector<std::string> > locs;
3196 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
3197 std::size_t sz=ret.size();
3198 PyObject *ret2=PyList_New(sz);
3199 for(std::size_t i=0;i<sz;i++)
3201 const std::vector<DataArrayDouble *>& dadsI=ret[i];
3202 const std::vector<TypeOfField>& typesFI=typesF[i];
3203 const std::vector<std::string>& pflsI=pfls[i];
3204 const std::vector<std::string>& locsI=locs[i];
3205 PyObject *elt=PyTuple_New(2);
3206 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
3207 std::size_t sz2=ret[i].size();
3208 PyObject *elt2=PyList_New(sz2);
3209 for(std::size_t j=0;j<sz2;j++)
3211 PyObject *elt3=PyTuple_New(4);
3212 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
3213 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3214 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
3215 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
3216 PyList_SetItem(elt2,j,elt3);
3218 PyTuple_SetItem(elt,1,elt2);
3219 PyList_SetItem(ret2,i,elt);
3223 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const
3225 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
3231 PyObject *getUndergroundDataArrayExt(int iteration, int order) const
3233 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > > elt1Cpp;
3234 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
3237 PyObject *ret=PyTuple_New(2);
3238 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3239 std::size_t sz=elt1Cpp.size();
3240 PyObject *elt=PyList_New(sz);
3241 for(std::size_t i=0;i<sz;i++)
3243 PyObject *elt1=PyTuple_New(2);
3244 PyObject *elt2=PyTuple_New(2);
3245 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
3246 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
3247 PyObject *elt3=PyTuple_New(2);
3248 PyTuple_SetItem(elt3,0,PyInt_FromLong(elt1Cpp[i].second.first));
3249 PyTuple_SetItem(elt3,1,PyInt_FromLong(elt1Cpp[i].second.second));
3250 PyTuple_SetItem(elt1,0,elt2);
3251 PyTuple_SetItem(elt1,1,elt3);
3252 PyList_SetItem(elt,i,elt1);
3254 PyTuple_SetItem(ret,1,elt);
3260 class MEDFileFieldsIterator
3267 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3269 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3272 PyErr_SetString(PyExc_StopIteration,"No more data.");
3279 class MEDFileInt32FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3282 static MEDFileInt32FieldMultiTS *New();
3283 static MEDFileInt32FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3284 static MEDFileInt32FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3285 static MEDFileInt32FieldMultiTS *New(DataArrayByte *db);
3287 void appendFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
3288 void appendFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3289 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3290 MEDCouplingFieldInt32 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3291 MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3292 MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3293 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3294 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3295 MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3298 MEDFileInt32FieldMultiTS()
3300 return MEDFileInt32FieldMultiTS::New();
3303 MEDFileInt32FieldMultiTS(const std::string& fileName, bool loadAll=true)
3305 return MEDFileInt32FieldMultiTS::New(fileName,loadAll);
3308 MEDFileInt32FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3310 return MEDFileInt32FieldMultiTS::New(fileName,fieldName,loadAll);
3313 MEDFileInt32FieldMultiTS(DataArrayByte *db)
3315 return MEDFileInt32FieldMultiTS::New(db);
3318 static MEDFileInt32FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3320 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3321 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3322 return MEDFileInt32FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3325 std::string __str__() const
3327 return self->simpleRepr();
3330 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3332 DataArrayIdType *ret1=0;
3333 DataArrayInt32 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3334 PyObject *ret=PyTuple_New(2);
3335 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int32>::TI, SWIG_POINTER_OWN | 0 ));
3336 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3340 DataArrayInt32 *getUndergroundDataArray(int iteration, int order) const
3342 DataArrayInt32 *ret=self->getUndergroundDataArray(iteration,order);
3350 class MEDFileInt64FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3353 static MEDFileInt64FieldMultiTS *New();
3354 static MEDFileInt64FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3355 static MEDFileInt64FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3356 static MEDFileInt64FieldMultiTS *New(DataArrayByte *db);
3358 void appendFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
3359 void appendFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3360 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3361 MEDCouplingFieldInt64 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3362 MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3363 MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3364 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3365 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3366 MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3369 MEDFileInt64FieldMultiTS()
3371 return MEDFileInt64FieldMultiTS::New();
3374 MEDFileInt64FieldMultiTS(const std::string& fileName, bool loadAll=true)
3376 return MEDFileInt64FieldMultiTS::New(fileName,loadAll);
3379 MEDFileInt64FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3381 return MEDFileInt64FieldMultiTS::New(fileName,fieldName,loadAll);
3384 MEDFileInt64FieldMultiTS(DataArrayByte *db)
3386 return MEDFileInt64FieldMultiTS::New(db);
3389 static MEDFileInt64FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3391 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3392 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3393 return MEDFileInt64FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3396 std::string __str__() const
3398 return self->simpleRepr();
3401 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3403 DataArrayIdType *ret1=0;
3404 DataArrayInt64 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3405 PyObject *ret=PyTuple_New(2);
3406 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int64>::TI, SWIG_POINTER_OWN | 0 ));
3407 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3411 DataArrayInt64 *getUndergroundDataArray(int iteration, int order) const
3413 DataArrayInt64 *ret=self->getUndergroundDataArray(iteration,order);
3421 class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3424 static MEDFileFloatFieldMultiTS *New();
3425 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3426 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3427 static MEDFileFloatFieldMultiTS *New(DataArrayByte *db);
3429 void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
3430 void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3431 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3432 MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const;
3433 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3434 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3435 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3436 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3437 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3440 MEDFileFloatFieldMultiTS()
3442 return MEDFileFloatFieldMultiTS::New();
3445 MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true)
3447 return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
3450 MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3452 return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
3455 MEDFileFloatFieldMultiTS(DataArrayByte *db)
3457 return MEDFileFloatFieldMultiTS::New(db);
3460 static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3462 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3463 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3464 return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3467 std::string __str__() const
3469 return self->simpleRepr();
3472 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3474 DataArrayIdType *ret1=0;
3475 DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3476 PyObject *ret=PyTuple_New(2);
3477 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
3478 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3482 DataArrayFloat *getUndergroundDataArray(int iteration, int order) const
3484 DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
3492 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3495 static MEDFileMeshSupports *New(const std::string& fileName);
3496 std::vector<std::string> getSupMeshNames() const;
3499 MEDFileUMesh *getSupMeshWithName(const std::string& name) const
3501 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3502 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3510 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3513 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms);
3515 MEDFileStructureElements();
3518 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3521 static MEDFileFields *New();
3522 static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
3523 static MEDFileFields *New(DataArrayByte *db);
3524 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities);
3525 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
3526 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
3527 MEDFileFields *deepCopy() const;
3528 MEDFileFields *shallowCpy() const;
3530 void loadArraysIfNecessary();
3531 void unloadArrays();
3532 void unloadArraysWithoutDataLoss();
3533 int getNumberOfFields() const;
3534 std::vector<std::string> getFieldsNames() const;
3535 std::vector<std::string> getMeshesNames() const;
3537 void resize(int newSize);
3538 void pushField(MEDFileAnyTypeFieldMultiTS *field);
3539 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
3540 int getPosFromFieldName(const std::string& fieldName) const;
3541 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
3542 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
3543 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
3544 bool presenceOfStructureElements() const;
3545 void aggregate(const MEDFileFields& other);
3546 void killStructureElements();
3547 void keepOnlyStructureElements();
3548 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
3549 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
3550 void destroyFieldAtPos(int i);
3551 bool removeFieldsWithoutAnyTimeStep();
3556 return MEDFileFields::New();
3559 MEDFileFields(const std::string& fileName, bool loadAll=true)
3561 return MEDFileFields::New(fileName,loadAll);
3564 MEDFileFields(DataArrayByte *db)
3566 return MEDFileFields::New(db);
3569 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities)
3571 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3574 std::string __str__() const
3576 return self->simpleRepr();
3579 MEDFileFields *partOfThisOnStructureElements() const
3581 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3585 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const
3587 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3591 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true)
3593 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3594 std::size_t sz(tmp.size());
3595 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3596 for(std::size_t i=0;i<sz;i++)
3598 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3599 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3601 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3604 PyObject *getMeshSENames() const
3606 std::vector< std::pair<std::string,std::string> > ps;
3607 self->getMeshSENames(ps);
3608 return convertVectPairStToPy(ps);
3611 PyObject *getCommonIterations() const
3614 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3615 PyObject *ret=PyTuple_New(2);
3616 PyObject *ret_0=PyList_New(ret0.size());
3618 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3620 PyObject *elt=PyTuple_New(2);
3621 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3622 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3623 PyList_SetItem(ret_0,rk,elt);
3625 PyTuple_SetItem(ret,0,ret_0);
3626 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3627 PyTuple_SetItem(ret,1,ret_1);
3631 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3633 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3634 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3637 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3639 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3640 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3643 PyObject *__getitem__(PyObject *obj)
3645 if(obj && PyList_Check(obj))
3647 std::size_t sz=PyList_Size(obj);
3648 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3649 int *pt=da->getPointer();
3650 for(std::size_t i=0;i<sz;i++,pt++)
3652 PyObject *elt1=PyList_GetItem(obj,i);
3653 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3655 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3658 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3661 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field)
3663 self->setFieldAtPos(obj,field);
3669 return self->getNumberOfFields();
3672 MEDFileFieldsIterator *__iter__()
3674 return self->iterator();
3677 bool changeMeshNames(PyObject *li)
3679 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3680 return self->changeMeshNames(modifTab);
3683 int getPosOfField(PyObject *elt0) const
3685 static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
3687 throw INTERP_KERNEL::Exception(msg);
3688 if(PyInt_Check(elt0))
3690 return (int)PyInt_AS_LONG(elt0);
3692 return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
3695 std::vector<int> getPosOfFields(PyObject *elts) const
3697 if(PyList_Check(elts))
3699 std::size_t sz=PyList_Size(elts);
3700 std::vector<int> ret(sz);
3701 for(std::size_t i=0;i<sz;i++)
3703 PyObject *elt=PyList_GetItem(elts,i);
3704 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3710 std::vector<int> ret(1);
3711 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3716 void pushFields(PyObject *fields)
3718 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3719 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3720 self->pushFields(tmp);
3723 void __delitem__(PyObject *elts)
3725 if(elts && PySlice_Check(elts))
3727 Py_ssize_t strt=2,stp=2,step=2;
3728 GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3729 self->destroyFieldsAtPos2((int)strt,(int)stp,(int)step);
3733 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3734 if(!idsToRemove.empty())
3735 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3739 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
3741 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
3742 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3743 return self->extractPart(extractDefCpp,mm);
3746 MEDFileFields *linearToQuadratic(const MEDFileMeshes *oldLin, const MEDFileMeshes *newQuad) const
3748 MCAuto<MEDFileFields> ret(self->linearToQuadratic(oldLin,newQuad));
3754 class MEDFileParameter1TS : public RefCountObject
3757 void setIteration(int it);
3758 int getIteration() const;
3759 void setOrder(int order);
3760 int getOrder() const;
3761 void setTimeValue(double time);
3762 void setTime(int dt, int it, double time);
3763 double getTime(int& dt, int& it);
3764 double getTimeValue() const;
3767 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3770 void setValue(double val);
3771 double getValue() const;
3772 std::string simpleRepr() const;
3775 std::string __str__() const
3777 return self->simpleRepr();
3782 class MEDFileParameterTinyInfo : public MEDFileWritable
3785 void setDescription(const std::string& name);
3786 std::string getDescription() const;
3787 void setTimeUnit(const std::string& unit);
3788 std::string getTimeUnit() const;
3791 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3794 static MEDFileParameterDouble1TS *New();
3795 static MEDFileParameterDouble1TS *New(const std::string& fileName);
3796 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName);
3797 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it);
3798 virtual MEDFileParameter1TS *deepCopy() const;
3799 virtual std::string simpleRepr() const;
3800 void setName(const std::string& name);
3801 std::string getName() const;
3802 void write(const std::string& fileName, int mode) const;
3805 MEDFileParameterDouble1TS()
3807 return MEDFileParameterDouble1TS::New();
3810 MEDFileParameterDouble1TS(const std::string& fileName)
3812 return MEDFileParameterDouble1TS::New(fileName);
3815 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName)
3817 return MEDFileParameterDouble1TS::New(fileName,paramName);
3820 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it)
3822 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3825 std::string __str__() const
3827 return self->simpleRepr();
3830 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const
3833 bool ret0=self->isEqual(other,eps,what);
3834 PyObject *res=PyList_New(2);
3835 PyObject *ret0Py=ret0?Py_True:Py_False;
3837 PyList_SetItem(res,0,ret0Py);
3838 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3844 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3847 static MEDFileParameterMultiTS *New();
3848 static MEDFileParameterMultiTS *New(const std::string& fileName);
3849 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName);
3850 std::string getName() const;
3851 void setName(const std::string& name);
3852 MEDFileParameterMultiTS *deepCopy() const;
3853 void write(const std::string& fileName, int mode) const;
3854 std::string simpleRepr() const;
3855 void appendValue(int dt, int it, double time, double val);
3856 double getDoubleValue(int iteration, int order) const;
3857 int getPosOfTimeStep(int iteration, int order) const;
3858 int getPosGivenTime(double time, double eps=1e-8) const;
3859 int getNumberOfTS() const;
3862 MEDFileParameterMultiTS()
3864 return MEDFileParameterMultiTS::New();
3867 MEDFileParameterMultiTS(const std::string& fileName)
3869 return MEDFileParameterMultiTS::New(fileName);
3872 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3874 return MEDFileParameterMultiTS::New(fileName,paramName);
3877 std::string __str__() const
3879 return self->simpleRepr();
3882 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const
3885 bool ret0=self->isEqual(other,eps,what);
3886 PyObject *res=PyList_New(2);
3887 PyObject *ret0Py=ret0?Py_True:Py_False;
3889 PyList_SetItem(res,0,ret0Py);
3890 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3894 void eraseTimeStepIds(PyObject *ids)
3898 std::vector<int> pos2;
3899 DataArrayInt *pos3=0;
3900 DataArrayIntTuple *pos4=0;
3901 convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3906 self->eraseTimeStepIds(&pos1,&pos1+1);
3913 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3918 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3922 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3926 int getTimeStepId(PyObject *elt0) const
3928 if(elt0 && PyInt_Check(elt0))
3930 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3933 else if(elt0 && PyTuple_Check(elt0))
3935 if(PyTuple_Size(elt0)==2)
3937 PyObject *o0=PyTuple_GetItem(elt0,0);
3938 PyObject *o1=PyTuple_GetItem(elt0,1);
3939 if(PyInt_Check(o0) && PyInt_Check(o1))
3941 int iter=(int)PyInt_AS_LONG(o0);
3942 int order=(int)PyInt_AS_LONG(o1);
3943 return self->getPosOfTimeStep(iter,order);
3946 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 !");
3949 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 !");
3951 else if(elt0 && PyFloat_Check(elt0))
3953 double val=PyFloat_AS_DOUBLE(elt0);
3954 return self->getPosGivenTime(val);
3957 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3960 MEDFileParameter1TS *__getitem__(PyObject *elt0) const
3962 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3968 std::vector<int> getTimeStepIds(PyObject *elts) const
3970 if(PyList_Check(elts))
3972 std::size_t sz=PyList_Size(elts);
3973 std::vector<int> ret(sz);
3974 for(std::size_t i=0;i<sz;i++)
3976 PyObject *elt=PyList_GetItem(elts,i);
3977 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3983 std::vector<int> ret(1);
3984 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3989 void __delitem__(PyObject *elts)
3991 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3992 if(!idsToRemove.empty())
3993 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3996 MEDFileParameter1TS *getTimeStepAtPos(int posId) const
3998 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
4004 PyObject *getIterations() const
4006 std::vector< std::pair<int,int> > res=self->getIterations();
4007 PyObject *ret=PyList_New(res.size());
4009 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
4011 PyObject *elt=PyTuple_New(2);
4012 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
4013 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
4014 PyList_SetItem(ret,rk,elt);
4019 PyObject *getTimeSteps() const
4021 std::vector<double> res2;
4022 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
4023 PyObject *ret=PyList_New(res.size());
4025 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
4027 PyObject *elt=PyTuple_New(3);
4028 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
4029 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
4030 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
4031 PyList_SetItem(ret,rk,elt);
4038 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
4041 static MEDFileParameters *New();
4042 static MEDFileParameters *New(const std::string& fileName);
4043 static MEDFileParameters *New(DataArrayByte *db);
4044 MEDFileParameters *deepCopy() const;
4045 std::vector<std::string> getParamsNames() const;
4046 std::string simpleRepr() const;
4047 void resize(int newSize);
4048 void pushParam(MEDFileParameterMultiTS *param);
4049 void setParamAtPos(int i, MEDFileParameterMultiTS *param);
4050 void destroyParamAtPos(int i);
4051 int getPosFromParamName(const std::string& paramName) const;
4052 int getNumberOfParams() const;
4057 return MEDFileParameters::New();
4060 MEDFileParameters(const std::string& fileName)
4062 return MEDFileParameters::New(fileName);
4065 MEDFileParameters(DataArrayByte *db)
4067 return MEDFileParameters::New(db);
4070 std::string __str__() const
4072 return self->simpleRepr();
4075 MEDFileParameterMultiTS *__getitem__(PyObject *obj)
4077 static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
4078 if(PyInt_Check(obj))
4080 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
4085 MEDFileParameterMultiTS *ret(self->getParamWithName(convertPyObjectToStr(obj,msg)));
4093 return self->getNumberOfParams();
4096 MEDFileParameterMultiTS *getParamAtPos(int i) const
4098 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
4104 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const
4106 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
4112 PyObject *isEqual(const MEDFileParameters *other, double eps) const
4115 bool ret0=self->isEqual(other,eps,what);
4116 PyObject *res=PyList_New(2);
4117 PyObject *ret0Py=ret0?Py_True:Py_False;
4119 PyList_SetItem(res,0,ret0Py);
4120 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
4126 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
4129 static MEDFileData *New(DataArrayByte *db);
4130 static MEDFileData *New(const std::string& fileName);
4131 static MEDFileData *New();
4132 MEDFileData *deepCopy() const;
4133 void setFields(MEDFileFields *fields);
4134 void setMeshes(MEDFileMeshes *meshes);
4135 void setParams(MEDFileParameters *params);
4136 int getNumberOfFields() const;
4137 int getNumberOfMeshes() const;
4138 int getNumberOfParams() const;
4140 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName);
4141 bool unPolyzeMeshes();
4142 void dealWithStructureElements();
4143 std::string getHeader() const;
4144 void setHeader(const std::string& header);
4148 MEDFileData(const std::string& fileName)
4150 return MEDFileData::New(fileName);
4153 MEDFileData(DataArrayByte *db)
4155 return MEDFileData::New(db);
4160 return MEDFileData::New();
4163 std::string __str__() const
4165 return self->simpleRepr();
4168 MEDFileMeshes *getMeshes() const
4170 MEDFileMeshes *ret=self->getMeshes();
4176 MEDFileParameters *getParams() const
4178 MEDFileParameters *ret=self->getParams();
4184 MEDFileFields *getFields() const
4186 MEDFileFields *ret=self->getFields();
4192 bool changeMeshNames(PyObject *li)
4194 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
4195 return self->changeMeshNames(modifTab);
4198 static MEDFileData *Aggregate(PyObject *mfds)
4200 std::vector<const MEDFileData *> mfdsCpp;
4201 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
4202 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
4208 class SauvReader : public RefCountObject
4211 static SauvReader* New(const std::string& fileName);
4212 MEDFileData * loadInMEDFileDS();
4215 SauvReader(const std::string& fileName)
4217 return SauvReader::New(fileName);
4222 class SauvWriter : public RefCountObject
4225 static SauvWriter * New();
4226 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0);
4227 void write(const std::string& fileName);
4228 void setCpyGrpIfOnASingleFamilyStatus(bool status);
4229 bool getCpyGrpIfOnASingleFamilyStatus() const;
4234 return SauvWriter::New();
4241 class MEDFileMeshStruct;
4243 class MEDFileField1TSStructItem
4246 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt);
4249 class MEDFileMeshStruct : public RefCountObject
4252 static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
4254 ~MEDFileMeshStruct();
4257 class MEDMeshMultiLev : public RefCountObject
4260 virtual MEDMeshMultiLev *prepare() const;
4261 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const;
4262 DataArrayIdType *retrieveGlobalNodeIdsIfAny() const;
4268 PyObject *retrieveFamilyIdsOnCells() const
4270 DataArrayIdType *famIds(0);
4271 bool isWithoutCopy(false);
4272 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
4273 PyObject *ret=PyTuple_New(2);
4274 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4276 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4277 PyTuple_SetItem(ret,1,ret1Py);
4281 PyObject *retrieveNumberIdsOnCells() const
4283 DataArrayIdType *numIds(0);
4284 bool isWithoutCopy(false);
4285 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
4286 PyObject *ret=PyTuple_New(2);
4287 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4289 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4290 PyTuple_SetItem(ret,1,ret1Py);
4294 PyObject *retrieveFamilyIdsOnNodes() const
4296 DataArrayIdType *famIds(0);
4297 bool isWithoutCopy(false);
4298 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
4299 PyObject *ret=PyTuple_New(2);
4300 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4302 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4303 PyTuple_SetItem(ret,1,ret1Py);
4307 PyObject *retrieveNumberIdsOnNodes() const
4309 DataArrayIdType *numIds(0);
4310 bool isWithoutCopy(false);
4311 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
4312 PyObject *ret=PyTuple_New(2);
4313 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4315 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4316 PyTuple_SetItem(ret,1,ret1Py);
4320 PyObject *getGeoTypes() const
4322 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
4323 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4324 PyObject *res(PyList_New(result.size()));
4325 for(int i=0;iL!=result.end(); i++, iL++)
4326 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4332 class MEDUMeshMultiLev : public MEDMeshMultiLev
4335 ~MEDUMeshMultiLev();
4339 PyObject *buildVTUArrays() const
4341 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayIdType *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
4342 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
4343 PyObject *ret0Py=ncc?Py_True:Py_False;
4345 PyObject *ret=PyTuple_New(7);
4346 PyTuple_SetItem(ret,0,ret0Py);
4347 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4348 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
4349 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4350 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4351 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4352 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4358 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
4361 ~MEDStructuredMeshMultiLev();
4364 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4367 ~MEDCMeshMultiLev();
4371 PyObject *buildVTUArrays() const
4374 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4375 std::size_t sz(objs.size());
4376 PyObject *ret(PyTuple_New(2));
4377 PyObject *ret0=PyList_New(sz);
4378 for(std::size_t i=0;i<sz;i++)
4379 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4380 PyTuple_SetItem(ret,0,ret0);
4381 PyObject *ret1Py(isInternal?Py_True:Py_False);
4383 PyTuple_SetItem(ret,1,ret1Py);
4389 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4392 ~MEDCurveLinearMeshMultiLev();
4396 PyObject *buildVTUArrays() const
4398 DataArrayDouble *ret0(0);
4399 std::vector<mcIdType> ret1;
4401 self->buildVTUArrays(ret0,ret1,ret2);
4402 std::size_t sz(ret1.size());
4403 PyObject *ret=PyTuple_New(3);
4404 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4405 PyObject *ret1Py=PyList_New(sz);
4406 for(std::size_t i=0;i<sz;i++)
4407 PyList_SetItem(ret1Py,i,PyInt_FromLong(ret1[i]));
4408 PyTuple_SetItem(ret,1,ret1Py);
4409 PyObject *ret2Py(ret2?Py_True:Py_False);
4411 PyTuple_SetItem(ret,2,ret2Py);
4417 class MEDFileFastCellSupportComparator : public RefCountObject
4420 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
4421 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4422 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4423 int getNumberOfTS() const;
4425 ~MEDFileFastCellSupportComparator();
4429 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const
4431 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4432 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4433 PyObject *res(PyList_New(result.size()));
4434 for(int i=0;iL!=result.end(); i++, iL++)
4435 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4441 class MeshFormatReader
4444 MeshFormatReader(const std::string& meshFileName, const std::vector<std::string>& fieldFileName);
4446 MEDFileData* loadInMedFileDS();
4447 void setMeshName(const std::string& theMeshName);
4448 std::string getMeshName() const;
4449 void setFile(const std::string& theFileName);
4450 void setFieldFileNames(const std::vector<std::string>& theFieldFileNames);
4451 std::vector<std::string> getFieldFileNames() const;
4453 class MeshFormatWriter
4456 MeshFormatWriter(const std::string& meshFileName, const std::vector<std::string>& fieldFileNames);
4458 void setMeshFileName(const std::string& meshFileName);
4459 std::string getMeshFileName() const;
4460 void setFieldFileNames(const std::vector<std::string>& fieldFileNames);
4461 std::vector<std::string> getFieldFileNames() const;
4462 void setMEDFileDS(MEDCoupling::MEDFileData* mfd);
4470 self.loadArraysIfNecessary()
4472 def exit1TS(self, exctype, exc, tb):
4473 self.unloadArraysWithoutDataLoss()
4475 MEDFileAnyTypeField1TS.__enter__=enter1TS
4476 MEDFileAnyTypeField1TS.__exit__=exit1TS
4477 MEDFileIntField1TS = MEDFileInt32Field1TS
4478 MEDFileIntFieldMultiTS = MEDFileInt32FieldMultiTS
4479 if MEDCouplingUse64BitIDs():
4480 MEDFileIDField1TS = MEDFileInt64Field1TS
4481 MEDFileIDFieldMultiTS = MEDFileInt64FieldMultiTS
4483 MEDFileIDField1TS = MEDFileInt32Field1TS
4484 MEDFileIDFieldMultiTS = MEDFileInt32FieldMultiTS