X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FSwig%2FMEDLoaderCommon.i;h=a0368584d4bc57a67e1ca624370634ca6b0d2edd;hb=aafcf704892f03308a84407e898d9e8b19496a1c;hp=dd03b5580d858ba9103248928473bddf0e4823e4;hpb=8bae03a55f48814db1d747c9ef8a8ee51d64e6d4;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/Swig/MEDLoaderCommon.i b/src/MEDLoader/Swig/MEDLoaderCommon.i index dd03b5580..a0368584d 100644 --- a/src/MEDLoader/Swig/MEDLoaderCommon.i +++ b/src/MEDLoader/Swig/MEDLoaderCommon.i @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2019 CEA/DEN, EDF R&D +// Copyright (C) 2017-2022 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -38,9 +38,12 @@ #include "MEDFileEntities.hxx" #include "MEDFileMeshReadSelector.hxx" #include "MEDFileFieldOverView.hxx" +#include "MEDCouplingTypemaps.i" #include "MEDLoaderTypemaps.i" #include "SauvReader.hxx" #include "SauvWriter.hxx" +#include "MeshFormatReader.hxx" +#include "MeshFormatWriter.hxx" using namespace MEDCoupling; %} @@ -119,6 +122,7 @@ using namespace MEDCoupling; %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh; %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType; %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType; +%newobject MEDCoupling::MEDFileUMesh::computeFetchedNodeIds; %newobject MEDCoupling::MEDFileUMesh::zipCoords; %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart; %newobject MEDCoupling::MEDFileUMesh::extractPart; @@ -181,16 +185,27 @@ using namespace MEDCoupling; %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld; %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray; %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt; - -%newobject MEDCoupling::MEDFileIntFieldMultiTS::New; -%newobject MEDCoupling::MEDFileIntFieldMultiTS::field; -%newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities; -%newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray; -%newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble; -%newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel; -%newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel; -%newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel; -%newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld; +%newobject MEDCoupling::MEDFileFieldMultiTS::Aggregate; + +%newobject MEDCoupling::MEDFileInt32FieldMultiTS::New; +%newobject MEDCoupling::MEDFileInt32FieldMultiTS::field; +%newobject MEDCoupling::MEDFileInt32FieldMultiTS::LoadSpecificEntities; +%newobject MEDCoupling::MEDFileInt32FieldMultiTS::getUndergroundDataArray; +%newobject MEDCoupling::MEDFileInt32FieldMultiTS::convertToDouble; +%newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevel; +%newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtTopLevel; +%newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldOnMeshAtLevel; +%newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevelOld; + +%newobject MEDCoupling::MEDFileInt64FieldMultiTS::New; +%newobject MEDCoupling::MEDFileInt64FieldMultiTS::field; +%newobject MEDCoupling::MEDFileInt64FieldMultiTS::LoadSpecificEntities; +%newobject MEDCoupling::MEDFileInt64FieldMultiTS::getUndergroundDataArray; +%newobject MEDCoupling::MEDFileInt64FieldMultiTS::convertToDouble; +%newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevel; +%newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtTopLevel; +%newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldOnMeshAtLevel; +%newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevelOld; %newobject MEDCoupling::MEDFileFloatFieldMultiTS::New; %newobject MEDCoupling::MEDFileFloatFieldMultiTS::field; @@ -215,15 +230,25 @@ using namespace MEDCoupling; %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld; %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray; %newobject MEDCoupling::MEDFileField1TS::convertToInt; - -%newobject MEDCoupling::MEDFileIntField1TS::New; -%newobject MEDCoupling::MEDFileIntField1TS::field; -%newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel; -%newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel; -%newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel; -%newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld; -%newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray; -%newobject MEDCoupling::MEDFileIntField1TS::convertToDouble; +%newobject MEDCoupling::MEDFileField1TS::convertToInt64; + +%newobject MEDCoupling::MEDFileInt32Field1TS::New; +%newobject MEDCoupling::MEDFileInt32Field1TS::field; +%newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevel; +%newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtTopLevel; +%newobject MEDCoupling::MEDFileInt32Field1TS::getFieldOnMeshAtLevel; +%newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevelOld; +%newobject MEDCoupling::MEDFileInt32Field1TS::getUndergroundDataArray; +%newobject MEDCoupling::MEDFileInt32Field1TS::convertToDouble; + +%newobject MEDCoupling::MEDFileInt64Field1TS::New; +%newobject MEDCoupling::MEDFileInt64Field1TS::field; +%newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevel; +%newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtTopLevel; +%newobject MEDCoupling::MEDFileInt64Field1TS::getFieldOnMeshAtLevel; +%newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevelOld; +%newobject MEDCoupling::MEDFileInt64Field1TS::getUndergroundDataArray; +%newobject MEDCoupling::MEDFileInt64Field1TS::convertToDouble; %newobject MEDCoupling::MEDFileFloatField1TS::New; %newobject MEDCoupling::MEDFileFloatField1TS::field; @@ -288,6 +313,7 @@ using namespace MEDCoupling; %newobject MEDCoupling::SauvReader::New; %newobject MEDCoupling::SauvReader::loadInMEDFileDS; + %newobject MEDCoupling::MEDFileMeshStruct::New; %newobject MEDCoupling::MEDMeshMultiLev::prepare; %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray; @@ -295,6 +321,10 @@ using namespace MEDCoupling; %newobject MEDCoupling::MEDFileFastCellSupportComparator::New; %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport; +%newobject MEDCoupling::MeshFormatReader::loadInMEDFileDS; +%newobject MEDCoupling::MeshFormatReader::MeshFormatReader; +%newobject MEDCoupling::MeshFormatWriter::MeshFormatWriter; + %feature("unref") MEDFileMesh "$this->decrRef();" %feature("unref") MEDFileUMesh "$this->decrRef();" %feature("unref") MEDFileCMesh "$this->decrRef();" @@ -303,11 +333,13 @@ using namespace MEDCoupling; %feature("unref") MEDFileFieldLoc "$this->decrRef();" %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();" %feature("unref") MEDFileField1TS "$this->decrRef();" -%feature("unref") MEDFileIntField1TS "$this->decrRef();" +%feature("unref") MEDFileInt32Field1TS "$this->decrRef();" +%feature("unref") MEDFileInt64Field1TS "$this->decrRef();" %feature("unref") MEDFileFloatField1TS "$this->decrRef();" %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();" %feature("unref") MEDFileFieldMultiTS "$this->decrRef();" -%feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();" +%feature("unref") MEDFileInt32FieldMultiTS "$this->decrRef();" +%feature("unref") MEDFileInt64FieldMultiTS "$this->decrRef();" %feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();" %feature("unref") MEDFileMeshSupports "$this->decrRef();" %feature("unref") MEDFileStructureElements "$this->decrRef();" @@ -391,6 +423,7 @@ namespace MEDCoupling %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig; %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig; %rename (ReadField) ReadFieldSwig; +%rename (GetFamiliesGroupsInfo) GetFamiliesGroupsInfoSwig; %inline { @@ -405,6 +438,23 @@ namespace MEDCoupling return ret; } + int MEDFileSizeOfMedInt() + { + return 8*sizeof(med_int); + } + + PyObject *GetFamiliesGroupsInfoSwig(const std::string& fileName, const std::string& meshName) + { + std::map families; + std::map> groupsOnFam; + MEDCoupling::GetFamiliesGroupsInfo(fileName,meshName,families,groupsOnFam); + AutoPyPtr a(convertMapStringInt(families)),b(convertMapStringVectString(groupsOnFam)); + AutoPyPtr ret(PyTuple_New(2)); + PyTuple_SetItem(ret,0,a.retn()); + PyTuple_SetItem(ret,1,b.retn()); + return ret.retn(); + } + MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName) { MCAuto ret(MEDCoupling::ReadField(fileName)); @@ -416,13 +466,13 @@ namespace MEDCoupling MCAuto ret(MEDCoupling::ReadField(fileName,fieldName)); return ret.retn(); } - + MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) { MCAuto ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order)); return ret.retn(); } - + MEDCoupling::MEDCouplingField *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) { MCAuto ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order)); @@ -443,7 +493,7 @@ namespace MEDCoupling } return ret; } - + PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) { std::vector< std::pair< std::pair, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName); @@ -459,7 +509,7 @@ namespace MEDCoupling } return ret; } - + PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) { std::vector< std::pair > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName); @@ -507,7 +557,8 @@ namespace MEDCoupling PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) { - int meshDim,spaceDim,numberOfNodes; + int meshDim,spaceDim; + mcIdType numberOfNodes; std::vector< std::vector< std::pair > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes); PyObject *ret=PyTuple_New(4); PyObject *elt0=PyList_New(res.size()); @@ -529,10 +580,10 @@ namespace MEDCoupling PyTuple_SetItem(ret,0,elt0); PyTuple_SetItem(ret,1,SWIG_From_int(meshDim)); PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim)); - PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes)); + PyTuple_SetItem(ret,3,SWIG_From_long(numberOfNodes)); return ret; } - + PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, PyObject *liIts) { @@ -540,38 +591,38 @@ namespace MEDCoupling std::vector res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its); return convertFieldDoubleVecToPy(res); } - + void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) { std::vector v; convertFromPyObjVectorOfObj(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v); MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch); } - + void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) { std::vector v; convertFromPyObjVectorOfObj(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v); MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch); } - + void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) { std::vector v; convertFromPyObjVectorOfObj(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v); MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch); } - + PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) { std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName); - int size=v.size(); + std::size_t size=v.size(); PyObject *ret=PyList_New(size); - for(int i=0;i grps; @@ -598,12 +649,13 @@ namespace MEDCoupling int getZipConnPolicy(); void setZipConnPolicy(int newVal); }; - + class MEDFileWritableStandAlone : public MEDFileWritable { public: void write(const std::string& fileName, int mode) const; void write33(const std::string& fileName, int mode) const; + void write30(const std::string& fileName, int mode) const; %extend { DataArrayByte *serialize() const @@ -623,12 +675,14 @@ namespace MEDCoupling } } }; - + class MEDFileMeshReadSelector { public: MEDFileMeshReadSelector(); MEDFileMeshReadSelector(unsigned int code); + mcIdType getNumberOfCoordsLoadSessions(); + void setNumberOfCoordsLoadSessions(mcIdType newNbOfCoordsLoadSessions); unsigned int getCode() const; void setCode(unsigned int newCode); bool isCellFamilyFieldReading() const; @@ -653,7 +707,7 @@ namespace MEDCoupling self->reprAll(oss); return oss.str(); } - + std::string __repr__() const { std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ")."; @@ -666,9 +720,9 @@ namespace MEDCoupling { public: static MEDFileJointCorrespondence *New(); - static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes + static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence) // nodes ; - static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells + static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence, // cells INTERP_KERNEL::NormalizedCellType loc_geo_type, INTERP_KERNEL::NormalizedCellType rem_geo_type) ; @@ -682,7 +736,7 @@ namespace MEDCoupling INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const; void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type); INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const; - void setCorrespondence(DataArrayInt *corr); + void setCorrespondence(DataArrayIdType *corr); void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const; std::string simpleRepr() const; %extend @@ -691,11 +745,11 @@ namespace MEDCoupling { return MEDFileJointCorrespondence::New(); } - MEDFileJointCorrespondence(DataArrayInt* correspondence) + MEDFileJointCorrespondence(DataArrayIdType* correspondence) { return MEDFileJointCorrespondence::New(correspondence); } - MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells + MEDFileJointCorrespondence(DataArrayIdType* correspondence, // cells INTERP_KERNEL::NormalizedCellType loc_geo_type, INTERP_KERNEL::NormalizedCellType rem_geo_type) { @@ -706,13 +760,13 @@ namespace MEDCoupling { return self->simpleRepr(); } - - DataArrayInt *getCorrespondence() const + + DataArrayIdType *getCorrespondence() const { - const DataArrayInt *ret(self->getCorrespondence()); + const DataArrayIdType *ret(self->getCorrespondence()); if(ret) ret->incrRef(); - return const_cast(ret); + return const_cast(ret); } } }; @@ -730,6 +784,7 @@ namespace MEDCoupling void setIteration(int it); int getIteration() const; void pushCorrespondence(MEDFileJointCorrespondence* correspondence); + void clearCorrespondences(); int getNumberOfCorrespondences() const; void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const; std::string simpleRepr() const; @@ -749,7 +804,7 @@ namespace MEDCoupling { return self->simpleRepr(); } - + MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const { MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i)); @@ -794,7 +849,7 @@ namespace MEDCoupling { return MEDFileJoint::New(); } - + MEDFileJoint(const std::string& fileName, const std::string& mName, int num) { return MEDFileJoint::New(fileName,mName,num); @@ -809,7 +864,7 @@ namespace MEDCoupling { return self->simpleRepr(); } - + MEDFileJointOneStep *getStepAtPos(int i) const { MEDFileJointOneStep *ret(self->getStepAtPos(i)); @@ -846,7 +901,7 @@ namespace MEDCoupling { return MEDFileJoints::New(); } - + MEDFileJoints(const std::string& fileName, const std::string& meshName) { return MEDFileJoints::New(fileName,meshName); @@ -895,7 +950,7 @@ namespace MEDCoupling } } }; - + class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone { private: @@ -907,12 +962,12 @@ namespace MEDCoupling private: MEDFileEquivalenceData(); public: - void setArray(DataArrayInt *data); + void setArray(DataArrayInt32 *data); %extend { - DataArrayInt *getArray() + DataArrayInt32 *getArray() { - DataArrayInt *ret(self->getArray()); + DataArrayInt32 *ret(self->getArray()); if(ret) ret->incrRef(); return ret; } @@ -932,17 +987,17 @@ namespace MEDCoupling public: void clear(); std::size_t size() const; - void setArray(int meshDimRelToMax, DataArrayInt *da); - void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da); + void setArray(int meshDimRelToMax, DataArrayInt32 *da); + void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt32 *da); %extend { - DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) + DataArrayInt32 *getArray(INTERP_KERNEL::NormalizedCellType type) { - DataArrayInt *ret(self->getArray(type)); + DataArrayInt32 *ret(self->getArray(type)); if(ret) ret->incrRef(); return ret; } - + PyObject *getTypes() const { std::vector result(self->getTypes()); @@ -964,7 +1019,7 @@ namespace MEDCoupling void setName(const std::string& name); std::string getDescription() const; void setDescription(const std::string& descr); - void setArray(int meshDimRelToMaxExt, DataArrayInt *da);; + void setArray(int meshDimRelToMaxExt, DataArrayInt32 *da);; %extend { MEDFileEquivalenceCell *initCell() @@ -980,14 +1035,14 @@ namespace MEDCoupling if(ret) ret->incrRef(); return ret; } - + MEDFileEquivalenceCell *getCell() { MEDFileEquivalenceCell *ret(self->getCell()); if(ret) ret->incrRef(); return ret; } - + MEDFileEquivalenceNode *getNode() { MEDFileEquivalenceNode *ret(self->getNode()); @@ -996,7 +1051,7 @@ namespace MEDCoupling } } }; - + class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone { private: @@ -1068,7 +1123,7 @@ namespace MEDCoupling virtual std::vector getFamArrNonEmptyLevelsExt() const; virtual std::vector getNumArrNonEmptyLevelsExt() const; virtual std::vector getNameArrNonEmptyLevelsExt() const; - virtual std::vector getDistributionOfTypes(int meshDimRelToMax) const; + virtual std::vector getDistributionOfTypes(int meshDimRelToMax) const; virtual MEDFileMesh *cartesianize() const; std::vector getNonEmptyLevels() const; std::vector getNonEmptyLevelsExt() const; @@ -1082,7 +1137,7 @@ namespace MEDCoupling void addFamily(const std::string& familyName, int id); void addFamilyOnGrp(const std::string& grpName, const std::string& famName); virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName); - virtual bool keepFamIdsOnlyOnLevs(const std::vector& famIds, const std::vector& levs); + virtual bool keepFamIdsOnlyOnLevs(const std::vector& famIds, const std::vector& levs); void copyFamGrpMapsFrom(const MEDFileMesh& other); void clearGrpMap(); void clearFamMap(); @@ -1091,22 +1146,22 @@ namespace MEDCoupling const std::map >& getGroupInfo() const; std::vector getFamiliesOnGroup(const std::string& name) const; std::vector getFamiliesOnGroups(const std::vector& grps) const; - std::vector getFamiliesIdsOnGroup(const std::string& name) const; + std::vector getFamiliesIdsOnGroup(const std::string& name) const; void setFamiliesOnGroup(const std::string& name, const std::vector& fams); - void setFamiliesIdsOnGroup(const std::string& name, const std::vector& famIds); + void setFamiliesIdsOnGroup(const std::string& name, const std::vector& famIds); std::vector getGroupsOnFamily(const std::string& name) const; void setGroupsOnFamily(const std::string& famName, const std::vector& grps); std::vector getGroupsNames() const; std::vector getFamiliesNames() const; std::vector getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const; - std::vector getGrpNonEmptyLevelsExt(const std::string& grp) const; - std::vector getGrpNonEmptyLevels(const std::string& grp) const; - std::vector getFamsNonEmptyLevels(const std::vector& fams) const; - std::vector getFamsNonEmptyLevelsExt(const std::vector& fams) const; - std::vector getGrpsNonEmptyLevels(const std::vector& grps) const; - std::vector getGrpsNonEmptyLevelsExt(const std::vector& grps) const; - std::vector getFamNonEmptyLevels(const std::string& fam) const; - std::vector getFamNonEmptyLevelsExt(const std::string& fam) const; + std::vector getGrpNonEmptyLevelsExt(const std::string& grp) const; + std::vector getGrpNonEmptyLevels(const std::string& grp) const; + std::vector getFamsNonEmptyLevels(const std::vector& fams) const; + std::vector getFamsNonEmptyLevelsExt(const std::vector& fams) const; + std::vector getGrpsNonEmptyLevels(const std::vector& grps) const; + std::vector getGrpsNonEmptyLevelsExt(const std::vector& grps) const; + std::vector getFamNonEmptyLevels(const std::string& fam) const; + std::vector getFamNonEmptyLevelsExt(const std::string& fam) const; std::vector getFamiliesNamesWithFilePointOfView() const; static std::string GetMagicFamilyStr(); void assignFamilyNameWithGroupName(); @@ -1124,7 +1179,7 @@ namespace MEDCoupling void changeFamilyName(const std::string& oldName, const std::string& newName); void changeFamilyId(int oldId, int newId); void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector& newFamiliesNames); - void setFamilyInfo(const std::map& info); + void setFamilyInfo(const std::map& info); void setGroupInfo(const std::map >&info); int getFamilyId(const std::string& name) const; int getMaxAbsFamilyId() const; @@ -1136,9 +1191,9 @@ namespace MEDCoupling virtual int getMaxAbsFamilyIdInArrays() const; virtual int getMaxFamilyIdInArrays() const; virtual int getMinFamilyIdInArrays() const; - DataArrayInt *getAllFamiliesIdsReferenced() const; - DataArrayInt *computeAllFamilyIdsInUse() const; - std::vector getFamiliesIds(const std::vector& famNames) const; + DataArrayIdType *getAllFamiliesIdsReferenced() const; + DataArrayIdType *computeAllFamilyIdsInUse() const; + std::vector getFamiliesIds(const std::vector& famNames) const; std::string getFamilyNameGivenId(int id) const; bool ensureDifferentFamIdsPerLevel(); void normalizeFamIdsTrio(); @@ -1148,20 +1203,20 @@ namespace MEDCoupling virtual std::string advancedRepr() const; // virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const; - virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr); - virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr); + virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayIdType *famArr); + virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayIdType *renumArr); virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr); - virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr); - virtual void addNodeGroup(const DataArrayInt *ids); - virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids); - virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector& fams, bool renum=false) const; - virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector& grps, bool renum=false) const; - virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const; - virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const; - virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const; - virtual DataArrayInt *getNodeGroupsArr(const std::vector& grps, bool renum=false) const; - virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const; - virtual DataArrayInt *getNodeFamiliesArr(const std::vector& fams, bool renum=false) const; + virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayIdType *globalNumArr); + virtual void addNodeGroup(const DataArrayIdType *ids); + virtual void addGroup(int meshDimRelToMaxExt, const DataArrayIdType *ids); + virtual DataArrayIdType *getFamiliesArr(int meshDimRelToMaxExt, const std::vector& fams, bool renum=false) const; + virtual DataArrayIdType *getGroupsArr(int meshDimRelToMaxExt, const std::vector& grps, bool renum=false) const; + virtual DataArrayIdType *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const; + virtual DataArrayIdType *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const; + virtual DataArrayIdType *getNodeGroupArr(const std::string& grp, bool renum=false) const; + virtual DataArrayIdType *getNodeGroupsArr(const std::vector& grps, bool renum=false) const; + virtual DataArrayIdType *getNodeFamilyArr(const std::string& fam, bool renum=false) const; + virtual DataArrayIdType *getNodeFamiliesArr(const std::vector& fams, bool renum=false) const; int getNumberOfJoints(); MEDFileJoints *getJoints(); void setJoints( MEDFileJoints* joints ); @@ -1181,6 +1236,12 @@ namespace MEDCoupling return self->getMeshAtLevel(meshDimRelToMaxExt,false); } + static INTERP_KERNEL::NormalizedCellType ConvertFromMEDFileGeoType(int geoType) + { + med_geometry_type geoType2((med_geometry_type) geoType); + return MEDFileMesh::ConvertFromMEDFileGeoType(geoType2); + } + PyObject *getTime() { int tmp1,tmp2; @@ -1206,11 +1267,11 @@ namespace MEDCoupling void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) { - std::vector grps; - convertFromPyObjVectorOfObj(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps); + std::vector grps; + convertFromPyObjVectorOfObj(li,SWIGTITraits::TI,"DataArrayInt",grps); self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum); } - + PyObject *areFamsEqual(const MEDFileMesh *other) const { std::string what; @@ -1257,36 +1318,36 @@ namespace MEDCoupling PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const { - const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt); + const DataArrayIdType *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt); if(tmp) tmp->incrRef(); - return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ); + return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 ); } PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) { - const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt); + const DataArrayIdType *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt); if(tmp) tmp->incrRef(); - return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ); + return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 ); } PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const { - const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt); + const DataArrayIdType *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt); if(tmp) tmp->incrRef(); - return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ); + return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 ); } PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const { - const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt); + const DataArrayIdType *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt); if(tmp) tmp->incrRef(); - return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ); + return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 ); } - + PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const { const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt); @@ -1304,11 +1365,11 @@ namespace MEDCoupling PyTuple_SetItem(ret,1,SWIG_From_bool(ret1)); return ret; } - + PyObject *unPolyze() { - DataArrayInt *ret3=0; - std::vector ret1,ret2; + DataArrayIdType *ret3=0; + std::vector ret1,ret2; bool ret0=self->unPolyze(ret1,ret2,ret3); PyObject *ret=PyTuple_New(4); PyTuple_SetItem(ret,0,SWIG_From_bool(ret0)); @@ -1317,9 +1378,9 @@ namespace MEDCoupling for(int j=0;j<(int)ret1.size()/3;j++) { PyObject *retLev2=PyList_New(3); - PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j])); - PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1])); - PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2])); + PyList_SetItem(retLev2,0,PyInt_FromLong(ret1[3*j])); + PyList_SetItem(retLev2,1,PyInt_FromLong(ret1[3*j+1])); + PyList_SetItem(retLev2,2,PyInt_FromLong(ret1[3*j+2])); PyList_SetItem(retLev1_0,j,retLev2); } PyTuple_SetItem(ret,1,retLev1_0); @@ -1328,14 +1389,14 @@ namespace MEDCoupling for(int j=0;j<(int)ret2.size()/3;j++) { PyObject *retLev2=PyList_New(3); - PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j])); - PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1])); - PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2])); + PyList_SetItem(retLev2,0,PyInt_FromLong(ret2[3*j])); + PyList_SetItem(retLev2,1,PyInt_FromLong(ret2[3*j+1])); + PyList_SetItem(retLev2,2,PyInt_FromLong(ret2[3*j+2])); PyList_SetItem(retLev1_1,j,retLev2); } PyTuple_SetItem(ret,2,retLev1_1); // - PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); return ret; } @@ -1346,9 +1407,9 @@ namespace MEDCoupling return ret; } - virtual DataArrayInt *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const + virtual DataArrayIdType *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const { - MCAuto ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt)); + MCAuto ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt)); return ret.retn(); } } @@ -1374,12 +1435,13 @@ namespace MEDCoupling MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector& grps, bool renum=false) const; MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const; MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector& fams, bool renum=false) const; - DataArrayInt *getNodeGroupsArr(const std::vector& grps, bool renum=false) const; + DataArrayIdType *getNodeGroupsArr(const std::vector& grps, bool renum=false) const; MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const; MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const; MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const; MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const; void forceComputationOfParts() const; + void computeRevNum() const; // void setFamilyNameAttachedOnId(int id, const std::string& newFamName); void setCoords(DataArrayDouble *coords); @@ -1389,15 +1451,16 @@ namespace MEDCoupling void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m); void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false); void optimizeFamilies(); - DataArrayInt *zipCoords(); - DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const; - DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const; + DataArrayIdType *computeFetchedNodeIds() const; + DataArrayIdType *zipCoords(); + DataArrayIdType *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const; + DataArrayIdType *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const; MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const; MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const; MEDFileUMesh *quadraticToLinear(double eps=1e-12) const; MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const; %extend - { + { MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) { return MEDFileUMesh::New(fileName,mName,dt,it,mrs); @@ -1423,7 +1486,7 @@ namespace MEDCoupling return MEDFileUMesh::New(); } - static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) + static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) { std::vector typesCpp1; convertPyToNewIntArr3(types,typesCpp1); @@ -1434,30 +1497,46 @@ namespace MEDCoupling return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs); } + static PyObject *LoadPartCoords(const std::string& fileName, const std::string& mName, int dt, int it, const std::vector& infosOnComp, mcIdType startNodeId, mcIdType stopNodeId) + { + MCAuto coords; + MCAuto partCoords; + MCAuto famCoords,numCoords; + MCAuto nameCoord; + MEDFileUMesh::LoadPartCoords(fileName,mName,dt,it,infosOnComp,startNodeId,stopNodeId,coords,partCoords,famCoords,numCoords,nameCoord); + PyObject *ret(PyTuple_New(5)); + PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,1,convertPartDefinition(partCoords.retn(),SWIG_POINTER_OWN | 0)); + PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(famCoords.retn()),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(numCoords.retn()),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(nameCoord.retn()),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 )); + return ret; + } + PyObject *__getstate__() { std::vector a0; - std::vector a1; + std::vector a1; std::vector a2; - std::vector< MCAuto > a3; + std::vector< MCAuto > a3; MCAuto a4; self->serialize(a0,a1,a2,a3,a4); PyObject *ret(PyTuple_New(5)); PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0)); PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1)); - int sz(a2.size()); + std::size_t sz(a2.size()); PyObject *ret2(PyList_New(sz)); - for(int i=0;iincrRef(); - PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); } PyTuple_SetItem(ret,3,ret3); DataArrayDouble *ret4(a4); @@ -1472,17 +1551,17 @@ namespace MEDCoupling static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !"; if(!PyTuple_Check(inp)) throw INTERP_KERNEL::Exception(MSG); - int sz(PyTuple_Size(inp)); + std::size_t sz(PyTuple_Size(inp)); if(sz!=5) throw INTERP_KERNEL::Exception(MSG); std::vector a0; - std::vector a1; + std::vector a1; std::vector a2; - std::vector< MCAuto > a3; + std::vector< MCAuto > a3; MCAuto a4; // PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2)); - int tmp(-1); + mcIdType tmp(-1); fillArrayWithPyListDbl3(a0py,tmp,a0); convertPyToNewIntArr3(a1py,a1); fillStringVector(a2py,a2); @@ -1496,8 +1575,8 @@ namespace MEDCoupling if((DataArrayDouble *)a4) a4->incrRef(); { - std::vector< DataArrayInt * > a3Tmp; - convertFromPyObjVectorOfObj(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp); + std::vector< DataArrayIdType * > a3Tmp; + convertFromPyObjVectorOfObj(b0py,SWIGTITraits::TI,"DataArrayInt",a3Tmp); std::size_t sz(a3Tmp.size()); a3.resize(sz); for(std::size_t i=0;i bb,bb2; - int sw; + mcIdType sw; const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true)); const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true)); MCAuto ret(self->symmetry3DPlane(centerPtr,vectorPtr)); @@ -1558,20 +1637,20 @@ namespace MEDCoupling PyObject *getAllDistributionOfTypes() const { - std::vector< std::pair > ret(self->getAllDistributionOfTypes()); + std::vector< std::pair > ret(self->getAllDistributionOfTypes()); return convertVecPairIntToPy(ret); } - - DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const + + DataArrayIdType *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const { - std::map > extractDefCpp; + std::map > extractDefCpp; convertToMapIntDataArrayInt(extractDef,extractDefCpp); return self->deduceNodeSubPartFromCellSubPart(extractDefCpp); } MEDFileUMesh *extractPart(PyObject *extractDef) const { - std::map > extractDefCpp; + std::map > extractDefCpp; convertToMapIntDataArrayInt(extractDef,extractDefCpp); return self->extractPart(extractDefCpp); } @@ -1589,7 +1668,7 @@ namespace MEDCoupling convertFromPyObjVectorOfObj(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms); self->setGroupsFromScratch(meshDimRelToMax,ms,renum); } - + void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) { std::vector ms; @@ -1615,15 +1694,15 @@ namespace MEDCoupling PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) { - DataArrayInt *ret0=0,*ret1=0,*ret2=0; + DataArrayIdType *ret0=0,*ret1=0,*ret2=0; self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2); PyObject *ret=PyTuple_New(3); - PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); - PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); - PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); return ret; } - + MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const { MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt)); @@ -1693,7 +1772,7 @@ namespace MEDCoupling { return MEDFileCMesh::New(db); } - + PyObject *getMesh() const { const MEDCouplingCMesh *tmp=self->getMesh(); @@ -1712,6 +1791,8 @@ namespace MEDCoupling static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0); static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); void setMesh(MEDCouplingCurveLinearMesh *m); + int getSpaceDimension() const; + int getMeshDimension() const; %extend { MEDFileCurveLinearMesh() @@ -1733,7 +1814,7 @@ namespace MEDCoupling { return MEDFileCurveLinearMesh::New(db); } - + PyObject *getMesh() const { const MEDCouplingCurveLinearMesh *tmp=self->getMesh(); @@ -1755,7 +1836,7 @@ namespace MEDCoupling void setOneTimeStep(MEDFileMesh *mesh1TimeStep); void cartesianizeMe(); %extend - { + { MEDFileMeshMultiTS() { return MEDFileMeshMultiTS::New(); @@ -1872,7 +1953,7 @@ namespace MEDCoupling { return self->getNumberOfMeshes(); } - + MEDFileMesh *getMeshAtPos(int i) const { MEDFileMesh *ret=self->getMeshAtPos(i); @@ -1946,18 +2027,18 @@ namespace MEDCoupling { PyObject *getProfile(const std::string& pflName) const { - const DataArrayInt *ret=self->getProfile(pflName); + const DataArrayIdType *ret=self->getProfile(pflName); if(ret) ret->incrRef(); - return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ); + return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 ); } PyObject *getProfileFromId(int pflId) const { - const DataArrayInt *ret=self->getProfileFromId(pflId); + const DataArrayIdType *ret=self->getProfileFromId(pflId); if(ret) ret->incrRef(); - return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ); + return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 ); } PyObject *getLocalizationFromId(int locId) const @@ -1967,7 +2048,7 @@ namespace MEDCoupling loc->incrRef(); return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 ); } - + PyObject *getLocalization(const std::string& locName) const { const MEDFileFieldLoc *loc=&self->getLocalization(locName); @@ -1975,7 +2056,7 @@ namespace MEDCoupling loc->incrRef(); return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 ); } - + PyObject *zipPflsNames() { std::vector< std::pair, std::string > > ret=self->zipPflsNames(); @@ -2017,7 +2098,7 @@ namespace MEDCoupling std::vector< std::pair, std::string > > v=convertVecPairVecStFromPy(li); self->changeLocsRefsNamesGen(v); } - + void changeLocsNamesInStruct(PyObject *li) { std::vector< std::pair, std::string > > v=convertVecPairVecStFromPy(li); @@ -2111,7 +2192,7 @@ namespace MEDCoupling { self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob); } - + void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) { self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob); @@ -2122,7 +2203,7 @@ namespace MEDCoupling std::vector< std::pair > modifTab=convertVecPairStStFromPy(li); return self->changeMeshNames(modifTab); } - + PyObject *getTypesOfFieldAvailable() const { std::vector ret=self->getTypesOfFieldAvailable(); @@ -2148,24 +2229,24 @@ namespace MEDCoupling std::vector< std::vector > typesF; std::vector< std::vector > pfls; std::vector< std::vector > locs; - std::vector< std::vector< std::pair > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs); - int sz=ret.size(); + std::vector< std::vector< std::pair > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs); + std::size_t sz=ret.size(); PyObject *ret2=PyList_New(sz); - for(int i=0;i >& dadsI=ret[i]; + const std::vector< std::pair >& dadsI=ret[i]; const std::vector& typesFI=typesF[i]; const std::vector& pflsI=pfls[i]; const std::vector& locsI=locs[i]; PyObject *elt=PyTuple_New(2); PyTuple_SetItem(elt,0,SWIG_From_int(types[i])); - int sz2=ret[i].size(); + std::size_t sz2=ret[i].size(); PyObject *elt2=PyList_New(sz2); - for(int j=0;j > extractDefCpp; + std::map > extractDefCpp; convertToMapIntDataArrayInt(extractDef,extractDefCpp); return self->extractPart(extractDefCpp,mm); } @@ -2224,7 +2305,8 @@ namespace MEDCoupling static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true); static MEDFileField1TS *New(DataArrayByte *db); static MEDFileField1TS *New(); - MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const; + MEDCoupling::MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const; + MEDCoupling::MEDFileInt64Field1TS *convertToInt64(bool isDeepCpyGlobs=true) const; void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf); MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const; MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const; @@ -2234,8 +2316,8 @@ namespace MEDCoupling MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const; // void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field); - void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile); - void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile); + void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile); + void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile); void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false); void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false); %extend @@ -2244,7 +2326,7 @@ namespace MEDCoupling { return MEDFileField1TS::New(fileName,loadAll); } - + MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) { return MEDFileField1TS::New(fileName,fieldName,loadAll); @@ -2264,7 +2346,7 @@ namespace MEDCoupling { return MEDFileField1TS::New(); } - + void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) { const DataArrayDouble *arr=0; @@ -2272,12 +2354,12 @@ namespace MEDCoupling arr=field->getArray(); self->copyTinyInfoFrom(field,arr); } - + std::string __str__() const { return self->simpleRepr(); } - + PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const { return MEDFileField1TS_getFieldWithProfile(self,type,meshDimRelToMax,mesh); @@ -2290,9 +2372,9 @@ namespace MEDCoupling std::vector< std::vector > pfls; std::vector< std::vector > locs; std::vector< std::vector > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs); - int sz=ret.size(); + std::size_t sz=ret.size(); PyObject *ret2=PyList_New(sz); - for(int i=0;i& dadsI=ret[i]; const std::vector& typesFI=typesF[i]; @@ -2300,9 +2382,9 @@ namespace MEDCoupling const std::vector& locsI=locs[i]; PyObject *elt=PyTuple_New(2); PyTuple_SetItem(elt,0,SWIG_From_int(types[i])); - int sz2=ret[i].size(); + std::size_t sz2=ret[i].size(); PyObject *elt2=PyList_New(sz2); - for(int j=0;j(self,type,meshDimRelToMax,mesh); + return MEDFileField1TS_getFieldWithProfile(self,type,meshDimRelToMax,mesh); } - - DataArrayInt *getUndergroundDataArray() const + + DataArrayInt32 *getUndergroundDataArray() const { - DataArrayInt *ret=self->getUndergroundDataArray(); + DataArrayInt32 *ret=self->getUndergroundDataArray(); if(ret) ret->incrRef(); return ret; @@ -2399,7 +2481,79 @@ namespace MEDCoupling PyObject *getUndergroundDataArrayExt() const { - return MEDFileField1TS_getUndergroundDataArrayExt(self); + return MEDFileField1TS_getUndergroundDataArrayExt(self); + } + } + }; + + class MEDFileInt64Field1TS : public MEDFileAnyTypeField1TS + { + public: + static MEDFileInt64Field1TS *New(); + static MEDFileInt64Field1TS *New(const std::string& fileName, bool loadAll=true); + static MEDFileInt64Field1TS *New(DataArrayByte *db); + static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true); + static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true); + MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const; + // + void setFieldNoProfileSBT(const MEDCouplingFieldInt64 *field); + void setFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile); + void setFieldProfileFlatly(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile); + void copyTimeInfoFrom(MEDCouplingFieldInt64 *mcf); + MEDCouplingFieldInt64 *field(const MEDFileMesh *mesh) const; + MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const; + MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const; + MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const; + MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const; + MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const; + %extend + { + MEDFileInt64Field1TS() + { + return MEDFileInt64Field1TS::New(); + } + + MEDFileInt64Field1TS(const std::string& fileName, bool loadAll=true) + { + return MEDFileInt64Field1TS::New(fileName,loadAll); + } + + MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) + { + return MEDFileInt64Field1TS::New(fileName,fieldName,loadAll); + } + + MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) + { + return MEDFileInt64Field1TS::New(fileName,fieldName,iteration,order,loadAll); + } + + MEDFileInt64Field1TS(DataArrayByte *db) + { + return MEDFileInt64Field1TS::New(db); + } + + std::string __str__() const + { + return self->simpleRepr(); + } + + PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const + { + return MEDFileField1TS_getFieldWithProfile(self,type,meshDimRelToMax,mesh); + } + + DataArrayInt64 *getUndergroundDataArray() const + { + DataArrayInt64 *ret=self->getUndergroundDataArray(); + if(ret) + ret->incrRef(); + return ret; + } + + PyObject *getUndergroundDataArrayExt() const + { + return MEDFileField1TS_getUndergroundDataArrayExt(self); } } }; @@ -2415,8 +2569,8 @@ namespace MEDCoupling MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const; // void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field); - void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile); - void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile); + void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile); + void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile); void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf); MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const; MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const; @@ -2460,7 +2614,7 @@ namespace MEDCoupling { return MEDFileField1TS_getFieldWithProfile(self,type,meshDimRelToMax,mesh); } - + DataArrayFloat *getUndergroundDataArray() const { DataArrayFloat *ret=self->getUndergroundDataArray(); @@ -2468,7 +2622,7 @@ namespace MEDCoupling ret->incrRef(); return ret; } - + PyObject *getUndergroundDataArrayExt() const { return MEDFileField1TS_getUndergroundDataArrayExt(self); @@ -2537,7 +2691,7 @@ namespace MEDCoupling { if(elt0 && PyInt_Check(elt0)) {//fmts[3] - int pos=PyInt_AS_LONG(elt0); + int pos=(int)PyInt_AS_LONG(elt0); return pos; } else if(elt0 && PyTuple_Check(elt0)) @@ -2548,8 +2702,8 @@ namespace MEDCoupling PyObject *o1=PyTuple_GetItem(elt0,1); if(PyInt_Check(o0) && PyInt_Check(o1)) {//fmts(1,-1) - int iter=PyInt_AS_LONG(o0); - int order=PyInt_AS_LONG(o1); + int iter=(int)PyInt_AS_LONG(o0); + int order=(int)PyInt_AS_LONG(o1); return self->getPosOfTimeStep(iter,order); } else @@ -2566,13 +2720,13 @@ namespace MEDCoupling else throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !"); } - + PyObject *getIterations() const { std::vector< std::pair > res(self->getIterations()); return convertVecPairIntToPy(res); } - + PyObject *getTimeSteps() const { std::vector ret1; @@ -2589,7 +2743,7 @@ namespace MEDCoupling } return ret2; } - + PyObject *getTypesOfFieldAvailable() const { std::vector< std::vector > ret=self->getTypesOfFieldAvailable(); @@ -2604,7 +2758,7 @@ namespace MEDCoupling } return ret2; } - + PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const { std::vector ret1; @@ -2614,31 +2768,31 @@ namespace MEDCoupling PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1)); return elt; } - + PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const { std::vector types; std::vector< std::vector > typesF; std::vector< std::vector > pfls; std::vector< std::vector > locs; - std::vector< std::vector< std::pair > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs); - int sz=ret.size(); + std::vector< std::vector< std::pair > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs); + std::size_t sz=ret.size(); PyObject *ret2=PyList_New(sz); - for(int i=0;i >& dadsI=ret[i]; + const std::vector< std::pair >& dadsI=ret[i]; const std::vector& typesFI=typesF[i]; const std::vector& pflsI=pfls[i]; const std::vector& locsI=locs[i]; PyObject *elt=PyTuple_New(2); PyTuple_SetItem(elt,0,SWIG_From_int(types[i])); - int sz2=ret[i].size(); + std::size_t sz2=ret[i].size(); PyObject *elt2=PyList_New(sz2); - for(int j=0;j ret(sz); - for(int i=0;igetNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !"); - self->eraseTimeStepIds2(strt,stp,step); + self->eraseTimeStepIds2((int)strt,(int)stp,(int)step); } else { @@ -2686,13 +2840,13 @@ namespace MEDCoupling self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size()); } } - + void eraseTimeStepIds(PyObject *li) { - int sw; + mcIdType sw; int pos1; std::vector pos2; - DataArrayInt *pos3=0; + DataArrayInt32 *pos3=0; DataArrayIntTuple *pos4=0; convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4); switch(sw) @@ -2728,10 +2882,10 @@ namespace MEDCoupling { if(elt0 && PyList_Check(elt0)) { - int sz=PyList_Size(elt0); - MCAuto da=DataArrayInt::New(); da->alloc(sz,1); + std::size_t sz=PyList_Size(elt0); + MCAuto da=DataArrayInt32::New(); da->alloc(sz,1); int *pt=da->getPointer(); - for(int i=0;igetNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !"); - return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0); + return convertMEDFileFieldMultiTS(self->buildSubPartSlice((int)strt,(int)stp,(int)step),SWIG_POINTER_OWN | 0); } else return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0); @@ -2802,7 +2956,7 @@ namespace MEDCoupling MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const { - std::map > extractDefCpp; + std::map > extractDefCpp; convertToMapIntDataArrayInt(extractDef,extractDefCpp); return self->extractPart(extractDefCpp,mm); } @@ -2829,7 +2983,7 @@ namespace MEDCoupling } return retPy; } - + static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) { std::vector vectFMTS; @@ -2864,8 +3018,9 @@ namespace MEDCoupling } }; - class MEDFileIntFieldMultiTS; - + class MEDFileInt32FieldMultiTS; + class MEDFileInt64FieldMultiTS; + class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS { public: @@ -2882,10 +3037,21 @@ namespace MEDCoupling MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const; // void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field); - void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile); - MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const; + void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile); + MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const; %extend { + static MEDFileAnyTypeFieldMultiTS *Aggregate(PyObject *fmtssPy, PyObject *dtsPy) + { + std::vector fmtss; + convertFromPyObjVectorOfObj(fmtssPy,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",fmtss); + std::vector< std::vector< std::pair > > dts2; + convertPyToVectorVectorPairInt(dtsPy,dts2); + std::vector< std::vector< std::pair > > dts(MEDVectorVectorMIIterator(0,dts2),MEDVectorVectorMIIterator(dts2.size(),dts2)); + MCAuto ret = MEDFileFieldMultiTS::Aggregate(fmtss,dts); + return ret.retn(); + } + MEDFileFieldMultiTS() { return MEDFileFieldMultiTS::New(); @@ -2900,7 +3066,7 @@ namespace MEDCoupling { return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll); } - + MEDFileFieldMultiTS(DataArrayByte *db) { return MEDFileFieldMultiTS::New(db); @@ -2918,7 +3084,7 @@ namespace MEDCoupling } return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll); } - + std::string __str__() const { return self->simpleRepr(); @@ -2926,11 +3092,11 @@ namespace MEDCoupling PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const { - DataArrayInt *ret1=0; + DataArrayIdType *ret1=0; DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1); PyObject *ret=PyTuple_New(2); PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 )); - PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); return ret; } @@ -2941,9 +3107,9 @@ namespace MEDCoupling std::vector< std::vector > pfls; std::vector< std::vector > locs; std::vector< std::vector > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs); - int sz=ret.size(); + std::size_t sz=ret.size(); PyObject *ret2=PyList_New(sz); - for(int i=0;i& dadsI=ret[i]; const std::vector& typesFI=typesF[i]; @@ -2951,9 +3117,9 @@ namespace MEDCoupling const std::vector& locsI=locs[i]; PyObject *elt=PyTuple_New(2); PyTuple_SetItem(elt,0,SWIG_From_int(types[i])); - int sz2=ret[i].size(); + std::size_t sz2=ret[i].size(); PyObject *elt2=PyList_New(sz2); - for(int j=0;jincrRef(); return ret; } - + PyObject *getUndergroundDataArrayExt(int iteration, int order) const { - std::vector< std::pair,std::pair > > elt1Cpp; + std::vector< std::pair,std::pair > > elt1Cpp; DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp); if(elt0) elt0->incrRef(); @@ -2992,8 +3158,8 @@ namespace MEDCoupling PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first)); PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second)); PyObject *elt3=PyTuple_New(2); - PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first)); - PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second)); + PyTuple_SetItem(elt3,0,PyInt_FromLong(elt1Cpp[i].second.first)); + PyTuple_SetItem(elt3,1,PyInt_FromLong(elt1Cpp[i].second.second)); PyTuple_SetItem(elt1,0,elt2); PyTuple_SetItem(elt1,1,elt3); PyList_SetItem(elt,i,elt1); @@ -3023,50 +3189,50 @@ namespace MEDCoupling } }; - class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS + class MEDFileInt32FieldMultiTS : public MEDFileAnyTypeFieldMultiTS { public: - static MEDFileIntFieldMultiTS *New(); - static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true); - static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true); - static MEDFileIntFieldMultiTS *New(DataArrayByte *db); + static MEDFileInt32FieldMultiTS *New(); + static MEDFileInt32FieldMultiTS *New(const std::string& fileName, bool loadAll=true); + static MEDFileInt32FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true); + static MEDFileInt32FieldMultiTS *New(DataArrayByte *db); // - void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field); - void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile); + void appendFieldNoProfileSBT(const MEDCouplingFieldInt32 *field); + void appendFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile); MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const; - MEDCouplingFieldInt *field(int iteration, int order, const MEDFileMesh *mesh) const; - MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const; - MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const; - MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const; - MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const; - MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const; + MEDCouplingFieldInt32 *field(int iteration, int order, const MEDFileMesh *mesh) const; + MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const; + MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const; + MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const; + MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const; + MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const; %extend { - MEDFileIntFieldMultiTS() + MEDFileInt32FieldMultiTS() { - return MEDFileIntFieldMultiTS::New(); + return MEDFileInt32FieldMultiTS::New(); } - - MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) + + MEDFileInt32FieldMultiTS(const std::string& fileName, bool loadAll=true) { - return MEDFileIntFieldMultiTS::New(fileName,loadAll); + return MEDFileInt32FieldMultiTS::New(fileName,loadAll); } - - MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) + + MEDFileInt32FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) { - return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll); + return MEDFileInt32FieldMultiTS::New(fileName,fieldName,loadAll); } - MEDFileIntFieldMultiTS(DataArrayByte *db) + MEDFileInt32FieldMultiTS(DataArrayByte *db) { - return MEDFileIntFieldMultiTS::New(db); + return MEDFileInt32FieldMultiTS::New(db); } - - static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true) + + static MEDFileInt32FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true) { std::vector > tmp(convertTimePairIdsFromPy(entities)); std::vector< std::pair > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp)); - return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll); + return MEDFileInt32FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll); } std::string __str__() const @@ -3076,17 +3242,88 @@ namespace MEDCoupling PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const { - DataArrayInt *ret1=0; - DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1); + DataArrayIdType *ret1=0; + DataArrayInt32 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1); PyObject *ret=PyTuple_New(2); - PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); - PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); return ret; } - DataArrayInt *getUndergroundDataArray(int iteration, int order) const + DataArrayInt32 *getUndergroundDataArray(int iteration, int order) const { - DataArrayInt *ret=self->getUndergroundDataArray(iteration,order); + DataArrayInt32 *ret=self->getUndergroundDataArray(iteration,order); + if(ret) + ret->incrRef(); + return ret; + } + } + }; + + class MEDFileInt64FieldMultiTS : public MEDFileAnyTypeFieldMultiTS + { + public: + static MEDFileInt64FieldMultiTS *New(); + static MEDFileInt64FieldMultiTS *New(const std::string& fileName, bool loadAll=true); + static MEDFileInt64FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true); + static MEDFileInt64FieldMultiTS *New(DataArrayByte *db); + // + void appendFieldNoProfileSBT(const MEDCouplingFieldInt64 *field); + void appendFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile); + MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const; + MEDCouplingFieldInt64 *field(int iteration, int order, const MEDFileMesh *mesh) const; + MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const; + MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const; + MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const; + MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const; + MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const; + %extend + { + MEDFileInt64FieldMultiTS() + { + return MEDFileInt64FieldMultiTS::New(); + } + + MEDFileInt64FieldMultiTS(const std::string& fileName, bool loadAll=true) + { + return MEDFileInt64FieldMultiTS::New(fileName,loadAll); + } + + MEDFileInt64FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) + { + return MEDFileInt64FieldMultiTS::New(fileName,fieldName,loadAll); + } + + MEDFileInt64FieldMultiTS(DataArrayByte *db) + { + return MEDFileInt64FieldMultiTS::New(db); + } + + static MEDFileInt64FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true) + { + std::vector > tmp(convertTimePairIdsFromPy(entities)); + std::vector< std::pair > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp)); + return MEDFileInt64FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll); + } + + std::string __str__() const + { + return self->simpleRepr(); + } + + PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const + { + DataArrayIdType *ret1=0; + DataArrayInt64 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1); + PyObject *ret=PyTuple_New(2); + PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); + return ret; + } + + DataArrayInt64 *getUndergroundDataArray(int iteration, int order) const + { + DataArrayInt64 *ret=self->getUndergroundDataArray(iteration,order); if(ret) ret->incrRef(); return ret; @@ -3103,7 +3340,7 @@ namespace MEDCoupling static MEDFileFloatFieldMultiTS *New(DataArrayByte *db); // void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field); - void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile); + void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile); MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const; MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const; MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const; @@ -3117,12 +3354,12 @@ namespace MEDCoupling { return MEDFileFloatFieldMultiTS::New(); } - + MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true) { return MEDFileFloatFieldMultiTS::New(fileName,loadAll); } - + MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) { return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll); @@ -3132,7 +3369,7 @@ namespace MEDCoupling { return MEDFileFloatFieldMultiTS::New(db); } - + static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true) { std::vector > tmp(convertTimePairIdsFromPy(entities)); @@ -3147,11 +3384,11 @@ namespace MEDCoupling PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const { - DataArrayInt *ret1=0; + DataArrayIdType *ret1=0; DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1); PyObject *ret=PyTuple_New(2); PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 )); - PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); return ret; } @@ -3164,7 +3401,7 @@ namespace MEDCoupling } } }; - + class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone { public: @@ -3182,7 +3419,7 @@ namespace MEDCoupling } } }; - + class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone { public: @@ -3246,12 +3483,12 @@ namespace MEDCoupling { return MEDFileFields::NewAdv(fileName,loadAll,entities); } - + std::string __str__() const { return self->simpleRepr(); } - + MEDFileFields *partOfThisOnStructureElements() const { MCAuto ret(self->partOfThisOnStructureElements()); @@ -3263,7 +3500,7 @@ namespace MEDCoupling MCAuto ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName)); return ret.retn(); } - + static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) { std::vector > tmp(convertTimePairIdsFromPy(entities)); @@ -3315,15 +3552,15 @@ namespace MEDCoupling std::vector< std::pair > ts=convertTimePairIdsFromPy(timeSteps); return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts); } - + PyObject *__getitem__(PyObject *obj) { if(obj && PyList_Check(obj)) { - int sz=PyList_Size(obj); + std::size_t sz=PyList_Size(obj); MCAuto da=DataArrayInt::New(); da->alloc(sz,1); int *pt=da->getPointer(); - for(int i=0;iiterator(); } - + bool changeMeshNames(PyObject *li) { std::vector< std::pair > modifTab=convertVecPairStStFromPy(li); @@ -3363,18 +3600,18 @@ namespace MEDCoupling throw INTERP_KERNEL::Exception(msg); if(PyInt_Check(elt0)) {//fmts[3] - return PyInt_AS_LONG(elt0); + return (int)PyInt_AS_LONG(elt0); } return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg)); } - + std::vector getPosOfFields(PyObject *elts) const { if(PyList_Check(elts)) { - int sz=PyList_Size(elts); + std::size_t sz=PyList_Size(elts); std::vector ret(sz); - for(int i=0;i(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp); self->pushFields(tmp); } - + void __delitem__(PyObject *elts) { if(elts && PySlice_Check(elts)) { Py_ssize_t strt=2,stp=2,step=2; GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !"); - self->destroyFieldsAtPos2(strt,stp,step); + self->destroyFieldsAtPos2((int)strt,(int)stp,(int)step); } else { @@ -3414,7 +3651,7 @@ namespace MEDCoupling MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const { - std::map > extractDefCpp; + std::map > extractDefCpp; convertToMapIntDataArrayInt(extractDef,extractDefCpp); return self->extractPart(extractDefCpp,mm); } @@ -3482,7 +3719,7 @@ namespace MEDCoupling { return MEDFileParameterDouble1TS::New(); } - + MEDFileParameterDouble1TS(const std::string& fileName) { return MEDFileParameterDouble1TS::New(fileName); @@ -3539,7 +3776,7 @@ namespace MEDCoupling { return MEDFileParameterMultiTS::New(); } - + MEDFileParameterMultiTS(const std::string& fileName) { return MEDFileParameterMultiTS::New(fileName); @@ -3554,7 +3791,7 @@ namespace MEDCoupling { return self->simpleRepr(); } - + PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const { std::string what; @@ -3566,10 +3803,10 @@ namespace MEDCoupling PyList_SetItem(res,1,PyString_FromString(what.c_str())); return res; } - + void eraseTimeStepIds(PyObject *ids) { - int sw; + mcIdType sw; int pos1; std::vector pos2; DataArrayInt *pos3=0; @@ -3614,8 +3851,8 @@ namespace MEDCoupling PyObject *o1=PyTuple_GetItem(elt0,1); if(PyInt_Check(o0) && PyInt_Check(o1)) {//fmts(1,-1) - int iter=PyInt_AS_LONG(o0); - int order=PyInt_AS_LONG(o1); + int iter=(int)PyInt_AS_LONG(o0); + int order=(int)PyInt_AS_LONG(o1); return self->getPosOfTimeStep(iter,order); } else @@ -3645,9 +3882,9 @@ namespace MEDCoupling { if(PyList_Check(elts)) { - int sz=PyList_Size(elts); + std::size_t sz=PyList_Size(elts); std::vector ret(sz); - for(int i=0;ieraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size()); } - + MEDFileParameter1TS *getTimeStepAtPos(int posId) const { MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId); @@ -3732,7 +3969,7 @@ namespace MEDCoupling { return MEDFileParameters::New(); } - + MEDFileParameters(const std::string& fileName) { return MEDFileParameters::New(fileName); @@ -3742,7 +3979,7 @@ namespace MEDCoupling { return MEDFileParameters::New(db); } - + std::string __str__() const { return self->simpleRepr(); @@ -3768,7 +4005,7 @@ namespace MEDCoupling { return self->getNumberOfParams(); } - + MEDFileParameterMultiTS *getParamAtPos(int i) const { MEDFileParameterMultiTS *ret=self->getParamAtPos(i); @@ -3784,7 +4021,7 @@ namespace MEDCoupling ret->incrRef(); return ret; } - + PyObject *isEqual(const MEDFileParameters *other, double eps) const { std::string what; @@ -3911,7 +4148,7 @@ namespace MEDCoupling } } }; - + /////////////// class MEDFileMeshStruct; @@ -3929,13 +4166,13 @@ namespace MEDCoupling protected: ~MEDFileMeshStruct(); }; - + class MEDMeshMultiLev : public RefCountObject { public: virtual MEDMeshMultiLev *prepare() const; DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const; - DataArrayInt *retrieveGlobalNodeIdsIfAny() const; + DataArrayIdType *retrieveGlobalNodeIdsIfAny() const; protected: ~MEDMeshMultiLev(); public: @@ -3943,52 +4180,52 @@ namespace MEDCoupling { PyObject *retrieveFamilyIdsOnCells() const { - DataArrayInt *famIds(0); + DataArrayIdType *famIds(0); bool isWithoutCopy(false); self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy); PyObject *ret=PyTuple_New(2); PyObject *ret1Py=isWithoutCopy?Py_True:Py_False; Py_XINCREF(ret1Py); - PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); PyTuple_SetItem(ret,1,ret1Py); return ret; } PyObject *retrieveNumberIdsOnCells() const { - DataArrayInt *numIds(0); + DataArrayIdType *numIds(0); bool isWithoutCopy(false); self->retrieveNumberIdsOnCells(numIds,isWithoutCopy); PyObject *ret=PyTuple_New(2); PyObject *ret1Py=isWithoutCopy?Py_True:Py_False; Py_XINCREF(ret1Py); - PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); PyTuple_SetItem(ret,1,ret1Py); return ret; } - + PyObject *retrieveFamilyIdsOnNodes() const { - DataArrayInt *famIds(0); + DataArrayIdType *famIds(0); bool isWithoutCopy(false); self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy); PyObject *ret=PyTuple_New(2); PyObject *ret1Py=isWithoutCopy?Py_True:Py_False; Py_XINCREF(ret1Py); - PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); PyTuple_SetItem(ret,1,ret1Py); return ret; } PyObject *retrieveNumberIdsOnNodes() const { - DataArrayInt *numIds(0); + DataArrayIdType *numIds(0); bool isWithoutCopy(false); self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy); PyObject *ret=PyTuple_New(2); PyObject *ret1Py=isWithoutCopy?Py_True:Py_False; Py_XINCREF(ret1Py); - PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); PyTuple_SetItem(ret,1,ret1Py); return ret; } @@ -4014,7 +4251,7 @@ namespace MEDCoupling { PyObject *buildVTUArrays() const { - DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0); + DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayIdType *cellLocations(0),*cells(0),*faceLocations(0),*faces(0); bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces)); PyObject *ret0Py=ncc?Py_True:Py_False; Py_XINCREF(ret0Py); @@ -4022,10 +4259,10 @@ namespace MEDCoupling PyTuple_SetItem(ret,0,ret0Py); PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 )); PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 )); - PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); - PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); - PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); - PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); return ret; } } @@ -4072,7 +4309,7 @@ namespace MEDCoupling PyObject *buildVTUArrays() const { DataArrayDouble *ret0(0); - std::vector ret1; + std::vector ret1; bool ret2; self->buildVTUArrays(ret0,ret1,ret2); std::size_t sz(ret1.size()); @@ -4080,7 +4317,7 @@ namespace MEDCoupling PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 )); PyObject *ret1Py=PyList_New(sz); for(std::size_t i=0;i& fieldFileName); + MeshFormatReader(); + MEDFileData* loadInMedFileDS(); + void setMeshName(const std::string& theMeshName); + std::string getMeshName() const; + void setFile(const std::string& theFileName); + void setFieldFileNames(const std::vector& theFieldFileNames); + std::vector getFieldFileNames() const; + }; + class MeshFormatWriter + { + public: + MeshFormatWriter(const std::string& meshFileName, const std::vector& fieldFileNames); + MeshFormatWriter(); + void setMeshFileName(const std::string& meshFileName); + std::string getMeshFileName() const; + void setFieldFileNames(const std::vector& fieldFileNames); + std::vector getFieldFileNames() const; + void setMEDFileDS(MEDCoupling::MEDFileData* mfd); + void write(); + }; + } %pythoncode %{ @@ -4124,4 +4387,12 @@ def exit1TS(self, exctype, exc, tb): pass MEDFileAnyTypeField1TS.__enter__=enter1TS MEDFileAnyTypeField1TS.__exit__=exit1TS +MEDFileIntField1TS = MEDFileInt32Field1TS +MEDFileIntFieldMultiTS = MEDFileInt32FieldMultiTS +if MEDCouplingUse64BitIDs(): + MEDFileIDField1TS = MEDFileInt64Field1TS + MEDFileIDFieldMultiTS = MEDFileInt64FieldMultiTS +else: + MEDFileIDField1TS = MEDFileInt32Field1TS + MEDFileIDFieldMultiTS = MEDFileInt32FieldMultiTS %}