-// 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
#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;
%}
%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;
%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;
%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;
%newobject MEDCoupling::SauvReader::New;
%newobject MEDCoupling::SauvReader::loadInMEDFileDS;
+
%newobject MEDCoupling::MEDFileMeshStruct::New;
%newobject MEDCoupling::MEDMeshMultiLev::prepare;
%newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
%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();"
%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();"
%rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
%rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
%rename (ReadField) ReadFieldSwig;
+%rename (GetFamiliesGroupsInfo) GetFamiliesGroupsInfoSwig;
%inline
{
return ret;
}
+ int MEDFileSizeOfMedInt()
+ {
+ return 8*sizeof(med_int);
+ }
+
+ PyObject *GetFamiliesGroupsInfoSwig(const std::string& fileName, const std::string& meshName)
+ {
+ std::map<std::string,mcIdType> families;
+ std::map<std::string,std::vector<std::string>> 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<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName));
MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName));
return ret.retn();
}
-
+
MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order)
{
MCAuto<MEDCoupling::MEDCouplingField> 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<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
}
return ret;
}
-
+
PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName)
{
std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
}
return ret;
}
-
+
PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
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<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
PyObject *ret=PyTuple_New(4);
PyObject *elt0=PyList_New(res.size());
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)
{
std::vector<MEDCoupling::MEDCouplingFieldDouble *> 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<const MEDCoupling::MEDCouplingUMesh *> v;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(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<const MEDCoupling::MEDCouplingUMesh *> v;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(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<const MEDCoupling::MEDCouplingUMesh *> v;
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(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<size;i++)
+ for(std::size_t i=0;i<size;i++)
PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
return ret;
}
-
+
MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
{
std::vector<std::string> grps;
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
}
}
};
-
+
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;
self->reprAll(oss);
return oss.str();
}
-
+
std::string __repr__() const
{
std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
{
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)
;
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
{
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)
{
{
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<DataArrayInt *>(ret);
+ return const_cast<DataArrayIdType *>(ret);
}
}
};
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;
{
return self->simpleRepr();
}
-
+
MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const
{
MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
{
return MEDFileJoint::New();
}
-
+
MEDFileJoint(const std::string& fileName, const std::string& mName, int num)
{
return MEDFileJoint::New(fileName,mName,num);
{
return self->simpleRepr();
}
-
+
MEDFileJointOneStep *getStepAtPos(int i) const
{
MEDFileJointOneStep *ret(self->getStepAtPos(i));
{
return MEDFileJoints::New();
}
-
+
MEDFileJoints(const std::string& fileName, const std::string& meshName)
{
return MEDFileJoints::New(fileName,meshName);
}
}
};
-
+
class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
{
private:
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;
}
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<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
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()
if(ret) ret->incrRef();
return ret;
}
-
+
MEDFileEquivalenceCell *getCell()
{
MEDFileEquivalenceCell *ret(self->getCell());
if(ret) ret->incrRef();
return ret;
}
-
+
MEDFileEquivalenceNode *getNode()
{
MEDFileEquivalenceNode *ret(self->getNode());
}
}
};
-
+
class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
{
private:
virtual std::vector<int> getFamArrNonEmptyLevelsExt() const;
virtual std::vector<int> getNumArrNonEmptyLevelsExt() const;
virtual std::vector<int> getNameArrNonEmptyLevelsExt() const;
- virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const;
+ virtual std::vector<mcIdType> getDistributionOfTypes(int meshDimRelToMax) const;
virtual MEDFileMesh *cartesianize() const;
std::vector<int> getNonEmptyLevels() const;
std::vector<int> getNonEmptyLevelsExt() const;
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<int>& famIds, const std::vector<int>& levs);
+ virtual bool keepFamIdsOnlyOnLevs(const std::vector<mcIdType>& famIds, const std::vector<int>& levs);
void copyFamGrpMapsFrom(const MEDFileMesh& other);
void clearGrpMap();
void clearFamMap();
const std::map<std::string, std::vector<std::string> >& getGroupInfo() const;
std::vector<std::string> getFamiliesOnGroup(const std::string& name) const;
std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const;
- std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const;
+ std::vector<mcIdType> getFamiliesIdsOnGroup(const std::string& name) const;
void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams);
- void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds);
+ void setFamiliesIdsOnGroup(const std::string& name, const std::vector<mcIdType>& famIds);
std::vector<std::string> getGroupsOnFamily(const std::string& name) const;
void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps);
std::vector<std::string> getGroupsNames() const;
std::vector<std::string> getFamiliesNames() const;
std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
- std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const;
- std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const;
- std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
- std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
- std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
- std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
- std::vector<int> getFamNonEmptyLevels(const std::string& fam) const;
- std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const;
+ std::vector<mcIdType> getGrpNonEmptyLevelsExt(const std::string& grp) const;
+ std::vector<mcIdType> getGrpNonEmptyLevels(const std::string& grp) const;
+ std::vector<mcIdType> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
+ std::vector<mcIdType> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
+ std::vector<mcIdType> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
+ std::vector<mcIdType> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
+ std::vector<mcIdType> getFamNonEmptyLevels(const std::string& fam) const;
+ std::vector<mcIdType> getFamNonEmptyLevelsExt(const std::string& fam) const;
std::vector<std::string> getFamiliesNamesWithFilePointOfView() const;
static std::string GetMagicFamilyStr();
void assignFamilyNameWithGroupName();
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<std::string>& newFamiliesNames);
- void setFamilyInfo(const std::map<std::string,int>& info);
+ void setFamilyInfo(const std::map<std::string,mcIdType>& info);
void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
int getFamilyId(const std::string& name) const;
int getMaxAbsFamilyId() const;
virtual int getMaxAbsFamilyIdInArrays() const;
virtual int getMaxFamilyIdInArrays() const;
virtual int getMinFamilyIdInArrays() const;
- DataArrayInt *getAllFamiliesIdsReferenced() const;
- DataArrayInt *computeAllFamilyIdsInUse() const;
- std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const;
+ DataArrayIdType *getAllFamiliesIdsReferenced() const;
+ DataArrayIdType *computeAllFamilyIdsInUse() const;
+ std::vector<mcIdType> getFamiliesIds(const std::vector<std::string>& famNames) const;
std::string getFamilyNameGivenId(int id) const;
bool ensureDifferentFamIdsPerLevel();
void normalizeFamIdsTrio();
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<std::string>& fams, bool renum=false) const;
- virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& 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<std::string>& grps, bool renum=false) const;
- virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const;
- virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& 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<std::string>& fams, bool renum=false) const;
+ virtual DataArrayIdType *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& 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<std::string>& grps, bool renum=false) const;
+ virtual DataArrayIdType *getNodeFamilyArr(const std::string& fam, bool renum=false) const;
+ virtual DataArrayIdType *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const;
int getNumberOfJoints();
MEDFileJoints *getJoints();
void setJoints( MEDFileJoints* joints );
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;
void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false)
{
- std::vector<const DataArrayInt *> grps;
- convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
+ std::vector<const DataArrayIdType *> grps;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grps);
self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
}
-
+
PyObject *areFamsEqual(const MEDFileMesh *other) const
{
std::string what;
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<mcIdType>::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<mcIdType>::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<mcIdType>::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<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
-
+
PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const
{
const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
return ret;
}
-
+
PyObject *unPolyze()
{
- DataArrayInt *ret3=0;
- std::vector<int> ret1,ret2;
+ DataArrayIdType *ret3=0;
+ std::vector<mcIdType> ret1,ret2;
bool ret0=self->unPolyze(ret1,ret2,ret3);
PyObject *ret=PyTuple_New(4);
PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
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);
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<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
return ret;
}
- virtual DataArrayInt *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const
+ virtual DataArrayIdType *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const
{
- MCAuto<DataArrayInt> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
+ MCAuto<DataArrayIdType> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
return ret.retn();
}
}
MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
- DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
+ DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& 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);
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);
return MEDFileUMesh::New();
}
- static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<int>& 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<mcIdType>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
{
std::vector<int> typesCpp1;
convertPyToNewIntArr3(types,typesCpp1);
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<std::string>& infosOnComp, mcIdType startNodeId, mcIdType stopNodeId)
+ {
+ MCAuto<DataArrayDouble> coords;
+ MCAuto<PartDefinition> partCoords;
+ MCAuto<DataArrayIdType> famCoords,numCoords;
+ MCAuto<DataArrayAsciiChar> 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<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(numCoords.retn()),SWIGTITraits<mcIdType>::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<double> a0;
- std::vector<int> a1;
+ std::vector<mcIdType> a1;
std::vector<std::string> a2;
- std::vector< MCAuto<DataArrayInt> > a3;
+ std::vector< MCAuto<DataArrayIdType> > a3;
MCAuto<DataArrayDouble> 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;i<sz;i++)
+ for(std::size_t i=0;i<sz;i++)
PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
PyTuple_SetItem(ret,2,ret2);
sz=a3.size();
PyObject *ret3(PyList_New(sz));
- for(int i=0;i<sz;i++)
+ for(std::size_t i=0;i<sz;i++)
{
- DataArrayInt *elt(a3[i]);
+ DataArrayIdType *elt(a3[i]);
if(elt)
elt->incrRef();
- 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<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
}
PyTuple_SetItem(ret,3,ret3);
DataArrayDouble *ret4(a4);
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<double> a0;
- std::vector<int> a1;
+ std::vector<mcIdType> a1;
std::vector<std::string> a2;
- std::vector< MCAuto<DataArrayInt> > a3;
+ std::vector< MCAuto<DataArrayIdType> > a3;
MCAuto<DataArrayDouble> 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);
if((DataArrayDouble *)a4)
a4->incrRef();
{
- std::vector< DataArrayInt * > a3Tmp;
- convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
+ std::vector< DataArrayIdType * > a3Tmp;
+ convertFromPyObjVectorOfObj<MEDCoupling::DataArrayIdType *>(b0py,SWIGTITraits<mcIdType>::TI,"DataArrayInt",a3Tmp);
std::size_t sz(a3Tmp.size());
a3.resize(sz);
for(std::size_t i=0;i<sz;i++)
DataArrayDouble *a,*a2;
DataArrayDoubleTuple *aa,*aa2;
std::vector<double> 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<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
PyObject *getAllDistributionOfTypes() const
{
- std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
+ std::vector< std::pair<int,mcIdType> > ret(self->getAllDistributionOfTypes());
return convertVecPairIntToPy(ret);
}
-
- DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const
+
+ DataArrayIdType *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const
{
- std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
+ std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
convertToMapIntDataArrayInt(extractDef,extractDefCpp);
return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
}
MEDFileUMesh *extractPart(PyObject *extractDef) const
{
- std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
+ std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
convertToMapIntDataArrayInt(extractDef,extractDefCpp);
return self->extractPart(extractDefCpp);
}
convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
}
-
+
void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false)
{
std::vector<const MEDCouplingUMesh *> ms;
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<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
-
+
MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const
{
MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
{
return MEDFileCMesh::New(db);
}
-
+
PyObject *getMesh() const
{
const MEDCouplingCMesh *tmp=self->getMesh();
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()
{
return MEDFileCurveLinearMesh::New(db);
}
-
+
PyObject *getMesh() const
{
const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
void setOneTimeStep(MEDFileMesh *mesh1TimeStep);
void cartesianizeMe();
%extend
- {
+ {
MEDFileMeshMultiTS()
{
return MEDFileMeshMultiTS::New();
{
return self->getNumberOfMeshes();
}
-
+
MEDFileMesh *getMeshAtPos(int i) const
{
MEDFileMesh *ret=self->getMeshAtPos(i);
{
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<mcIdType>::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<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
}
PyObject *getLocalizationFromId(int locId) const
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);
loc->incrRef();
return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
}
-
+
PyObject *zipPflsNames()
{
std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
self->changeLocsRefsNamesGen(v);
}
-
+
void changeLocsNamesInStruct(PyObject *li)
{
std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
{
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);
std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
return self->changeMeshNames(modifTab);
}
-
+
PyObject *getTypesOfFieldAvailable() const
{
std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
std::vector< std::vector<TypeOfField> > typesF;
std::vector< std::vector<std::string> > pfls;
std::vector< std::vector<std::string> > locs;
- std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
- int sz=ret.size();
+ std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
+ std::size_t sz=ret.size();
PyObject *ret2=PyList_New(sz);
- for(int i=0;i<sz;i++)
+ for(std::size_t i=0;i<sz;i++)
{
- const std::vector< std::pair<int,int> >& dadsI=ret[i];
+ const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
const std::vector<TypeOfField>& typesFI=typesF[i];
const std::vector<std::string>& pflsI=pfls[i];
const std::vector<std::string>& 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<sz2;j++)
+ for(std::size_t j=0;j<sz2;j++)
{
PyObject *elt3=PyTuple_New(4);
PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
- PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,SWIG_From_int(dadsI[j].first)); PyTuple_SetItem(elt4,1,SWIG_From_int(dadsI[j].second));
+ PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
PyTuple_SetItem(elt3,1,elt4);
PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
{
- std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
+ std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
convertToMapIntDataArrayInt(extractDef,extractDefCpp);
return self->extractPart(extractDefCpp,mm);
}
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;
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
{
return MEDFileField1TS::New(fileName,loadAll);
}
-
+
MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
{
return MEDFileField1TS::New(fileName,fieldName,loadAll);
{
return MEDFileField1TS::New();
}
-
+
void copyTinyInfoFrom(const MEDCouplingFieldDouble *field)
{
const DataArrayDouble *arr=0;
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<double>(self,type,meshDimRelToMax,mesh);
std::vector< std::vector<std::string> > pfls;
std::vector< std::vector<std::string> > locs;
std::vector< std::vector<DataArrayDouble *> > 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<sz;i++)
+ for(std::size_t i=0;i<sz;i++)
{
const std::vector<DataArrayDouble *>& dadsI=ret[i];
const std::vector<TypeOfField>& typesFI=typesF[i];
const std::vector<std::string>& 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<sz2;j++)
+ for(std::size_t j=0;j<sz2;j++)
{
PyObject *elt3=PyTuple_New(4);
PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
}
};
- class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
+ class MEDFileInt32Field1TS : public MEDFileAnyTypeField1TS
{
public:
- static MEDFileIntField1TS *New();
- static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true);
- static MEDFileIntField1TS *New(DataArrayByte *db);
- static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
- static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
+ static MEDFileInt32Field1TS *New();
+ static MEDFileInt32Field1TS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileInt32Field1TS *New(DataArrayByte *db);
+ static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileInt32Field1TS *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 MEDCouplingFieldInt *field);
- void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
- void setFieldProfileFlatly(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
- void copyTimeInfoFrom(MEDCouplingFieldInt *mcf);
- MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const;
- MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
- MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
- MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
- MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
- MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
+ void setFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
+ void setFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void setFieldProfileFlatly(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void copyTimeInfoFrom(MEDCouplingFieldInt32 *mcf);
+ MEDCouplingFieldInt32 *field(const MEDFileMesh *mesh) const;
+ MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
%extend
{
- MEDFileIntField1TS()
+ MEDFileInt32Field1TS()
{
- return MEDFileIntField1TS::New();
+ return MEDFileInt32Field1TS::New();
}
- MEDFileIntField1TS(const std::string& fileName, bool loadAll=true)
+ MEDFileInt32Field1TS(const std::string& fileName, bool loadAll=true)
{
- return MEDFileIntField1TS::New(fileName,loadAll);
+ return MEDFileInt32Field1TS::New(fileName,loadAll);
}
- MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
+ MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
{
- return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
+ return MEDFileInt32Field1TS::New(fileName,fieldName,loadAll);
}
- MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
+ MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
{
- return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
+ return MEDFileInt32Field1TS::New(fileName,fieldName,iteration,order,loadAll);
}
- MEDFileIntField1TS(DataArrayByte *db)
+ MEDFileInt32Field1TS(DataArrayByte *db)
{
- return MEDFileIntField1TS::New(db);
+ return MEDFileInt32Field1TS::New(db);
}
std::string __str__() const
PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
{
- return MEDFileField1TS_getFieldWithProfile<int>(self,type,meshDimRelToMax,mesh);
+ return MEDFileField1TS_getFieldWithProfile<Int32>(self,type,meshDimRelToMax,mesh);
}
-
- DataArrayInt *getUndergroundDataArray() const
+
+ DataArrayInt32 *getUndergroundDataArray() const
{
- DataArrayInt *ret=self->getUndergroundDataArray();
+ DataArrayInt32 *ret=self->getUndergroundDataArray();
if(ret)
ret->incrRef();
return ret;
PyObject *getUndergroundDataArrayExt() const
{
- return MEDFileField1TS_getUndergroundDataArrayExt<int>(self);
+ return MEDFileField1TS_getUndergroundDataArrayExt<Int32>(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<Int64>(self,type,meshDimRelToMax,mesh);
+ }
+
+ DataArrayInt64 *getUndergroundDataArray() const
+ {
+ DataArrayInt64 *ret=self->getUndergroundDataArray();
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ PyObject *getUndergroundDataArrayExt() const
+ {
+ return MEDFileField1TS_getUndergroundDataArrayExt<Int64>(self);
}
}
};
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;
{
return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
}
-
+
DataArrayFloat *getUndergroundDataArray() const
{
DataArrayFloat *ret=self->getUndergroundDataArray();
ret->incrRef();
return ret;
}
-
+
PyObject *getUndergroundDataArrayExt() const
{
return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
{
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))
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
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<int,int> > res(self->getIterations());
return convertVecPairIntToPy(res);
}
-
+
PyObject *getTimeSteps() const
{
std::vector<double> ret1;
}
return ret2;
}
-
+
PyObject *getTypesOfFieldAvailable() const
{
std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
}
return ret2;
}
-
+
PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const
{
std::vector<int> ret1;
PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
return elt;
}
-
+
PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const
{
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector< std::vector<TypeOfField> > typesF;
std::vector< std::vector<std::string> > pfls;
std::vector< std::vector<std::string> > locs;
- std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
- int sz=ret.size();
+ std::vector< std::vector< std::pair<mcIdType,mcIdType> > > 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<sz;i++)
+ for(std::size_t i=0;i<sz;i++)
{
- const std::vector< std::pair<int,int> >& dadsI=ret[i];
+ const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
const std::vector<TypeOfField>& typesFI=typesF[i];
const std::vector<std::string>& pflsI=pfls[i];
const std::vector<std::string>& 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<sz2;j++)
+ for(std::size_t j=0;j<sz2;j++)
{
PyObject *elt3=PyTuple_New(4);
PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
- PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,SWIG_From_int(dadsI[j].first)); PyTuple_SetItem(elt4,1,SWIG_From_int(dadsI[j].second));
+ PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
PyTuple_SetItem(elt3,1,elt4);
PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
{
if(PyList_Check(elts))
{
- int sz=PyList_Size(elts);
+ std::size_t sz=PyList_Size(elts);
std::vector<int> ret(sz);
- for(int i=0;i<sz;i++)
+ for(std::size_t i=0;i<sz;i++)
{
PyObject *elt=PyList_GetItem(elts,i);
ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
return ret;
}
}
-
+
void __delitem__(PyObject *elts)
{
if(PySlice_Check(elts))
{
Py_ssize_t strt=2,stp=2,step=2;
GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
- self->eraseTimeStepIds2(strt,stp,step);
+ self->eraseTimeStepIds2((int)strt,(int)stp,(int)step);
}
else
{
self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
}
}
-
+
void eraseTimeStepIds(PyObject *li)
{
- int sw;
+ mcIdType sw;
int pos1;
std::vector<int> pos2;
- DataArrayInt *pos3=0;
+ DataArrayInt32 *pos3=0;
DataArrayIntTuple *pos4=0;
convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
switch(sw)
{
if(elt0 && PyList_Check(elt0))
{
- int sz=PyList_Size(elt0);
- MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
+ std::size_t sz=PyList_Size(elt0);
+ MCAuto<DataArrayInt32> da=DataArrayInt32::New(); da->alloc(sz,1);
int *pt=da->getPointer();
- for(int i=0;i<sz;i++,pt++)
+ for(std::size_t i=0;i<sz;i++,pt++)
{
PyObject *elt1=PyList_GetItem(elt0,i);
*pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
{
Py_ssize_t strt=2,stp=2,step=2;
GetIndicesOfSlice(elt0,self->getNumberOfTS(),&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);
MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
{
- std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
+ std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
convertToMapIntDataArrayInt(extractDef,extractDefCpp);
return self->extractPart(extractDefCpp,mm);
}
}
return retPy;
}
-
+
static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh)
{
std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
}
};
- class MEDFileIntFieldMultiTS;
-
+ class MEDFileInt32FieldMultiTS;
+ class MEDFileInt64FieldMultiTS;
+
class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
{
public:
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<const MEDFileAnyTypeFieldMultiTS *> fmtss;
+ convertFromPyObjVectorOfObj<const MEDFileAnyTypeFieldMultiTS *>(fmtssPy,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",fmtss);
+ std::vector< std::vector< std::pair<mcIdType,mcIdType> > > dts2;
+ convertPyToVectorVectorPairInt(dtsPy,dts2);
+ std::vector< std::vector< std::pair<int,mcIdType> > > dts(MEDVectorVectorMIIterator(0,dts2),MEDVectorVectorMIIterator(dts2.size(),dts2));
+ MCAuto<MEDFileAnyTypeFieldMultiTS> ret = MEDFileFieldMultiTS::Aggregate(fmtss,dts);
+ return ret.retn();
+ }
+
MEDFileFieldMultiTS()
{
return MEDFileFieldMultiTS::New();
{
return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
}
-
+
MEDFileFieldMultiTS(DataArrayByte *db)
{
return MEDFileFieldMultiTS::New(db);
}
return MEDFileFieldMultiTS::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
{
- 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<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
std::vector< std::vector<std::string> > pfls;
std::vector< std::vector<std::string> > locs;
std::vector< std::vector<DataArrayDouble *> > 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<sz;i++)
+ for(std::size_t i=0;i<sz;i++)
{
const std::vector<DataArrayDouble *>& dadsI=ret[i];
const std::vector<TypeOfField>& typesFI=typesF[i];
const std::vector<std::string>& 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<sz2;j++)
+ for(std::size_t j=0;j<sz2;j++)
{
PyObject *elt3=PyTuple_New(4);
PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
ret->incrRef();
return ret;
}
-
+
PyObject *getUndergroundDataArrayExt(int iteration, int order) const
{
- std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
+ std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > > elt1Cpp;
DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
if(elt0)
elt0->incrRef();
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);
}
};
- 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<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
- return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
+ return MEDFileInt32FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
}
std::string __str__() const
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<Int32>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::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<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
+ std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > 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<Int64>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::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;
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;
{
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);
{
return MEDFileFloatFieldMultiTS::New(db);
}
-
+
static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
{
std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
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<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
}
}
};
-
+
class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
{
public:
}
}
};
-
+
class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
{
public:
{
return MEDFileFields::NewAdv(fileName,loadAll,entities);
}
-
+
std::string __str__() const
{
return self->simpleRepr();
}
-
+
MEDFileFields *partOfThisOnStructureElements() const
{
MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
return ret.retn();
}
-
+
static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true)
{
std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
std::vector< std::pair<int,int> > 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<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
int *pt=da->getPointer();
- for(int i=0;i<sz;i++,pt++)
+ for(std::size_t i=0;i<sz;i++,pt++)
{
PyObject *elt1=PyList_GetItem(obj,i);
*pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
{
return self->iterator();
}
-
+
bool changeMeshNames(PyObject *li)
{
std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
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<int> getPosOfFields(PyObject *elts) const
{
if(PyList_Check(elts))
{
- int sz=PyList_Size(elts);
+ std::size_t sz=PyList_Size(elts);
std::vector<int> ret(sz);
- for(int i=0;i<sz;i++)
+ for(std::size_t i=0;i<sz;i++)
{
PyObject *elt=PyList_GetItem(elts,i);
ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(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
{
MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
{
- std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
+ std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
convertToMapIntDataArrayInt(extractDef,extractDefCpp);
return self->extractPart(extractDefCpp,mm);
}
{
return MEDFileParameterDouble1TS::New();
}
-
+
MEDFileParameterDouble1TS(const std::string& fileName)
{
return MEDFileParameterDouble1TS::New(fileName);
{
return MEDFileParameterMultiTS::New();
}
-
+
MEDFileParameterMultiTS(const std::string& fileName)
{
return MEDFileParameterMultiTS::New(fileName);
{
return self->simpleRepr();
}
-
+
PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const
{
std::string what;
PyList_SetItem(res,1,PyString_FromString(what.c_str()));
return res;
}
-
+
void eraseTimeStepIds(PyObject *ids)
{
- int sw;
+ mcIdType sw;
int pos1;
std::vector<int> pos2;
DataArrayInt *pos3=0;
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
{
if(PyList_Check(elts))
{
- int sz=PyList_Size(elts);
+ std::size_t sz=PyList_Size(elts);
std::vector<int> ret(sz);
- for(int i=0;i<sz;i++)
+ for(std::size_t i=0;i<sz;i++)
{
PyObject *elt=PyList_GetItem(elts,i);
ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
if(!idsToRemove.empty())
self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
}
-
+
MEDFileParameter1TS *getTimeStepAtPos(int posId) const
{
MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
{
return MEDFileParameters::New();
}
-
+
MEDFileParameters(const std::string& fileName)
{
return MEDFileParameters::New(fileName);
{
return MEDFileParameters::New(db);
}
-
+
std::string __str__() const
{
return self->simpleRepr();
{
return self->getNumberOfParams();
}
-
+
MEDFileParameterMultiTS *getParamAtPos(int i) const
{
MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
ret->incrRef();
return ret;
}
-
+
PyObject *isEqual(const MEDFileParameters *other, double eps) const
{
std::string what;
}
}
};
-
+
///////////////
class MEDFileMeshStruct;
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:
{
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<mcIdType>::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<mcIdType>::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<mcIdType>::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<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,ret1Py);
return ret;
}
{
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);
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<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
}
PyObject *buildVTUArrays() const
{
DataArrayDouble *ret0(0);
- std::vector<int> ret1;
+ std::vector<mcIdType> ret1;
bool ret2;
self->buildVTUArrays(ret0,ret1,ret2);
std::size_t sz(ret1.size());
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<sz;i++)
- PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
+ PyList_SetItem(ret1Py,i,PyInt_FromLong(ret1[i]));
PyTuple_SetItem(ret,1,ret1Py);
PyObject *ret2Py(ret2?Py_True:Py_False);
Py_XINCREF(ret2Py);
}
}
};
+
+ class MeshFormatReader
+ {
+ public:
+ MeshFormatReader(const std::string& meshFileName, const std::vector<std::string>& 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<std::string>& theFieldFileNames);
+ std::vector<std::string> getFieldFileNames() const;
+ };
+ class MeshFormatWriter
+ {
+ public:
+ MeshFormatWriter(const std::string& meshFileName, const std::vector<std::string>& fieldFileNames);
+ MeshFormatWriter();
+ void setMeshFileName(const std::string& meshFileName);
+ std::string getMeshFileName() const;
+ void setFieldFileNames(const std::vector<std::string>& fieldFileNames);
+ std::vector<std::string> getFieldFileNames() const;
+ void setMEDFileDS(MEDCoupling::MEDFileData* mfd);
+ void write();
+ };
+
}
%pythoncode %{
pass
MEDFileAnyTypeField1TS.__enter__=enter1TS
MEDFileAnyTypeField1TS.__exit__=exit1TS
+MEDFileIntField1TS = MEDFileInt32Field1TS
+MEDFileIntFieldMultiTS = MEDFileInt32FieldMultiTS
+if MEDCouplingUse64BitIDs():
+ MEDFileIDField1TS = MEDFileInt64Field1TS
+ MEDFileIDFieldMultiTS = MEDFileInt64FieldMultiTS
+else:
+ MEDFileIDField1TS = MEDFileInt32Field1TS
+ MEDFileIDFieldMultiTS = MEDFileInt32FieldMultiTS
%}