1 // Copyright (C) 2017-2020 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
21 #define MEDCOUPLING_EXPORT
22 #define MEDLOADER_EXPORT
24 #ifdef WITH_DOCSTRINGS
25 %include "MEDLoader_doc.i"
28 %include "MEDCouplingCommon.i"
31 #include "MEDLoader.hxx"
32 #include "MEDFileJoint.hxx"
33 #include "MEDFileMesh.hxx"
34 #include "MEDFileField.hxx"
35 #include "MEDFileParameter.hxx"
36 #include "MEDFileData.hxx"
37 #include "MEDFileEquivalence.hxx"
38 #include "MEDFileEntities.hxx"
39 #include "MEDFileMeshReadSelector.hxx"
40 #include "MEDFileFieldOverView.hxx"
41 #include "MEDCouplingTypemaps.i"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
46 using namespace MEDCoupling;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) MEDCoupling::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) MEDCoupling::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) MEDCoupling::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject ReadUMeshFromFamiliesSwig;
79 %newobject ReadUMeshFromGroupsSwig;
80 %newobject ReadFieldSwig;
81 %newobject MEDCoupling::ReadUMeshFromFile;
82 %newobject MEDCoupling::ReadMeshFromFile;
83 %newobject MEDCoupling::ReadFieldCell;
84 %newobject MEDCoupling::ReadFieldNode;
85 %newobject MEDCoupling::ReadFieldGauss;
86 %newobject MEDCoupling::ReadFieldGaussNE;
87 %newobject MEDCoupling::MEDFileMesh::New;
88 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
89 %newobject MEDCoupling::MEDFileMesh::deepCopy;
90 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
91 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
92 %newobject MEDCoupling::MEDFileMesh::__getitem__;
93 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
94 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
95 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
97 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
101 %newobject MEDCoupling::MEDFileMesh::getGlobalNumFieldAtLevel;
102 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
103 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
104 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
105 %newobject MEDCoupling::MEDFileMesh::cartesianize;
106 %newobject MEDCoupling::MEDFileData::getJoints;
107 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
108 %newobject MEDCoupling::MEDFileUMesh::New;
109 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
110 %newobject MEDCoupling::MEDFileUMesh::getCoords;
111 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
112 %newobject MEDCoupling::MEDFileUMesh::getGroup;
113 %newobject MEDCoupling::MEDFileUMesh::getGroups;
114 %newobject MEDCoupling::MEDFileUMesh::getFamily;
115 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
116 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
120 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
121 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
123 %newobject MEDCoupling::MEDFileUMesh::computeFetchedNodeIds;
124 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
125 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
126 %newobject MEDCoupling::MEDFileUMesh::extractPart;
127 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
128 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
129 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
130 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
131 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
132 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
133 %newobject MEDCoupling::MEDFileCMesh::New;
134 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
136 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
137 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
138 %newobject MEDCoupling::MEDFileMeshes::New;
139 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
140 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
141 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
142 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
143 %newobject MEDCoupling::MEDFileMeshes::__iter__;
145 %newobject MEDCoupling::MEDFileMeshSupports::New;
146 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
148 %newobject MEDCoupling::MEDFileStructureElements::New;
150 %newobject MEDCoupling::MEDFileFields::New;
151 %newobject MEDCoupling::MEDFileFields::NewAdv;
152 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
153 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
154 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
155 %newobject MEDCoupling::MEDFileFields::deepCopy;
156 %newobject MEDCoupling::MEDFileFields::shallowCpy;
157 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
158 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
159 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
160 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
161 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
162 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
163 %newobject MEDCoupling::MEDFileFields::__iter__;
164 %newobject MEDCoupling::MEDFileFields::extractPart;
165 %newobject MEDCoupling::MEDFileFields::linearToQuadratic;
167 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
168 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
169 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
170 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
173 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
174 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
175 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
176 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
177 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
178 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
179 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
182 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
183 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
184 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
185 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
187 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::New;
188 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::field;
189 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::LoadSpecificEntities;
190 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getUndergroundDataArray;
191 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::convertToDouble;
192 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevel;
193 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtTopLevel;
194 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldOnMeshAtLevel;
195 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevelOld;
197 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::New;
198 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::field;
199 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::LoadSpecificEntities;
200 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getUndergroundDataArray;
201 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::convertToDouble;
202 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevel;
203 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtTopLevel;
204 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldOnMeshAtLevel;
205 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevelOld;
207 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::New;
208 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::field;
209 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::LoadSpecificEntities;
210 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getUndergroundDataArray;
211 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::convertToDouble;
212 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevel;
213 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtTopLevel;
214 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldOnMeshAtLevel;
215 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevelOld;
217 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
218 %newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
219 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
220 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
221 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
222 %newobject MEDCoupling::MEDFileField1TS::New;
223 %newobject MEDCoupling::MEDFileField1TS::field;
224 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
225 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
226 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
227 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
228 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
229 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
231 %newobject MEDCoupling::MEDFileInt32Field1TS::New;
232 %newobject MEDCoupling::MEDFileInt32Field1TS::field;
233 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevel;
234 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtTopLevel;
235 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldOnMeshAtLevel;
236 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevelOld;
237 %newobject MEDCoupling::MEDFileInt32Field1TS::getUndergroundDataArray;
238 %newobject MEDCoupling::MEDFileInt32Field1TS::convertToDouble;
240 %newobject MEDCoupling::MEDFileInt64Field1TS::New;
241 %newobject MEDCoupling::MEDFileInt64Field1TS::field;
242 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevel;
243 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtTopLevel;
244 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldOnMeshAtLevel;
245 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevelOld;
246 %newobject MEDCoupling::MEDFileInt64Field1TS::getUndergroundDataArray;
247 %newobject MEDCoupling::MEDFileInt64Field1TS::convertToDouble;
249 %newobject MEDCoupling::MEDFileFloatField1TS::New;
250 %newobject MEDCoupling::MEDFileFloatField1TS::field;
251 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevel;
252 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtTopLevel;
253 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldOnMeshAtLevel;
254 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevelOld;
255 %newobject MEDCoupling::MEDFileFloatField1TS::getUndergroundDataArray;
256 %newobject MEDCoupling::MEDFileFloatField1TS::convertToDouble;
258 %newobject MEDCoupling::MEDFileData::New;
259 %newobject MEDCoupling::MEDFileData::deepCopy;
260 %newobject MEDCoupling::MEDFileData::getMeshes;
261 %newobject MEDCoupling::MEDFileData::getFields;
262 %newobject MEDCoupling::MEDFileData::getParams;
263 %newobject MEDCoupling::MEDFileData::Aggregate;
265 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
267 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
268 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
269 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
270 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
271 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
272 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
273 %newobject MEDCoupling::MEDFileParameters::New;
274 %newobject MEDCoupling::MEDFileParameters::deepCopy;
275 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
276 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
277 %newobject MEDCoupling::MEDFileParameters::__getitem__;
279 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
280 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
281 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
282 %newobject MEDCoupling::MEDFileJointCorrespondence::getCorrespondence;
283 %newobject MEDCoupling::MEDFileJointOneStep::New;
284 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
285 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
286 %newobject MEDCoupling::MEDFileJointOneStep::getCorrespondenceAtPos;
287 %newobject MEDCoupling::MEDFileJointOneStep::__getitem__;
288 %newobject MEDCoupling::MEDFileJoint::New;
289 %newobject MEDCoupling::MEDFileJoint::deepCopy;
290 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
291 %newobject MEDCoupling::MEDFileJoint::getStepAtPos;
292 %newobject MEDCoupling::MEDFileJoint::__getitem__;
293 %newobject MEDCoupling::MEDFileJoints::New;
294 %newobject MEDCoupling::MEDFileJoints::deepCopy;
295 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
296 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
297 %newobject MEDCoupling::MEDFileJoints::__getitem__;
298 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
299 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
300 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
301 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
302 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
303 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
304 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
305 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
306 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
308 %newobject MEDCoupling::SauvWriter::New;
309 %newobject MEDCoupling::SauvReader::New;
310 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
312 %newobject MEDCoupling::MEDFileMeshStruct::New;
313 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
314 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
315 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
316 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
317 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
319 %feature("unref") MEDFileMesh "$this->decrRef();"
320 %feature("unref") MEDFileUMesh "$this->decrRef();"
321 %feature("unref") MEDFileCMesh "$this->decrRef();"
322 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
323 %feature("unref") MEDFileMeshes "$this->decrRef();"
324 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
325 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
326 %feature("unref") MEDFileField1TS "$this->decrRef();"
327 %feature("unref") MEDFileInt32Field1TS "$this->decrRef();"
328 %feature("unref") MEDFileInt64Field1TS "$this->decrRef();"
329 %feature("unref") MEDFileFloatField1TS "$this->decrRef();"
330 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
331 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
332 %feature("unref") MEDFileInt32FieldMultiTS "$this->decrRef();"
333 %feature("unref") MEDFileInt64FieldMultiTS "$this->decrRef();"
334 %feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();"
335 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
336 %feature("unref") MEDFileStructureElements "$this->decrRef();"
337 %feature("unref") MEDFileFields "$this->decrRef();"
338 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
339 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
340 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
341 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
342 %feature("unref") MEDFileParameters "$this->decrRef();"
343 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
344 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
345 %feature("unref") MEDFileJoint "$this->decrRef();"
346 %feature("unref") MEDFileJoints "$this->decrRef();"
347 %feature("unref") MEDFileEquivalences "$this->decrRef();"
348 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
349 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
350 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
351 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
352 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
353 %feature("unref") MEDFileData "$this->decrRef();"
354 %feature("unref") SauvReader "$this->decrRef();"
355 %feature("unref") SauvWriter "$this->decrRef();"
356 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
357 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
358 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
359 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
360 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
361 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
363 namespace MEDCoupling
366 std::string MEDFileVersionStr();
367 std::string MEDFileVersionOfFileStr(const std::string& fileName);
368 void SetEpsilonForNodeComp(double val);
369 void SetCompPolicyForCell(int val);
370 void SetTooLongStrPolicy(int val);
371 void CheckFileForRead(const std::string& fileName);
372 std::vector<std::string> GetMeshNames(const std::string& fileName);
373 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName);
374 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName);
375 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName);
376 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName);
377 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName);
378 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
379 std::vector<std::string> GetAllFieldNames(const std::string& fileName);
380 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName);
381 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
382 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
383 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order);
384 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj);
385 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
386 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
387 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
388 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
389 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName);
390 MEDCoupling::MEDCouplingField *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
391 MEDCoupling::MEDCouplingField *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
392 MEDCoupling::MEDCouplingField *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
393 MEDCoupling::MEDCouplingField *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
394 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch);
395 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
396 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
397 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
398 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
399 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingField *f);
402 %rename (MEDFileVersion) MEDFileVersionSwig;
403 %rename (GetFieldIterations) GetFieldIterationsSwig;
404 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
405 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
406 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
407 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
408 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
409 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
410 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
411 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
412 %rename (WriteUMeshes) WriteUMeshesSwig;
413 %rename (GetTypesOfField) GetTypesOfFieldSwig;
414 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
415 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
416 %rename (ReadField) ReadFieldSwig;
417 %rename (GetFamiliesGroupsInfo) GetFamiliesGroupsInfoSwig;
421 PyObject *MEDFileVersionSwig()
423 int major,minor,release;
424 MEDCoupling::MEDFileVersion(major,minor,release);
425 PyObject *ret(PyTuple_New(3));
426 PyTuple_SetItem(ret,0,SWIG_From_int(major));
427 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
428 PyTuple_SetItem(ret,2,SWIG_From_int(release));
432 int MEDFileSizeOfMedInt()
434 return 8*sizeof(med_int);
437 PyObject *GetFamiliesGroupsInfoSwig(const std::string& fileName, const std::string& meshName)
439 std::map<std::string,mcIdType> families;
440 std::map<std::string,std::vector<std::string>> groupsOnFam;
441 MEDCoupling::GetFamiliesGroupsInfo(fileName,meshName,families,groupsOnFam);
442 AutoPyPtr a(convertMapStringInt(families)),b(convertMapStringVectString(groupsOnFam));
443 AutoPyPtr ret(PyTuple_New(2));
444 PyTuple_SetItem(ret,0,a.retn());
445 PyTuple_SetItem(ret,1,b.retn());
449 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName)
451 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName));
455 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName)
457 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName));
461 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order)
463 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
467 MEDCoupling::MEDCouplingField *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
469 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
473 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
475 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
476 PyObject *ret=PyList_New(res.size());
478 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
480 PyObject *elt=PyTuple_New(2);
481 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
482 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
483 PyList_SetItem(ret,rk,elt);
488 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName)
490 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
491 PyObject *ret=PyList_New(res.size());
493 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
495 PyObject *elt=PyTuple_New(3);
496 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
497 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
498 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
499 PyList_SetItem(ret,rk,elt);
504 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
506 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
507 PyObject *ret=PyList_New(res.size());
509 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
511 PyObject *elt=PyTuple_New(2);
512 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
513 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
514 PyList_SetItem(ret,rk,elt);
519 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
521 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
522 PyObject *ret=PyList_New(res.size());
524 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
526 PyObject *elt=PyTuple_New(2);
527 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
528 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
529 PyList_SetItem(ret,rk,elt);
534 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName)
536 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
537 PyObject *ret=PyList_New(res.size());
539 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
541 PyObject *elt=PyTuple_New(2);
542 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
543 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
544 PyList_SetItem(ret,rk,elt);
549 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName)
551 int meshDim,spaceDim;
552 mcIdType numberOfNodes;
553 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
554 PyObject *ret=PyTuple_New(4);
555 PyObject *elt0=PyList_New(res.size());
557 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
559 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
561 PyObject *elt1=PyList_New(obj2.size());
562 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
564 PyObject *elt2=PyTuple_New(2);
565 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
566 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
567 PyList_SetItem(elt1,j,elt2);
569 PyList_SetItem(elt0,i,elt1);
571 PyTuple_SetItem(ret,0,elt0);
572 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
573 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
574 PyTuple_SetItem(ret,3,SWIG_From_long(numberOfNodes));
578 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
579 const std::string& fieldName, PyObject *liIts)
581 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
582 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
583 return convertFieldDoubleVecToPy(res);
586 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
588 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
589 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
590 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
593 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
595 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
596 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
597 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
600 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch)
602 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
603 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
604 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
607 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
609 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
610 std::size_t size=v.size();
611 PyObject *ret=PyList_New(size);
612 for(std::size_t i=0;i<size;i++)
613 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
617 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
619 std::vector<std::string> grps;
620 converPyListToVecString(li,grps);
621 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
624 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
626 std::vector<std::string> fams;
627 converPyListToVecString(li,fams);
628 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
632 namespace MEDCoupling
634 class MEDFileWritable
637 void copyOptionsFrom(const MEDFileWritable& other) const;
638 int getTooLongStrPolicy() const;
639 void setTooLongStrPolicy(int newVal);
640 int getZipConnPolicy();
641 void setZipConnPolicy(int newVal);
644 class MEDFileWritableStandAlone : public MEDFileWritable
647 void write(const std::string& fileName, int mode) const;
648 void write33(const std::string& fileName, int mode) const;
649 void write30(const std::string& fileName, int mode) const;
652 DataArrayByte *serialize() const
654 MCAuto<DataArrayByte> ret(self->serialize());
658 PyObject *__getstate__()
660 PyObject *ret(PyList_New(0));
664 void __setstate__(PyObject *inp)
670 class MEDFileMeshReadSelector
673 MEDFileMeshReadSelector();
674 MEDFileMeshReadSelector(unsigned int code);
675 unsigned int getCode() const;
676 void setCode(unsigned int newCode);
677 bool isCellFamilyFieldReading() const;
678 bool isNodeFamilyFieldReading() const;
679 bool isCellNameFieldReading() const;
680 bool isNodeNameFieldReading() const;
681 bool isCellNumFieldReading() const;
682 bool isNodeNumFieldReading() const;
683 bool isGlobalNodeNumFieldReading() const;
684 void setCellFamilyFieldReading(bool b);
685 void setNodeFamilyFieldReading(bool b);
686 void setCellNameFieldReading(bool b);
687 void setNodeNameFieldReading(bool b);
688 void setCellNumFieldReading(bool b);
689 void setNodeNumFieldReading(bool b);
690 void setGlobalNodeNumFieldReading(bool b);
693 std::string __str__() const
695 std::ostringstream oss;
700 std::string __repr__() const
702 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
708 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
711 static MEDFileJointCorrespondence *New();
712 static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence) // nodes
714 static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence, // cells
715 INTERP_KERNEL::NormalizedCellType loc_geo_type,
716 INTERP_KERNEL::NormalizedCellType rem_geo_type)
718 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
719 MEDFileJointCorrespondence *deepCopy() const;
720 MEDFileJointCorrespondence *shallowCpy() const;
721 void setIsNodal(bool isNodal);
722 bool getIsNodal() const;
723 bool isEqual(const MEDFileJointCorrespondence *other) const;
724 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
725 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
726 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
727 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
728 void setCorrespondence(DataArrayIdType *corr);
729 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const;
730 std::string simpleRepr() const;
733 MEDFileJointCorrespondence()
735 return MEDFileJointCorrespondence::New();
737 MEDFileJointCorrespondence(DataArrayIdType* correspondence)
739 return MEDFileJointCorrespondence::New(correspondence);
741 MEDFileJointCorrespondence(DataArrayIdType* correspondence, // cells
742 INTERP_KERNEL::NormalizedCellType loc_geo_type,
743 INTERP_KERNEL::NormalizedCellType rem_geo_type)
745 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
748 std::string __str__() const
750 return self->simpleRepr();
753 DataArrayIdType *getCorrespondence() const
755 const DataArrayIdType *ret(self->getCorrespondence());
758 return const_cast<DataArrayIdType *>(ret);
763 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
766 static MEDFileJointOneStep *New(int dt=-1, int it=-1);
767 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1);
768 MEDFileJointOneStep *deepCopy() const;
769 MEDFileJointOneStep *shallowCpy() const;
770 bool isEqual(const MEDFileJointOneStep *other) const;
771 void setOrder(int order);
772 int getOrder() const;
773 void setIteration(int it);
774 int getIteration() const;
775 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
776 int getNumberOfCorrespondences() const;
777 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const;
778 std::string simpleRepr() const;
781 MEDFileJointOneStep()
783 return MEDFileJointOneStep::New();
786 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number)
788 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
791 std::string __str__() const
793 return self->simpleRepr();
796 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const
798 MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
804 MEDFileJointCorrespondence *__getitem__(int i) const
806 return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
811 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
814 static MEDFileJoint *New();
815 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num);
816 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum);
817 MEDFileJoint *deepCopy() const;
818 MEDFileJoint *shallowCpy() const;
819 bool isEqual(const MEDFileJoint *other) const;
820 void setLocalMeshName(const std::string& name);
821 std::string getLocalMeshName() const;
822 void setRemoteMeshName(const std::string& name);
823 std::string getRemoteMeshName() const;
824 void setDescription(const std::string& name);
825 std::string getDescription() const;
826 void setJointName(const std::string& name);
827 std::string getJointName() const;
828 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
829 void setDomainNumber(const int& number);
830 int getDomainNumber() const;
831 void pushStep(MEDFileJointOneStep* step);
832 int getNumberOfSteps() const;
833 std::string simpleRepr() const;
838 return MEDFileJoint::New();
841 MEDFileJoint(const std::string& fileName, const std::string& mName, int num)
843 return MEDFileJoint::New(fileName,mName,num);
846 MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum)
848 return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
851 std::string __str__() const
853 return self->simpleRepr();
856 MEDFileJointOneStep *getStepAtPos(int i) const
858 MEDFileJointOneStep *ret(self->getStepAtPos(i));
864 MEDFileJointOneStep *__getitem__(int i)
866 return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
871 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
874 static MEDFileJoints *New();
875 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName);
876 MEDFileJoints *deepCopy() const;
877 std::string simpleRepr() const;
878 std::string getMeshName() const;
879 int getNumberOfJoints() const;
880 std::vector<std::string> getJointsNames() const;
881 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
882 void resize(int newSize);
883 void pushJoint(MEDFileJoint *joint);
884 void setJointAtPos(int i, MEDFileJoint *joint);
885 void destroyJointAtPos(int i);
890 return MEDFileJoints::New();
893 MEDFileJoints(const std::string& fileName, const std::string& meshName)
895 return MEDFileJoints::New(fileName,meshName);
898 std::string __str__() const
900 return self->simpleRepr();
903 MEDFileJoint *__getitem__(PyObject *obj)
905 static const char msg[]="MEDFileJoints::__getitem__ : only integer or string with meshname supported !";
908 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
913 MEDFileJoint *ret(self->getJointWithName(convertPyObjectToStr(obj,msg)));
921 return self->getNumberOfJoints();
924 MEDFileJoint *getJointAtPos(int i) const
926 MEDFileJoint *ret=self->getJointAtPos(i);
932 MEDFileJoint *getJointWithName(const std::string& paramName) const
934 MEDFileJoint *ret=self->getJointWithName(paramName);
942 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
945 MEDFileEquivalenceBase();
948 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
951 MEDFileEquivalenceData();
953 void setArray(DataArrayInt32 *data);
956 DataArrayInt32 *getArray()
958 DataArrayInt32 *ret(self->getArray());
959 if(ret) ret->incrRef();
965 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
968 MEDFileEquivalenceNode();
971 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
974 MEDFileEquivalenceCell();
977 std::size_t size() const;
978 void setArray(int meshDimRelToMax, DataArrayInt32 *da);
979 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt32 *da);
982 DataArrayInt32 *getArray(INTERP_KERNEL::NormalizedCellType type)
984 DataArrayInt32 *ret(self->getArray(type));
985 if(ret) ret->incrRef();
989 PyObject *getTypes() const
991 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
992 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
993 PyObject *res=PyList_New(result.size());
994 for(int i=0;iL!=result.end(); i++, iL++)
995 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1001 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
1004 MEDFileEquivalencePair();
1006 std::string getName() const;
1007 void setName(const std::string& name);
1008 std::string getDescription() const;
1009 void setDescription(const std::string& descr);
1010 void setArray(int meshDimRelToMaxExt, DataArrayInt32 *da);;
1013 MEDFileEquivalenceCell *initCell()
1015 MEDFileEquivalenceCell *ret(self->initCell());
1016 if(ret) ret->incrRef();
1020 MEDFileEquivalenceNode *initNode()
1022 MEDFileEquivalenceNode *ret(self->initNode());
1023 if(ret) ret->incrRef();
1027 MEDFileEquivalenceCell *getCell()
1029 MEDFileEquivalenceCell *ret(self->getCell());
1030 if(ret) ret->incrRef();
1034 MEDFileEquivalenceNode *getNode()
1036 MEDFileEquivalenceNode *ret(self->getNode());
1037 if(ret) ret->incrRef();
1043 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
1046 MEDFileEquivalences();
1049 std::vector<std::string> getEquivalenceNames() const;
1050 void killEquivalenceWithName(const std::string& name);
1051 void killEquivalenceAt(int i);
1055 MEDFileEquivalencePair *getEquivalence(int i)
1057 MEDFileEquivalencePair *ret(self->getEquivalence(i));
1058 if(ret) ret->incrRef();
1061 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name)
1063 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
1064 if(ret) ret->incrRef();
1068 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name)
1070 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
1071 if(ret) ret->incrRef();
1077 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
1080 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1081 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1082 static MEDFileMesh *New(DataArrayByte *db);
1083 virtual MEDFileMesh *createNewEmpty() const;
1084 virtual MEDFileMesh *deepCopy() const;
1085 virtual MEDFileMesh *shallowCpy() const;
1086 virtual void clearNonDiscrAttributes() const;
1087 void setName(const std::string& name);
1088 std::string getName();
1089 std::string getUnivName() const;
1090 bool getUnivNameWrStatus() const;
1091 void setUnivNameWrStatus(bool newStatus);
1092 void setDescription(const std::string& name);
1093 std::string getDescription() const;
1094 void setOrder(int order);
1095 int getOrder() const;
1096 void setIteration(int it);
1098 void setTimeValue(double time);
1099 void setTime(int dt, int it, double time);
1100 double getTimeValue() const;
1101 void setTimeUnit(const std::string& unit);
1102 std::string getTimeUnit() const;
1103 void setAxisType(MEDCouplingAxisType at);
1104 MEDCouplingAxisType getAxisType() const;
1105 virtual int getNumberOfNodes() const;
1106 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const;
1107 virtual bool hasImplicitPart() const;
1108 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const;
1109 virtual void releaseImplicitPartIfAny() const;
1110 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const;
1111 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const;
1112 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const;
1113 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const;
1114 virtual std::vector<mcIdType> getDistributionOfTypes(int meshDimRelToMax) const;
1115 virtual MEDFileMesh *cartesianize() const;
1116 std::vector<int> getNonEmptyLevels() const;
1117 std::vector<int> getNonEmptyLevelsExt() const;
1118 int getSizeAtLevel(int meshDimRelToMaxExt) const;
1120 bool existsGroup(const std::string& groupName) const;
1121 bool existsFamily(int famId) const;
1122 bool existsFamily(const std::string& familyName) const;
1123 void setFamilyId(const std::string& familyName, int id);
1124 void setFamilyIdUnique(const std::string& familyName, int id);
1125 void addFamily(const std::string& familyName, int id);
1126 void addFamilyOnGrp(const std::string& grpName, const std::string& famName);
1127 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName);
1128 virtual bool keepFamIdsOnlyOnLevs(const std::vector<mcIdType>& famIds, const std::vector<int>& levs);
1129 void copyFamGrpMapsFrom(const MEDFileMesh& other);
1132 void clearFamGrpMaps();
1133 const std::map<std::string,int>& getFamilyInfo() const;
1134 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const;
1135 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const;
1136 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const;
1137 std::vector<mcIdType> getFamiliesIdsOnGroup(const std::string& name) const;
1138 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams);
1139 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<mcIdType>& famIds);
1140 std::vector<std::string> getGroupsOnFamily(const std::string& name) const;
1141 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps);
1142 std::vector<std::string> getGroupsNames() const;
1143 std::vector<std::string> getFamiliesNames() const;
1144 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
1145 std::vector<mcIdType> getGrpNonEmptyLevelsExt(const std::string& grp) const;
1146 std::vector<mcIdType> getGrpNonEmptyLevels(const std::string& grp) const;
1147 std::vector<mcIdType> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
1148 std::vector<mcIdType> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
1149 std::vector<mcIdType> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
1150 std::vector<mcIdType> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
1151 std::vector<mcIdType> getFamNonEmptyLevels(const std::string& fam) const;
1152 std::vector<mcIdType> getFamNonEmptyLevelsExt(const std::string& fam) const;
1153 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const;
1154 static std::string GetMagicFamilyStr();
1155 void assignFamilyNameWithGroupName();
1156 std::vector<std::string> removeEmptyGroups();
1157 void removeGroupAtLevel(int meshDimRelToMaxExt, const std::string& name);
1158 void removeGroup(const std::string& name);
1159 void removeFamily(const std::string& name);
1160 std::vector<std::string> removeOrphanGroups();
1161 std::vector<std::string> removeOrphanFamilies();
1162 void removeFamiliesReferedByNoGroups();
1163 void rearrangeFamilies();
1165 void checkOrphanFamilyZero() const;
1166 void changeGroupName(const std::string& oldName, const std::string& newName);
1167 void changeFamilyName(const std::string& oldName, const std::string& newName);
1168 void changeFamilyId(int oldId, int newId);
1169 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames);
1170 void setFamilyInfo(const std::map<std::string,mcIdType>& info);
1171 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1172 int getFamilyId(const std::string& name) const;
1173 int getMaxAbsFamilyId() const;
1174 int getMaxFamilyId() const;
1175 int getMinFamilyId() const;
1176 int getTheMaxAbsFamilyId() const;
1177 int getTheMaxFamilyId() const;
1178 int getTheMinFamilyId() const;
1179 virtual int getMaxAbsFamilyIdInArrays() const;
1180 virtual int getMaxFamilyIdInArrays() const;
1181 virtual int getMinFamilyIdInArrays() const;
1182 DataArrayIdType *getAllFamiliesIdsReferenced() const;
1183 DataArrayIdType *computeAllFamilyIdsInUse() const;
1184 std::vector<mcIdType> getFamiliesIds(const std::vector<std::string>& famNames) const;
1185 std::string getFamilyNameGivenId(int id) const;
1186 bool ensureDifferentFamIdsPerLevel();
1187 void normalizeFamIdsTrio();
1188 void normalizeFamIdsMEDFile();
1189 virtual int getMeshDimension() const;
1190 virtual std::string simpleRepr() const;
1191 virtual std::string advancedRepr() const;
1193 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const;
1194 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayIdType *famArr);
1195 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayIdType *renumArr);
1196 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr);
1197 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayIdType *globalNumArr);
1198 virtual void addNodeGroup(const DataArrayIdType *ids);
1199 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayIdType *ids);
1200 virtual DataArrayIdType *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1201 virtual DataArrayIdType *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1202 virtual DataArrayIdType *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1203 virtual DataArrayIdType *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1204 virtual DataArrayIdType *getNodeGroupArr(const std::string& grp, bool renum=false) const;
1205 virtual DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1206 virtual DataArrayIdType *getNodeFamilyArr(const std::string& fam, bool renum=false) const;
1207 virtual DataArrayIdType *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const;
1208 int getNumberOfJoints();
1209 MEDFileJoints *getJoints();
1210 void setJoints( MEDFileJoints* joints );
1211 void initializeEquivalences();
1212 void killEquivalences();
1213 bool presenceOfStructureElements() const;
1214 void killStructureElements();
1217 std::string __str__() const
1219 return self->simpleRepr();
1222 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const
1224 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1227 static INTERP_KERNEL::NormalizedCellType ConvertFromMEDFileGeoType(int geoType)
1229 med_geometry_type geoType2((med_geometry_type) geoType);
1230 return MEDFileMesh::ConvertFromMEDFileGeoType(geoType2);
1236 double tmp0=self->getTime(tmp1,tmp2);
1237 PyObject *res = PyList_New(3);
1238 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1239 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1240 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1244 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const
1247 bool ret0=self->isEqual(other,eps,what);
1248 PyObject *res=PyList_New(2);
1249 PyObject *ret0Py=ret0?Py_True:Py_False;
1251 PyList_SetItem(res,0,ret0Py);
1252 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1256 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false)
1258 std::vector<const DataArrayIdType *> grps;
1259 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grps);
1260 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1263 PyObject *areFamsEqual(const MEDFileMesh *other) const
1266 bool ret0=self->areFamsEqual(other,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 PyObject *areGrpsEqual(const MEDFileMesh *other) const
1278 bool ret0=self->areGrpsEqual(other,what);
1279 PyObject *res=PyList_New(2);
1280 PyObject *ret0Py=ret0?Py_True:Py_False;
1282 PyList_SetItem(res,0,ret0Py);
1283 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1287 PyObject *getAllGeoTypes() const
1289 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1290 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1291 PyObject *res=PyList_New(result.size());
1292 for(int i=0;iL!=result.end(); i++, iL++)
1293 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1297 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const
1299 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1300 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1301 PyObject *res=PyList_New(result.size());
1302 for(int i=0;iL!=result.end(); i++, iL++)
1303 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1307 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const
1309 const DataArrayIdType *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1312 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1315 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt)
1317 const DataArrayIdType *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1320 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1323 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const
1325 const DataArrayIdType *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1328 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1331 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const
1333 const DataArrayIdType *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1336 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1339 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const
1341 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1344 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1347 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created)
1350 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1351 PyObject *ret=PyTuple_New(2);
1352 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1353 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1357 PyObject *unPolyze()
1359 DataArrayIdType *ret3=0;
1360 std::vector<mcIdType> ret1,ret2;
1361 bool ret0=self->unPolyze(ret1,ret2,ret3);
1362 PyObject *ret=PyTuple_New(4);
1363 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1365 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1366 for(int j=0;j<(int)ret1.size()/3;j++)
1368 PyObject *retLev2=PyList_New(3);
1369 PyList_SetItem(retLev2,0,PyInt_FromLong(ret1[3*j]));
1370 PyList_SetItem(retLev2,1,PyInt_FromLong(ret1[3*j+1]));
1371 PyList_SetItem(retLev2,2,PyInt_FromLong(ret1[3*j+2]));
1372 PyList_SetItem(retLev1_0,j,retLev2);
1374 PyTuple_SetItem(ret,1,retLev1_0);
1376 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1377 for(int j=0;j<(int)ret2.size()/3;j++)
1379 PyObject *retLev2=PyList_New(3);
1380 PyList_SetItem(retLev2,0,PyInt_FromLong(ret2[3*j]));
1381 PyList_SetItem(retLev2,1,PyInt_FromLong(ret2[3*j+1]));
1382 PyList_SetItem(retLev2,2,PyInt_FromLong(ret2[3*j+2]));
1383 PyList_SetItem(retLev1_1,j,retLev2);
1385 PyTuple_SetItem(ret,2,retLev1_1);
1387 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1391 MEDFileEquivalences *getEquivalences()
1393 MEDFileEquivalences *ret(self->getEquivalences());
1394 if(ret) ret->incrRef();
1398 virtual DataArrayIdType *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const
1400 MCAuto<DataArrayIdType> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1406 class MEDFileUMesh : public MEDFileMesh
1409 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1410 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1411 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem);
1412 static MEDFileUMesh *New(DataArrayByte *db);
1413 static MEDFileUMesh *New();
1414 static const char *GetSpeStr4ExtMesh();
1416 int getSpaceDimension() const;
1417 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1418 void checkConsistency() const;
1419 void checkSMESHConsistency() const;
1420 void clearNodeAndCellNumbers();
1422 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1423 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1424 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1425 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1426 DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1427 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const;
1428 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const;
1429 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const;
1430 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const;
1431 void forceComputationOfParts() const;
1433 void setFamilyNameAttachedOnId(int id, const std::string& newFamName);
1434 void setCoords(DataArrayDouble *coords);
1435 void setCoordsForced(DataArrayDouble *coords);
1436 void eraseGroupsAtLevel(int meshDimRelToMaxExt);
1437 void removeMeshAtLevel(int meshDimRelToMax);
1438 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m);
1439 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false);
1440 void optimizeFamilies();
1441 DataArrayIdType *computeFetchedNodeIds() const;
1442 DataArrayIdType *zipCoords();
1443 DataArrayIdType *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1444 DataArrayIdType *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1445 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const;
1446 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const;
1447 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const;
1448 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const;
1451 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1453 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1456 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1458 return MEDFileUMesh::New(fileName,mrs);
1461 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem)
1463 return MEDFileUMesh::New(mem);
1466 MEDFileUMesh(DataArrayByte *db)
1468 return MEDFileUMesh::New(db);
1473 return MEDFileUMesh::New();
1476 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)
1478 std::vector<int> typesCpp1;
1479 convertPyToNewIntArr3(types,typesCpp1);
1480 std::size_t sz(typesCpp1.size());
1481 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1482 for(std::size_t ii=0;ii<sz;ii++)
1483 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1484 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1487 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)
1489 MCAuto<DataArrayDouble> coords;
1490 MCAuto<PartDefinition> partCoords;
1491 MCAuto<DataArrayIdType> famCoords,numCoords;
1492 MCAuto<DataArrayAsciiChar> nameCoord;
1493 MEDFileUMesh::LoadPartCoords(fileName,mName,dt,it,infosOnComp,startNodeId,stopNodeId,coords,partCoords,famCoords,numCoords,nameCoord);
1494 PyObject *ret(PyTuple_New(5));
1495 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1496 PyTuple_SetItem(ret,1,convertPartDefinition(partCoords.retn(),SWIG_POINTER_OWN | 0));
1497 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(famCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1498 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(numCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1499 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(nameCoord.retn()),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 ));
1503 PyObject *__getstate__()
1505 std::vector<double> a0;
1506 std::vector<mcIdType> a1;
1507 std::vector<std::string> a2;
1508 std::vector< MCAuto<DataArrayIdType> > a3;
1509 MCAuto<DataArrayDouble> a4;
1510 self->serialize(a0,a1,a2,a3,a4);
1511 PyObject *ret(PyTuple_New(5));
1512 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1513 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1514 std::size_t sz(a2.size());
1515 PyObject *ret2(PyList_New(sz));
1516 for(std::size_t i=0;i<sz;i++)
1517 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1518 PyTuple_SetItem(ret,2,ret2);
1520 PyObject *ret3(PyList_New(sz));
1521 for(std::size_t i=0;i<sz;i++)
1523 DataArrayIdType *elt(a3[i]);
1526 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1528 PyTuple_SetItem(ret,3,ret3);
1529 DataArrayDouble *ret4(a4);
1532 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1536 void __setstate__(PyObject *inp)
1538 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1539 if(!PyTuple_Check(inp))
1540 throw INTERP_KERNEL::Exception(MSG);
1541 std::size_t sz(PyTuple_Size(inp));
1543 throw INTERP_KERNEL::Exception(MSG);
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;
1550 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1552 fillArrayWithPyListDbl3(a0py,tmp,a0);
1553 convertPyToNewIntArr3(a1py,a1);
1554 fillStringVector(a2py,a2);
1556 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1558 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1559 if(!SWIG_IsOK(status))
1560 throw INTERP_KERNEL::Exception(MSG);
1561 a4=reinterpret_cast<DataArrayDouble *>(argp);
1562 if((DataArrayDouble *)a4)
1565 std::vector< DataArrayIdType * > a3Tmp;
1566 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayIdType *>(b0py,SWIGTITraits<mcIdType>::TI,"DataArrayInt",a3Tmp);
1567 std::size_t sz(a3Tmp.size());
1569 for(std::size_t i=0;i<sz;i++)
1573 a3Tmp[i]->incrRef();
1575 self->unserialize(a0,a1,a2,a3,a4);
1579 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh)
1582 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1583 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1586 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1589 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1592 self->setMeshAtLevel(meshDimRelToMax,m1);
1595 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1598 void __delitem__(int meshDimRelToMax)
1600 self->removeMeshAtLevel(meshDimRelToMax);
1603 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const
1605 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1607 DataArrayDouble *a,*a2;
1608 DataArrayDoubleTuple *aa,*aa2;
1609 std::vector<double> bb,bb2;
1611 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1612 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1613 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1617 static MEDFileUMesh *Aggregate(PyObject *meshes)
1619 std::vector<const MEDFileUMesh *> meshesCpp;
1620 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1621 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1625 PyObject *getAllDistributionOfTypes() const
1627 std::vector< std::pair<int,mcIdType> > ret(self->getAllDistributionOfTypes());
1628 return convertVecPairIntToPy(ret);
1631 DataArrayIdType *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const
1633 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1634 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1635 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1638 MEDFileUMesh *extractPart(PyObject *extractDef) const
1640 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1641 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1642 return self->extractPart(extractDefCpp);
1645 void setMeshes(PyObject *li, bool renum=false)
1647 std::vector<const MEDCouplingUMesh *> ms;
1648 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1649 self->setMeshes(ms,renum);
1652 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false)
1654 std::vector<const MEDCouplingUMesh *> ms;
1655 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1656 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1659 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false)
1661 std::vector<const MEDCouplingUMesh *> ms;
1662 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1663 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1666 DataArrayDouble *getCoords() const
1668 DataArrayDouble *ret=self->getCoords();
1674 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const
1676 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1679 return const_cast<PartDefinition *>(ret);
1682 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1)
1684 DataArrayIdType *ret0=0,*ret1=0,*ret2=0;
1685 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1686 PyObject *ret=PyTuple_New(3);
1687 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1688 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1689 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1693 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const
1695 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1701 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const
1703 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1704 std::size_t sz(tmp.size());
1705 PyObject *ret=PyList_New(sz);
1706 for(std::size_t i=0;i<sz;i++)
1710 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1717 class MEDFileStructuredMesh : public MEDFileMesh
1722 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const
1724 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1732 class MEDFileCMesh : public MEDFileStructuredMesh
1735 static MEDFileCMesh *New();
1736 static MEDFileCMesh *New(DataArrayByte *db);
1737 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1738 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1739 void setMesh(MEDCouplingCMesh *m);
1740 int getSpaceDimension() const;
1745 return MEDFileCMesh::New();
1748 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1750 return MEDFileCMesh::New(fileName,mrs);
1753 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1755 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1758 MEDFileCMesh(DataArrayByte *db)
1760 return MEDFileCMesh::New(db);
1763 PyObject *getMesh() const
1765 const MEDCouplingCMesh *tmp=self->getMesh();
1768 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1773 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1776 static MEDFileCurveLinearMesh *New();
1777 static MEDFileCurveLinearMesh *New(DataArrayByte *db);
1778 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1779 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1780 void setMesh(MEDCouplingCurveLinearMesh *m);
1781 int getSpaceDimension() const;
1782 int getMeshDimension() const;
1785 MEDFileCurveLinearMesh()
1787 return MEDFileCurveLinearMesh::New();
1790 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1792 return MEDFileCurveLinearMesh::New(fileName,mrs);
1795 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1797 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1800 MEDFileCurveLinearMesh(DataArrayByte *db)
1802 return MEDFileCurveLinearMesh::New(db);
1805 PyObject *getMesh() const
1807 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1810 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1815 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1818 static MEDFileMeshMultiTS *New();
1819 static MEDFileMeshMultiTS *New(const std::string& fileName);
1820 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName);
1821 MEDFileMeshMultiTS *deepCopy() const;
1822 std::string getName() const;
1823 void setOneTimeStep(MEDFileMesh *mesh1TimeStep);
1824 void cartesianizeMe();
1827 MEDFileMeshMultiTS()
1829 return MEDFileMeshMultiTS::New();
1832 MEDFileMeshMultiTS(const std::string& fileName)
1834 return MEDFileMeshMultiTS::New(fileName);
1837 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName)
1839 return MEDFileMeshMultiTS::New(fileName,mName);
1842 MEDFileMesh *getOneTimeStep() const
1844 MEDFileMesh *ret=self->getOneTimeStep();
1852 class MEDFileMeshesIterator
1859 MEDFileMesh *ret=self->nextt();
1863 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1867 PyErr_SetString(PyExc_StopIteration,"No more data.");
1874 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1877 static MEDFileMeshes *New();
1878 static MEDFileMeshes *New(DataArrayByte *db);
1879 MEDFileMeshes *deepCopy() const;
1880 int getNumberOfMeshes() const;
1881 std::vector<std::string> getMeshesNames() const;
1883 void resize(int newSize);
1884 void pushMesh(MEDFileMesh *mesh);
1885 void setMeshAtPos(int i, MEDFileMesh *mesh);
1886 void destroyMeshAtPos(int i);
1887 void cartesianizeMe();
1888 bool presenceOfStructureElements() const;
1889 void killStructureElements();
1894 return MEDFileMeshes::New();
1897 MEDFileMeshes(const std::string& fileName)
1899 return MEDFileMeshes::New(fileName);
1902 MEDFileMeshes(DataArrayByte *db)
1904 return MEDFileMeshes::New(db);
1907 std::string __str__() const
1909 return self->simpleRepr();
1912 MEDFileMesh *__getitem__(PyObject *obj)
1914 static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
1915 if(PyInt_Check(obj))
1917 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1922 MEDFileMesh *ret(self->getMeshWithName(convertPyObjectToStr(obj,msg)));
1928 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh)
1930 self->setMeshAtPos(obj,mesh);
1934 MEDFileMeshesIterator *__iter__()
1936 return self->iterator();
1941 return self->getNumberOfMeshes();
1944 MEDFileMesh *getMeshAtPos(int i) const
1946 MEDFileMesh *ret=self->getMeshAtPos(i);
1951 MEDFileMesh *getMeshWithName(const std::string& mname) const
1953 MEDFileMesh *ret=self->getMeshWithName(mname);
1961 class MEDFileFieldLoc : public RefCountObject
1964 std::string getName() const;
1965 int getDimension() const;
1966 int getNumberOfGaussPoints() const;
1967 int getNumberOfPointsInCells() const;
1968 const std::vector<double>& getRefCoords() const;
1969 const std::vector<double>& getGaussCoords() const;
1970 const std::vector<double>& getGaussWeights() const;
1971 bool isEqual(const MEDFileFieldLoc& other, double eps) const;
1974 std::string __str__() const
1976 return self->repr();
1981 class MEDFileFieldGlobsReal
1984 void resetContent();
1985 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
1986 void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
1987 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
1988 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
1989 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
1990 void checkGlobsCoherency() const;
1991 void checkGlobsPflsPartCoherency() const;
1992 void checkGlobsLocsPartCoherency() const;
1993 std::vector<std::string> getPfls() const;
1994 std::vector<std::string> getLocs() const;
1995 bool existsPfl(const std::string& pflName) const;
1996 bool existsLoc(const std::string& locName) const;
1997 std::string createNewNameOfPfl() const;
1998 std::string createNewNameOfLoc() const;
1999 std::vector< std::vector<int> > whichAreEqualProfiles() const;
2000 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
2001 virtual std::vector<std::string> getPflsReallyUsed() const;
2002 virtual std::vector<std::string> getLocsReallyUsed() const;
2003 virtual std::vector<std::string> getPflsReallyUsedMulti() const;
2004 virtual std::vector<std::string> getLocsReallyUsedMulti() const;
2005 void killProfileIds(const std::vector<int>& pflIds);
2006 void killLocalizationIds(const std::vector<int>& locIds);
2007 void changePflName(const std::string& oldName, const std::string& newName);
2008 void changeLocName(const std::string& oldName, const std::string& newName);
2009 int getNbOfGaussPtPerCell(int locId) const;
2010 int getLocalizationId(const std::string& loc) const;
2011 int getProfileId(const std::string& pfl) const;
2012 void killStructureElementsInGlobs();
2015 PyObject *getProfile(const std::string& pflName) const
2017 const DataArrayIdType *ret=self->getProfile(pflName);
2020 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2023 PyObject *getProfileFromId(int pflId) const
2025 const DataArrayIdType *ret=self->getProfileFromId(pflId);
2028 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2031 PyObject *getLocalizationFromId(int locId) const
2033 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
2036 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2039 PyObject *getLocalization(const std::string& locName) const
2041 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
2044 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2047 PyObject *zipPflsNames()
2049 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
2050 return convertVecPairVecStToPy(ret);
2053 PyObject *zipLocsNames(double eps)
2055 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
2056 return convertVecPairVecStToPy(ret);
2059 void changePflsNames(PyObject *li)
2061 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2062 self->changePflsNames(v);
2065 void changePflsRefsNamesGen(PyObject *li)
2067 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2068 self->changePflsRefsNamesGen(v);
2071 void changePflsNamesInStruct(PyObject *li)
2073 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2074 self->changePflsNamesInStruct(v);
2077 void changeLocsNames(PyObject *li)
2079 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2080 self->changeLocsNames(v);
2083 void changeLocsRefsNamesGen(PyObject *li)
2085 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2086 self->changeLocsRefsNamesGen(v);
2089 void changeLocsNamesInStruct(PyObject *li)
2091 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2092 self->changeLocsNamesInStruct(v);
2095 std::string simpleReprGlobs() const
2097 std::ostringstream oss;
2098 self->simpleReprGlobs(oss);
2104 class MEDFileEntities
2109 static MEDFileEntities *BuildFrom(PyObject *entities)
2111 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2112 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2114 std::size_t sz(inp0.size());
2116 for(std::size_t i=0;i<sz;i++)
2117 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2119 return MEDFileEntities::BuildFrom(&inp);
2126 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2129 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
2130 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2131 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2132 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
2134 void loadArraysIfNecessary();
2135 void unloadArrays();
2136 void unloadArraysWithoutDataLoss();
2137 int getDimension() const;
2138 int getIteration() const;
2139 int getOrder() const;
2140 std::string getName();
2141 void setName(const std::string& name);
2142 std::string getMeshName();
2143 void setMeshName(const std::string& newMeshName);
2144 int getMeshIteration() const;
2145 int getMeshOrder() const;
2146 int getNumberOfComponents() const;
2147 bool isDealingTS(int iteration, int order) const;
2148 void setInfo(const std::vector<std::string>& infos);
2149 const std::vector<std::string>& getInfo() const;
2150 bool presenceOfMultiDiscPerGeoType() const;
2151 void setTime(int iteration, int order, double val);
2152 virtual MEDFileAnyTypeField1TS *shallowCpy() const;
2153 MEDFileAnyTypeField1TS *deepCopy() const;
2154 std::string getDtUnit() const;
2155 void setDtUnit(const std::string& dtUnit);
2161 double tmp0=self->getTime(tmp1,tmp2);
2162 PyObject *res = PyList_New(3);
2163 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2164 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2165 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2169 PyObject *getDtIt() const
2171 std::pair<int,int> res=self->getDtIt();
2172 PyObject *elt=PyTuple_New(2);
2173 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2174 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2178 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false)
2180 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2183 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false)
2185 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2188 bool changeMeshNames(PyObject *li)
2190 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2191 return self->changeMeshNames(modifTab);
2194 PyObject *getTypesOfFieldAvailable() const
2196 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2197 PyObject *ret2=PyList_New(ret.size());
2198 for(int i=0;i<(int)ret.size();i++)
2199 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2203 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const
2205 std::vector<int> ret1;
2206 int ret0=self->getNonEmptyLevels(mname,ret1);
2207 PyObject *elt=PyTuple_New(2);
2208 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2209 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2213 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const
2215 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2216 std::vector< std::vector<TypeOfField> > typesF;
2217 std::vector< std::vector<std::string> > pfls;
2218 std::vector< std::vector<std::string> > locs;
2219 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2220 std::size_t sz=ret.size();
2221 PyObject *ret2=PyList_New(sz);
2222 for(std::size_t i=0;i<sz;i++)
2224 const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2225 const std::vector<TypeOfField>& typesFI=typesF[i];
2226 const std::vector<std::string>& pflsI=pfls[i];
2227 const std::vector<std::string>& locsI=locs[i];
2228 PyObject *elt=PyTuple_New(2);
2229 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2230 std::size_t sz2=ret[i].size();
2231 PyObject *elt2=PyList_New(sz2);
2232 for(std::size_t j=0;j<sz2;j++)
2234 PyObject *elt3=PyTuple_New(4);
2235 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2236 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2237 PyTuple_SetItem(elt3,1,elt4);
2238 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2239 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2240 PyList_SetItem(elt2,j,elt3);
2242 PyTuple_SetItem(elt,1,elt2);
2243 PyList_SetItem(ret2,i,elt);
2248 PyObject *splitComponents() const
2250 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2251 std::size_t sz=ret.size();
2252 PyObject *retPy=PyList_New(sz);
2253 for(std::size_t i=0;i<sz;i++)
2254 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2258 PyObject *splitDiscretizations() const
2260 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2261 std::size_t sz=ret.size();
2262 PyObject *retPy=PyList_New(sz);
2263 for(std::size_t i=0;i<sz;i++)
2264 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2268 PyObject *splitMultiDiscrPerGeoTypes() const
2270 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2271 std::size_t sz=ret.size();
2272 PyObject *retPy=PyList_New(sz);
2273 for(std::size_t i=0;i<sz;i++)
2274 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2278 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2280 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2281 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2282 return self->extractPart(extractDefCpp,mm);
2287 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2290 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2291 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2292 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
2293 static MEDFileField1TS *New(DataArrayByte *db);
2294 static MEDFileField1TS *New();
2295 MEDCoupling::MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const;
2296 void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf);
2297 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
2298 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2299 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2300 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2301 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2302 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2304 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
2305 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2306 void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2307 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
2308 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
2311 MEDFileField1TS(const std::string& fileName, bool loadAll=true)
2313 return MEDFileField1TS::New(fileName,loadAll);
2316 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2318 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2321 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2323 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2326 MEDFileField1TS(DataArrayByte *db)
2328 return MEDFileField1TS::New(db);
2333 return MEDFileField1TS::New();
2336 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field)
2338 const DataArrayDouble *arr=0;
2340 arr=field->getArray();
2341 self->copyTinyInfoFrom(field,arr);
2344 std::string __str__() const
2346 return self->simpleRepr();
2349 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2351 return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
2354 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const
2356 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2357 std::vector< std::vector<TypeOfField> > typesF;
2358 std::vector< std::vector<std::string> > pfls;
2359 std::vector< std::vector<std::string> > locs;
2360 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2361 std::size_t sz=ret.size();
2362 PyObject *ret2=PyList_New(sz);
2363 for(std::size_t i=0;i<sz;i++)
2365 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2366 const std::vector<TypeOfField>& typesFI=typesF[i];
2367 const std::vector<std::string>& pflsI=pfls[i];
2368 const std::vector<std::string>& locsI=locs[i];
2369 PyObject *elt=PyTuple_New(2);
2370 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2371 std::size_t sz2=ret[i].size();
2372 PyObject *elt2=PyList_New(sz2);
2373 for(std::size_t j=0;j<sz2;j++)
2375 PyObject *elt3=PyTuple_New(4);
2376 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2377 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2378 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2379 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2380 PyList_SetItem(elt2,j,elt3);
2382 PyTuple_SetItem(elt,1,elt2);
2383 PyList_SetItem(ret2,i,elt);
2388 DataArrayDouble *getUndergroundDataArray() const
2390 DataArrayDouble *ret=self->getUndergroundDataArray();
2396 PyObject *getUndergroundDataArrayExt() const
2398 return MEDFileField1TS_getUndergroundDataArrayExt<double>(self);
2403 class MEDFileInt32Field1TS : public MEDFileAnyTypeField1TS
2406 static MEDFileInt32Field1TS *New();
2407 static MEDFileInt32Field1TS *New(const std::string& fileName, bool loadAll=true);
2408 static MEDFileInt32Field1TS *New(DataArrayByte *db);
2409 static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2410 static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2411 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2413 void setFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
2414 void setFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2415 void setFieldProfileFlatly(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2416 void copyTimeInfoFrom(MEDCouplingFieldInt32 *mcf);
2417 MEDCouplingFieldInt32 *field(const MEDFileMesh *mesh) const;
2418 MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2419 MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2420 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2421 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2422 MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2425 MEDFileInt32Field1TS()
2427 return MEDFileInt32Field1TS::New();
2430 MEDFileInt32Field1TS(const std::string& fileName, bool loadAll=true)
2432 return MEDFileInt32Field1TS::New(fileName,loadAll);
2435 MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2437 return MEDFileInt32Field1TS::New(fileName,fieldName,loadAll);
2440 MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2442 return MEDFileInt32Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2445 MEDFileInt32Field1TS(DataArrayByte *db)
2447 return MEDFileInt32Field1TS::New(db);
2450 std::string __str__() const
2452 return self->simpleRepr();
2455 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2457 return MEDFileField1TS_getFieldWithProfile<Int32>(self,type,meshDimRelToMax,mesh);
2460 DataArrayInt32 *getUndergroundDataArray() const
2462 DataArrayInt32 *ret=self->getUndergroundDataArray();
2468 PyObject *getUndergroundDataArrayExt() const
2470 return MEDFileField1TS_getUndergroundDataArrayExt<Int32>(self);
2475 class MEDFileInt64Field1TS : public MEDFileAnyTypeField1TS
2478 static MEDFileInt64Field1TS *New();
2479 static MEDFileInt64Field1TS *New(const std::string& fileName, bool loadAll=true);
2480 static MEDFileInt64Field1TS *New(DataArrayByte *db);
2481 static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2482 static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2483 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2485 void setFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
2486 void setFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2487 void setFieldProfileFlatly(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2488 void copyTimeInfoFrom(MEDCouplingFieldInt64 *mcf);
2489 MEDCouplingFieldInt64 *field(const MEDFileMesh *mesh) const;
2490 MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2491 MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2492 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2493 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2494 MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2497 MEDFileInt64Field1TS()
2499 return MEDFileInt64Field1TS::New();
2502 MEDFileInt64Field1TS(const std::string& fileName, bool loadAll=true)
2504 return MEDFileInt64Field1TS::New(fileName,loadAll);
2507 MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2509 return MEDFileInt64Field1TS::New(fileName,fieldName,loadAll);
2512 MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2514 return MEDFileInt64Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2517 MEDFileInt64Field1TS(DataArrayByte *db)
2519 return MEDFileInt64Field1TS::New(db);
2522 std::string __str__() const
2524 return self->simpleRepr();
2527 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2529 return MEDFileField1TS_getFieldWithProfile<Int64>(self,type,meshDimRelToMax,mesh);
2532 DataArrayInt64 *getUndergroundDataArray() const
2534 DataArrayInt64 *ret=self->getUndergroundDataArray();
2540 PyObject *getUndergroundDataArrayExt() const
2542 return MEDFileField1TS_getUndergroundDataArrayExt<Int64>(self);
2547 class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
2550 static MEDFileFloatField1TS *New();
2551 static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true);
2552 static MEDFileFloatField1TS *New(DataArrayByte *db);
2553 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2554 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2555 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2557 void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
2558 void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2559 void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2560 void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf);
2561 MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const;
2562 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2563 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2564 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2565 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2566 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2569 MEDFileFloatField1TS()
2571 return MEDFileFloatField1TS::New();
2574 MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true)
2576 return MEDFileFloatField1TS::New(fileName,loadAll);
2579 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2581 return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
2584 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2586 return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
2589 MEDFileFloatField1TS(DataArrayByte *db)
2591 return MEDFileFloatField1TS::New(db);
2594 std::string __str__() const
2596 return self->simpleRepr();
2599 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2601 return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
2604 DataArrayFloat *getUndergroundDataArray() const
2606 DataArrayFloat *ret=self->getUndergroundDataArray();
2612 PyObject *getUndergroundDataArrayExt() const
2614 return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
2619 class MEDFileAnyTypeFieldMultiTSIterator
2626 MEDFileAnyTypeField1TS *ret=self->nextt();
2628 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2631 PyErr_SetString(PyExc_StopIteration,"No more data.");
2638 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2641 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
2642 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2643 MEDFileAnyTypeFieldMultiTS *deepCopy() const;
2644 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
2645 std::string getName() const;
2646 void setName(const std::string& name);
2647 std::string getDtUnit() const;
2648 void setDtUnit(const std::string& dtUnit);
2649 std::string getMeshName() const;
2650 void setMeshName(const std::string& newMeshName);
2651 const std::vector<std::string>& getInfo() const;
2652 bool presenceOfMultiDiscPerGeoType() const;
2653 int getNumberOfComponents() const;
2654 int getNumberOfTS() const;
2655 void eraseEmptyTS();
2656 int getPosOfTimeStep(int iteration, int order) const;
2657 int getPosGivenTime(double time, double eps=1e-8) const;
2659 void loadArraysIfNecessary();
2660 void unloadArrays();
2661 void unloadArraysWithoutDataLoss();
2663 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
2664 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
2665 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
2666 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
2667 void synchronizeNameScope();
2668 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const;
2673 return self->getNumberOfTS();
2676 int getTimeId(PyObject *elt0) const
2678 if(elt0 && PyInt_Check(elt0))
2680 int pos=(int)PyInt_AS_LONG(elt0);
2683 else if(elt0 && PyTuple_Check(elt0))
2685 if(PyTuple_Size(elt0)==2)
2687 PyObject *o0=PyTuple_GetItem(elt0,0);
2688 PyObject *o1=PyTuple_GetItem(elt0,1);
2689 if(PyInt_Check(o0) && PyInt_Check(o1))
2691 int iter=(int)PyInt_AS_LONG(o0);
2692 int order=(int)PyInt_AS_LONG(o1);
2693 return self->getPosOfTimeStep(iter,order);
2696 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 !");
2699 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 !");
2701 else if(elt0 && PyFloat_Check(elt0))
2703 double val=PyFloat_AS_DOUBLE(elt0);
2704 return self->getPosGivenTime(val);
2707 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2710 PyObject *getIterations() const
2712 std::vector< std::pair<int,int> > res(self->getIterations());
2713 return convertVecPairIntToPy(res);
2716 PyObject *getTimeSteps() const
2718 std::vector<double> ret1;
2719 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2720 std::size_t sz=ret.size();
2721 PyObject *ret2=PyList_New(sz);
2722 for(std::size_t i=0;i<sz;i++)
2724 PyObject *elt=PyTuple_New(3);
2725 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2726 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2727 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2728 PyList_SetItem(ret2,i,elt);
2733 PyObject *getTypesOfFieldAvailable() const
2735 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2736 PyObject *ret2=PyList_New(ret.size());
2737 for(int i=0;i<(int)ret.size();i++)
2739 const std::vector<TypeOfField>& rett=ret[i];
2740 PyObject *ret3=PyList_New(rett.size());
2741 for(int j=0;j<(int)rett.size();j++)
2742 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2743 PyList_SetItem(ret2,i,ret3);
2748 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const
2750 std::vector<int> ret1;
2751 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2752 PyObject *elt=PyTuple_New(2);
2753 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2754 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2758 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const
2760 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2761 std::vector< std::vector<TypeOfField> > typesF;
2762 std::vector< std::vector<std::string> > pfls;
2763 std::vector< std::vector<std::string> > locs;
2764 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2765 std::size_t sz=ret.size();
2766 PyObject *ret2=PyList_New(sz);
2767 for(std::size_t i=0;i<sz;i++)
2769 const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2770 const std::vector<TypeOfField>& typesFI=typesF[i];
2771 const std::vector<std::string>& pflsI=pfls[i];
2772 const std::vector<std::string>& locsI=locs[i];
2773 PyObject *elt=PyTuple_New(2);
2774 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2775 std::size_t sz2=ret[i].size();
2776 PyObject *elt2=PyList_New(sz2);
2777 for(std::size_t j=0;j<sz2;j++)
2779 PyObject *elt3=PyTuple_New(4);
2780 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2781 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2782 PyTuple_SetItem(elt3,1,elt4);
2783 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2784 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2785 PyList_SetItem(elt2,j,elt3);
2787 PyTuple_SetItem(elt,1,elt2);
2788 PyList_SetItem(ret2,i,elt);
2793 std::vector<int> getTimeIds(PyObject *elts) const
2795 if(PyList_Check(elts))
2797 std::size_t sz=PyList_Size(elts);
2798 std::vector<int> ret(sz);
2799 for(std::size_t i=0;i<sz;i++)
2801 PyObject *elt=PyList_GetItem(elts,i);
2802 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2808 std::vector<int> ret(1);
2809 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2814 void __delitem__(PyObject *elts)
2816 if(PySlice_Check(elts))
2818 Py_ssize_t strt=2,stp=2,step=2;
2819 GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2820 self->eraseTimeStepIds2((int)strt,(int)stp,(int)step);
2824 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2825 if(!idsToRemove.empty())
2826 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2830 void eraseTimeStepIds(PyObject *li)
2834 std::vector<int> pos2;
2835 DataArrayInt32 *pos3=0;
2836 DataArrayIntTuple *pos4=0;
2837 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2842 self->eraseTimeStepIds(&pos1,&pos1+1);
2849 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2854 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2858 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2862 MEDFileAnyTypeFieldMultiTSIterator *__iter__()
2864 return self->iterator();
2867 PyObject *__getitem__(PyObject *elt0) const
2869 if(elt0 && PyList_Check(elt0))
2871 std::size_t sz=PyList_Size(elt0);
2872 MCAuto<DataArrayInt32> da=DataArrayInt32::New(); da->alloc(sz,1);
2873 int *pt=da->getPointer();
2874 for(std::size_t i=0;i<sz;i++,pt++)
2876 PyObject *elt1=PyList_GetItem(elt0,i);
2877 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2879 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2881 else if(elt0 && PySlice_Check(elt0))
2883 Py_ssize_t strt=2,stp=2,step=2;
2884 GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2885 return convertMEDFileFieldMultiTS(self->buildSubPartSlice((int)strt,(int)stp,(int)step),SWIG_POINTER_OWN | 0);
2888 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2891 bool changeMeshNames(PyObject *li)
2893 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2894 return self->changeMeshNames(modifTab);
2897 PyObject *splitComponents() const
2899 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2900 std::size_t sz=ret.size();
2901 PyObject *retPy=PyList_New(sz);
2902 for(std::size_t i=0;i<sz;i++)
2903 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2907 PyObject *splitDiscretizations() const
2909 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2910 std::size_t sz=ret.size();
2911 PyObject *retPy=PyList_New(sz);
2912 for(std::size_t i=0;i<sz;i++)
2913 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2917 PyObject *splitMultiDiscrPerGeoTypes() const
2919 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2920 std::size_t sz=ret.size();
2921 PyObject *retPy=PyList_New(sz);
2922 for(std::size_t i=0;i<sz;i++)
2923 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2927 void pushBackTimeSteps(PyObject *li)
2930 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2931 if(SWIG_IsOK(status))
2933 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2937 std::vector<MEDFileAnyTypeField1TS *> tmp;
2938 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2939 self->pushBackTimeSteps(tmp);
2943 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2945 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2946 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2947 return self->extractPart(extractDefCpp,mm);
2950 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li)
2952 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2953 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2954 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2955 std::size_t sz=ret.size();
2956 PyObject *retPy=PyList_New(sz);
2957 for(std::size_t i=0;i<sz;i++)
2959 std::size_t sz2=ret[i].size();
2960 PyObject *ret1Py=PyList_New(sz2);
2961 for(std::size_t j=0;j<sz2;j++)
2963 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2966 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2968 PyList_SetItem(retPy,i,ret1Py);
2973 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh)
2975 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2976 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2977 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2978 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2979 if(ret2.size()!=ret.size())
2981 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2982 throw INTERP_KERNEL::Exception(oss.str().c_str());
2984 std::size_t sz=ret.size();
2985 PyObject *retPy=PyList_New(sz);
2986 for(std::size_t i=0;i<sz;i++)
2988 std::size_t sz2=ret[i].size();
2989 PyObject *ret0Py=PyTuple_New(2);
2990 PyObject *ret1Py=PyList_New(sz2);
2991 for(std::size_t j=0;j<sz2;j++)
2993 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2996 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2998 PyTuple_SetItem(ret0Py,0,ret1Py);
2999 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
3000 PyList_SetItem(retPy,i,ret0Py);
3007 class MEDFileInt32FieldMultiTS;
3008 class MEDFileInt64FieldMultiTS;
3010 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3013 static MEDFileFieldMultiTS *New();
3014 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3015 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3016 static MEDFileFieldMultiTS *New(DataArrayByte *db);
3018 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
3019 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3020 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3021 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3022 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3023 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3025 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
3026 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3027 MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
3030 MEDFileFieldMultiTS()
3032 return MEDFileFieldMultiTS::New();
3035 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true)
3037 return MEDFileFieldMultiTS::New(fileName,loadAll);
3040 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3042 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
3045 MEDFileFieldMultiTS(DataArrayByte *db)
3047 return MEDFileFieldMultiTS::New(db);
3050 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3052 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3053 std::size_t sz(tmp.size());
3054 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3055 for(std::size_t i=0;i<sz;i++)
3057 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3058 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3060 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3063 std::string __str__() const
3065 return self->simpleRepr();
3068 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3070 DataArrayIdType *ret1=0;
3071 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3072 PyObject *ret=PyTuple_New(2);
3073 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3074 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3078 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const
3080 std::vector<INTERP_KERNEL::NormalizedCellType> types;
3081 std::vector< std::vector<TypeOfField> > typesF;
3082 std::vector< std::vector<std::string> > pfls;
3083 std::vector< std::vector<std::string> > locs;
3084 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
3085 std::size_t sz=ret.size();
3086 PyObject *ret2=PyList_New(sz);
3087 for(std::size_t i=0;i<sz;i++)
3089 const std::vector<DataArrayDouble *>& dadsI=ret[i];
3090 const std::vector<TypeOfField>& typesFI=typesF[i];
3091 const std::vector<std::string>& pflsI=pfls[i];
3092 const std::vector<std::string>& locsI=locs[i];
3093 PyObject *elt=PyTuple_New(2);
3094 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
3095 std::size_t sz2=ret[i].size();
3096 PyObject *elt2=PyList_New(sz2);
3097 for(std::size_t j=0;j<sz2;j++)
3099 PyObject *elt3=PyTuple_New(4);
3100 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
3101 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3102 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
3103 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
3104 PyList_SetItem(elt2,j,elt3);
3106 PyTuple_SetItem(elt,1,elt2);
3107 PyList_SetItem(ret2,i,elt);
3111 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const
3113 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
3119 PyObject *getUndergroundDataArrayExt(int iteration, int order) const
3121 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > > elt1Cpp;
3122 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
3125 PyObject *ret=PyTuple_New(2);
3126 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3127 std::size_t sz=elt1Cpp.size();
3128 PyObject *elt=PyList_New(sz);
3129 for(std::size_t i=0;i<sz;i++)
3131 PyObject *elt1=PyTuple_New(2);
3132 PyObject *elt2=PyTuple_New(2);
3133 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
3134 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
3135 PyObject *elt3=PyTuple_New(2);
3136 PyTuple_SetItem(elt3,0,PyInt_FromLong(elt1Cpp[i].second.first));
3137 PyTuple_SetItem(elt3,1,PyInt_FromLong(elt1Cpp[i].second.second));
3138 PyTuple_SetItem(elt1,0,elt2);
3139 PyTuple_SetItem(elt1,1,elt3);
3140 PyList_SetItem(elt,i,elt1);
3142 PyTuple_SetItem(ret,1,elt);
3148 class MEDFileFieldsIterator
3155 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3157 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3160 PyErr_SetString(PyExc_StopIteration,"No more data.");
3167 class MEDFileInt32FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3170 static MEDFileInt32FieldMultiTS *New();
3171 static MEDFileInt32FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3172 static MEDFileInt32FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3173 static MEDFileInt32FieldMultiTS *New(DataArrayByte *db);
3175 void appendFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
3176 void appendFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3177 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3178 MEDCouplingFieldInt32 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3179 MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3180 MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3181 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3182 MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3183 MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3186 MEDFileInt32FieldMultiTS()
3188 return MEDFileInt32FieldMultiTS::New();
3191 MEDFileInt32FieldMultiTS(const std::string& fileName, bool loadAll=true)
3193 return MEDFileInt32FieldMultiTS::New(fileName,loadAll);
3196 MEDFileInt32FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3198 return MEDFileInt32FieldMultiTS::New(fileName,fieldName,loadAll);
3201 MEDFileInt32FieldMultiTS(DataArrayByte *db)
3203 return MEDFileInt32FieldMultiTS::New(db);
3206 static MEDFileInt32FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3208 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3209 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3210 return MEDFileInt32FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3213 std::string __str__() const
3215 return self->simpleRepr();
3218 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3220 DataArrayIdType *ret1=0;
3221 DataArrayInt32 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3222 PyObject *ret=PyTuple_New(2);
3223 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int32>::TI, SWIG_POINTER_OWN | 0 ));
3224 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3228 DataArrayInt32 *getUndergroundDataArray(int iteration, int order) const
3230 DataArrayInt32 *ret=self->getUndergroundDataArray(iteration,order);
3238 class MEDFileInt64FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3241 static MEDFileInt64FieldMultiTS *New();
3242 static MEDFileInt64FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3243 static MEDFileInt64FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3244 static MEDFileInt64FieldMultiTS *New(DataArrayByte *db);
3246 void appendFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
3247 void appendFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3248 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3249 MEDCouplingFieldInt64 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3250 MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3251 MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3252 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3253 MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3254 MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3257 MEDFileInt64FieldMultiTS()
3259 return MEDFileInt64FieldMultiTS::New();
3262 MEDFileInt64FieldMultiTS(const std::string& fileName, bool loadAll=true)
3264 return MEDFileInt64FieldMultiTS::New(fileName,loadAll);
3267 MEDFileInt64FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3269 return MEDFileInt64FieldMultiTS::New(fileName,fieldName,loadAll);
3272 MEDFileInt64FieldMultiTS(DataArrayByte *db)
3274 return MEDFileInt64FieldMultiTS::New(db);
3277 static MEDFileInt64FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3279 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3280 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3281 return MEDFileInt64FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3284 std::string __str__() const
3286 return self->simpleRepr();
3289 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3291 DataArrayIdType *ret1=0;
3292 DataArrayInt64 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3293 PyObject *ret=PyTuple_New(2);
3294 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int64>::TI, SWIG_POINTER_OWN | 0 ));
3295 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3299 DataArrayInt64 *getUndergroundDataArray(int iteration, int order) const
3301 DataArrayInt64 *ret=self->getUndergroundDataArray(iteration,order);
3309 class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3312 static MEDFileFloatFieldMultiTS *New();
3313 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3314 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3315 static MEDFileFloatFieldMultiTS *New(DataArrayByte *db);
3317 void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
3318 void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3319 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3320 MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const;
3321 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3322 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3323 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3324 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3325 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3328 MEDFileFloatFieldMultiTS()
3330 return MEDFileFloatFieldMultiTS::New();
3333 MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true)
3335 return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
3338 MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3340 return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
3343 MEDFileFloatFieldMultiTS(DataArrayByte *db)
3345 return MEDFileFloatFieldMultiTS::New(db);
3348 static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3350 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3351 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3352 return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3355 std::string __str__() const
3357 return self->simpleRepr();
3360 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3362 DataArrayIdType *ret1=0;
3363 DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3364 PyObject *ret=PyTuple_New(2);
3365 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
3366 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3370 DataArrayFloat *getUndergroundDataArray(int iteration, int order) const
3372 DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
3380 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3383 static MEDFileMeshSupports *New(const std::string& fileName);
3384 std::vector<std::string> getSupMeshNames() const;
3387 MEDFileUMesh *getSupMeshWithName(const std::string& name) const
3389 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3390 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3398 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3401 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms);
3403 MEDFileStructureElements();
3406 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3409 static MEDFileFields *New();
3410 static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
3411 static MEDFileFields *New(DataArrayByte *db);
3412 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities);
3413 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
3414 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
3415 MEDFileFields *deepCopy() const;
3416 MEDFileFields *shallowCpy() const;
3418 void loadArraysIfNecessary();
3419 void unloadArrays();
3420 void unloadArraysWithoutDataLoss();
3421 int getNumberOfFields() const;
3422 std::vector<std::string> getFieldsNames() const;
3423 std::vector<std::string> getMeshesNames() const;
3425 void resize(int newSize);
3426 void pushField(MEDFileAnyTypeFieldMultiTS *field);
3427 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
3428 int getPosFromFieldName(const std::string& fieldName) const;
3429 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
3430 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
3431 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
3432 bool presenceOfStructureElements() const;
3433 void aggregate(const MEDFileFields& other);
3434 void killStructureElements();
3435 void keepOnlyStructureElements();
3436 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
3437 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
3438 void destroyFieldAtPos(int i);
3439 bool removeFieldsWithoutAnyTimeStep();
3444 return MEDFileFields::New();
3447 MEDFileFields(const std::string& fileName, bool loadAll=true)
3449 return MEDFileFields::New(fileName,loadAll);
3452 MEDFileFields(DataArrayByte *db)
3454 return MEDFileFields::New(db);
3457 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities)
3459 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3462 std::string __str__() const
3464 return self->simpleRepr();
3467 MEDFileFields *partOfThisOnStructureElements() const
3469 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3473 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const
3475 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3479 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true)
3481 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3482 std::size_t sz(tmp.size());
3483 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3484 for(std::size_t i=0;i<sz;i++)
3486 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3487 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3489 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3492 PyObject *getMeshSENames() const
3494 std::vector< std::pair<std::string,std::string> > ps;
3495 self->getMeshSENames(ps);
3496 return convertVectPairStToPy(ps);
3499 PyObject *getCommonIterations() const
3502 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3503 PyObject *ret=PyTuple_New(2);
3504 PyObject *ret_0=PyList_New(ret0.size());
3506 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3508 PyObject *elt=PyTuple_New(2);
3509 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3510 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3511 PyList_SetItem(ret_0,rk,elt);
3513 PyTuple_SetItem(ret,0,ret_0);
3514 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3515 PyTuple_SetItem(ret,1,ret_1);
3519 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3521 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3522 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3525 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3527 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3528 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3531 PyObject *__getitem__(PyObject *obj)
3533 if(obj && PyList_Check(obj))
3535 std::size_t sz=PyList_Size(obj);
3536 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3537 int *pt=da->getPointer();
3538 for(std::size_t i=0;i<sz;i++,pt++)
3540 PyObject *elt1=PyList_GetItem(obj,i);
3541 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3543 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3546 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3549 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field)
3551 self->setFieldAtPos(obj,field);
3557 return self->getNumberOfFields();
3560 MEDFileFieldsIterator *__iter__()
3562 return self->iterator();
3565 bool changeMeshNames(PyObject *li)
3567 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3568 return self->changeMeshNames(modifTab);
3571 int getPosOfField(PyObject *elt0) const
3573 static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
3575 throw INTERP_KERNEL::Exception(msg);
3576 if(PyInt_Check(elt0))
3578 return (int)PyInt_AS_LONG(elt0);
3580 return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
3583 std::vector<int> getPosOfFields(PyObject *elts) const
3585 if(PyList_Check(elts))
3587 std::size_t sz=PyList_Size(elts);
3588 std::vector<int> ret(sz);
3589 for(std::size_t i=0;i<sz;i++)
3591 PyObject *elt=PyList_GetItem(elts,i);
3592 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3598 std::vector<int> ret(1);
3599 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3604 void pushFields(PyObject *fields)
3606 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3607 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3608 self->pushFields(tmp);
3611 void __delitem__(PyObject *elts)
3613 if(elts && PySlice_Check(elts))
3615 Py_ssize_t strt=2,stp=2,step=2;
3616 GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3617 self->destroyFieldsAtPos2((int)strt,(int)stp,(int)step);
3621 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3622 if(!idsToRemove.empty())
3623 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3627 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
3629 std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
3630 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3631 return self->extractPart(extractDefCpp,mm);
3634 MEDFileFields *linearToQuadratic(const MEDFileMeshes *oldLin, const MEDFileMeshes *newQuad) const
3636 MCAuto<MEDFileFields> ret(self->linearToQuadratic(oldLin,newQuad));
3642 class MEDFileParameter1TS : public RefCountObject
3645 void setIteration(int it);
3646 int getIteration() const;
3647 void setOrder(int order);
3648 int getOrder() const;
3649 void setTimeValue(double time);
3650 void setTime(int dt, int it, double time);
3651 double getTime(int& dt, int& it);
3652 double getTimeValue() const;
3655 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3658 void setValue(double val);
3659 double getValue() const;
3660 std::string simpleRepr() const;
3663 std::string __str__() const
3665 return self->simpleRepr();
3670 class MEDFileParameterTinyInfo : public MEDFileWritable
3673 void setDescription(const std::string& name);
3674 std::string getDescription() const;
3675 void setTimeUnit(const std::string& unit);
3676 std::string getTimeUnit() const;
3679 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3682 static MEDFileParameterDouble1TS *New();
3683 static MEDFileParameterDouble1TS *New(const std::string& fileName);
3684 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName);
3685 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it);
3686 virtual MEDFileParameter1TS *deepCopy() const;
3687 virtual std::string simpleRepr() const;
3688 void setName(const std::string& name);
3689 std::string getName() const;
3690 void write(const std::string& fileName, int mode) const;
3693 MEDFileParameterDouble1TS()
3695 return MEDFileParameterDouble1TS::New();
3698 MEDFileParameterDouble1TS(const std::string& fileName)
3700 return MEDFileParameterDouble1TS::New(fileName);
3703 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName)
3705 return MEDFileParameterDouble1TS::New(fileName,paramName);
3708 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it)
3710 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3713 std::string __str__() const
3715 return self->simpleRepr();
3718 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const
3721 bool ret0=self->isEqual(other,eps,what);
3722 PyObject *res=PyList_New(2);
3723 PyObject *ret0Py=ret0?Py_True:Py_False;
3725 PyList_SetItem(res,0,ret0Py);
3726 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3732 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3735 static MEDFileParameterMultiTS *New();
3736 static MEDFileParameterMultiTS *New(const std::string& fileName);
3737 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName);
3738 std::string getName() const;
3739 void setName(const std::string& name);
3740 MEDFileParameterMultiTS *deepCopy() const;
3741 void write(const std::string& fileName, int mode) const;
3742 std::string simpleRepr() const;
3743 void appendValue(int dt, int it, double time, double val);
3744 double getDoubleValue(int iteration, int order) const;
3745 int getPosOfTimeStep(int iteration, int order) const;
3746 int getPosGivenTime(double time, double eps=1e-8) const;
3747 int getNumberOfTS() const;
3750 MEDFileParameterMultiTS()
3752 return MEDFileParameterMultiTS::New();
3755 MEDFileParameterMultiTS(const std::string& fileName)
3757 return MEDFileParameterMultiTS::New(fileName);
3760 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3762 return MEDFileParameterMultiTS::New(fileName,paramName);
3765 std::string __str__() const
3767 return self->simpleRepr();
3770 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const
3773 bool ret0=self->isEqual(other,eps,what);
3774 PyObject *res=PyList_New(2);
3775 PyObject *ret0Py=ret0?Py_True:Py_False;
3777 PyList_SetItem(res,0,ret0Py);
3778 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3782 void eraseTimeStepIds(PyObject *ids)
3786 std::vector<int> pos2;
3787 DataArrayInt *pos3=0;
3788 DataArrayIntTuple *pos4=0;
3789 convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3794 self->eraseTimeStepIds(&pos1,&pos1+1);
3801 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3806 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3810 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3814 int getTimeStepId(PyObject *elt0) const
3816 if(elt0 && PyInt_Check(elt0))
3818 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3821 else if(elt0 && PyTuple_Check(elt0))
3823 if(PyTuple_Size(elt0)==2)
3825 PyObject *o0=PyTuple_GetItem(elt0,0);
3826 PyObject *o1=PyTuple_GetItem(elt0,1);
3827 if(PyInt_Check(o0) && PyInt_Check(o1))
3829 int iter=(int)PyInt_AS_LONG(o0);
3830 int order=(int)PyInt_AS_LONG(o1);
3831 return self->getPosOfTimeStep(iter,order);
3834 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 !");
3837 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 !");
3839 else if(elt0 && PyFloat_Check(elt0))
3841 double val=PyFloat_AS_DOUBLE(elt0);
3842 return self->getPosGivenTime(val);
3845 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3848 MEDFileParameter1TS *__getitem__(PyObject *elt0) const
3850 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3856 std::vector<int> getTimeStepIds(PyObject *elts) const
3858 if(PyList_Check(elts))
3860 std::size_t sz=PyList_Size(elts);
3861 std::vector<int> ret(sz);
3862 for(std::size_t i=0;i<sz;i++)
3864 PyObject *elt=PyList_GetItem(elts,i);
3865 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3871 std::vector<int> ret(1);
3872 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3877 void __delitem__(PyObject *elts)
3879 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3880 if(!idsToRemove.empty())
3881 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3884 MEDFileParameter1TS *getTimeStepAtPos(int posId) const
3886 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3892 PyObject *getIterations() const
3894 std::vector< std::pair<int,int> > res=self->getIterations();
3895 PyObject *ret=PyList_New(res.size());
3897 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3899 PyObject *elt=PyTuple_New(2);
3900 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3901 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3902 PyList_SetItem(ret,rk,elt);
3907 PyObject *getTimeSteps() const
3909 std::vector<double> res2;
3910 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3911 PyObject *ret=PyList_New(res.size());
3913 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3915 PyObject *elt=PyTuple_New(3);
3916 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3917 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3918 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3919 PyList_SetItem(ret,rk,elt);
3926 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3929 static MEDFileParameters *New();
3930 static MEDFileParameters *New(const std::string& fileName);
3931 static MEDFileParameters *New(DataArrayByte *db);
3932 MEDFileParameters *deepCopy() const;
3933 std::vector<std::string> getParamsNames() const;
3934 std::string simpleRepr() const;
3935 void resize(int newSize);
3936 void pushParam(MEDFileParameterMultiTS *param);
3937 void setParamAtPos(int i, MEDFileParameterMultiTS *param);
3938 void destroyParamAtPos(int i);
3939 int getPosFromParamName(const std::string& paramName) const;
3940 int getNumberOfParams() const;
3945 return MEDFileParameters::New();
3948 MEDFileParameters(const std::string& fileName)
3950 return MEDFileParameters::New(fileName);
3953 MEDFileParameters(DataArrayByte *db)
3955 return MEDFileParameters::New(db);
3958 std::string __str__() const
3960 return self->simpleRepr();
3963 MEDFileParameterMultiTS *__getitem__(PyObject *obj)
3965 static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
3966 if(PyInt_Check(obj))
3968 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3973 MEDFileParameterMultiTS *ret(self->getParamWithName(convertPyObjectToStr(obj,msg)));
3981 return self->getNumberOfParams();
3984 MEDFileParameterMultiTS *getParamAtPos(int i) const
3986 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3992 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const
3994 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
4000 PyObject *isEqual(const MEDFileParameters *other, double eps) const
4003 bool ret0=self->isEqual(other,eps,what);
4004 PyObject *res=PyList_New(2);
4005 PyObject *ret0Py=ret0?Py_True:Py_False;
4007 PyList_SetItem(res,0,ret0Py);
4008 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
4014 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
4017 static MEDFileData *New(DataArrayByte *db);
4018 static MEDFileData *New(const std::string& fileName);
4019 static MEDFileData *New();
4020 MEDFileData *deepCopy() const;
4021 void setFields(MEDFileFields *fields);
4022 void setMeshes(MEDFileMeshes *meshes);
4023 void setParams(MEDFileParameters *params);
4024 int getNumberOfFields() const;
4025 int getNumberOfMeshes() const;
4026 int getNumberOfParams() const;
4028 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName);
4029 bool unPolyzeMeshes();
4030 void dealWithStructureElements();
4031 std::string getHeader() const;
4032 void setHeader(const std::string& header);
4036 MEDFileData(const std::string& fileName)
4038 return MEDFileData::New(fileName);
4041 MEDFileData(DataArrayByte *db)
4043 return MEDFileData::New(db);
4048 return MEDFileData::New();
4051 std::string __str__() const
4053 return self->simpleRepr();
4056 MEDFileMeshes *getMeshes() const
4058 MEDFileMeshes *ret=self->getMeshes();
4064 MEDFileParameters *getParams() const
4066 MEDFileParameters *ret=self->getParams();
4072 MEDFileFields *getFields() const
4074 MEDFileFields *ret=self->getFields();
4080 bool changeMeshNames(PyObject *li)
4082 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
4083 return self->changeMeshNames(modifTab);
4086 static MEDFileData *Aggregate(PyObject *mfds)
4088 std::vector<const MEDFileData *> mfdsCpp;
4089 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
4090 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
4096 class SauvReader : public RefCountObject
4099 static SauvReader* New(const std::string& fileName);
4100 MEDFileData * loadInMEDFileDS();
4103 SauvReader(const std::string& fileName)
4105 return SauvReader::New(fileName);
4110 class SauvWriter : public RefCountObject
4113 static SauvWriter * New();
4114 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0);
4115 void write(const std::string& fileName);
4116 void setCpyGrpIfOnASingleFamilyStatus(bool status);
4117 bool getCpyGrpIfOnASingleFamilyStatus() const;
4122 return SauvWriter::New();
4129 class MEDFileMeshStruct;
4131 class MEDFileField1TSStructItem
4134 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt);
4137 class MEDFileMeshStruct : public RefCountObject
4140 static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
4142 ~MEDFileMeshStruct();
4145 class MEDMeshMultiLev : public RefCountObject
4148 virtual MEDMeshMultiLev *prepare() const;
4149 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const;
4150 DataArrayIdType *retrieveGlobalNodeIdsIfAny() const;
4156 PyObject *retrieveFamilyIdsOnCells() const
4158 DataArrayIdType *famIds(0);
4159 bool isWithoutCopy(false);
4160 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
4161 PyObject *ret=PyTuple_New(2);
4162 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4164 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4165 PyTuple_SetItem(ret,1,ret1Py);
4169 PyObject *retrieveNumberIdsOnCells() const
4171 DataArrayIdType *numIds(0);
4172 bool isWithoutCopy(false);
4173 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
4174 PyObject *ret=PyTuple_New(2);
4175 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4177 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4178 PyTuple_SetItem(ret,1,ret1Py);
4182 PyObject *retrieveFamilyIdsOnNodes() const
4184 DataArrayIdType *famIds(0);
4185 bool isWithoutCopy(false);
4186 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
4187 PyObject *ret=PyTuple_New(2);
4188 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4190 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4191 PyTuple_SetItem(ret,1,ret1Py);
4195 PyObject *retrieveNumberIdsOnNodes() const
4197 DataArrayIdType *numIds(0);
4198 bool isWithoutCopy(false);
4199 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
4200 PyObject *ret=PyTuple_New(2);
4201 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4203 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4204 PyTuple_SetItem(ret,1,ret1Py);
4208 PyObject *getGeoTypes() const
4210 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
4211 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4212 PyObject *res(PyList_New(result.size()));
4213 for(int i=0;iL!=result.end(); i++, iL++)
4214 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4220 class MEDUMeshMultiLev : public MEDMeshMultiLev
4223 ~MEDUMeshMultiLev();
4227 PyObject *buildVTUArrays() const
4229 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayIdType *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
4230 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
4231 PyObject *ret0Py=ncc?Py_True:Py_False;
4233 PyObject *ret=PyTuple_New(7);
4234 PyTuple_SetItem(ret,0,ret0Py);
4235 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4236 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
4237 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4238 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4239 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4240 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4246 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
4249 ~MEDStructuredMeshMultiLev();
4252 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4255 ~MEDCMeshMultiLev();
4259 PyObject *buildVTUArrays() const
4262 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4263 std::size_t sz(objs.size());
4264 PyObject *ret(PyTuple_New(2));
4265 PyObject *ret0=PyList_New(sz);
4266 for(std::size_t i=0;i<sz;i++)
4267 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4268 PyTuple_SetItem(ret,0,ret0);
4269 PyObject *ret1Py(isInternal?Py_True:Py_False);
4271 PyTuple_SetItem(ret,1,ret1Py);
4277 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4280 ~MEDCurveLinearMeshMultiLev();
4284 PyObject *buildVTUArrays() const
4286 DataArrayDouble *ret0(0);
4287 std::vector<mcIdType> ret1;
4289 self->buildVTUArrays(ret0,ret1,ret2);
4290 std::size_t sz(ret1.size());
4291 PyObject *ret=PyTuple_New(3);
4292 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4293 PyObject *ret1Py=PyList_New(sz);
4294 for(std::size_t i=0;i<sz;i++)
4295 PyList_SetItem(ret1Py,i,PyInt_FromLong(ret1[i]));
4296 PyTuple_SetItem(ret,1,ret1Py);
4297 PyObject *ret2Py(ret2?Py_True:Py_False);
4299 PyTuple_SetItem(ret,2,ret2Py);
4305 class MEDFileFastCellSupportComparator : public RefCountObject
4308 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
4309 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4310 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4311 int getNumberOfTS() const;
4313 ~MEDFileFastCellSupportComparator();
4317 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const
4319 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4320 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4321 PyObject *res(PyList_New(result.size()));
4322 for(int i=0;iL!=result.end(); i++, iL++)
4323 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4334 def exit1TS(self, exctype, exc, tb):
4337 MEDFileAnyTypeField1TS.__enter__=enter1TS
4338 MEDFileAnyTypeField1TS.__exit__=exit1TS
4339 MEDFileIntField1TS = MEDFileInt32Field1TS
4340 MEDFileIntFieldMultiTS = MEDFileInt32FieldMultiTS
4341 if MEDCouplingUse64BitIDs():
4342 MEDFileIDField1TS = MEDFileInt64Field1TS
4343 MEDFileIDFieldMultiTS = MEDFileInt64FieldMultiTS
4345 MEDFileIDField1TS = MEDFileInt32Field1TS
4346 MEDFileIDFieldMultiTS = MEDFileInt32FieldMultiTS