-// Copyright (C) 2017-2021 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
%newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
%newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
%newobject MEDCoupling::MEDFileField1TS::convertToInt;
+%newobject MEDCoupling::MEDFileField1TS::convertToInt64;
%newobject MEDCoupling::MEDFileInt32Field1TS::New;
%newobject MEDCoupling::MEDFileInt32Field1TS::field;
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);
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);
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:
}
}
};
-
+
class MEDFileMeshReadSelector
{
public:
self->reprAll(oss);
return oss.str();
}
-
+
std::string __repr__() const
{
std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
{
return self->simpleRepr();
}
-
+
DataArrayIdType *getCorrespondence() const
{
const DataArrayIdType *ret(self->getCorrespondence());
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:
if(ret) ret->incrRef();
return ret;
}
-
+
PyObject *getTypes() const
{
std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
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:
convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grps);
self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
}
-
+
PyObject *areFamsEqual(const MEDFileMesh *other) const
{
std::string what;
tmp->incrRef();
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()
{
DataArrayIdType *ret3=0;
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);
std::vector< std::pair<int,mcIdType> > ret(self->getAllDistributionOfTypes());
return convertVecPairIntToPy(ret);
}
-
+
DataArrayIdType *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const
{
std::map<int, MCAuto<DataArrayIdType> > 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;
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();
{
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);
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();
static MEDFileField1TS *New(DataArrayByte *db);
static MEDFileField1TS *New();
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;
{
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);
{
return MEDFileField1TS_getFieldWithProfile<Int32>(self,type,meshDimRelToMax,mesh);
}
-
+
DataArrayInt32 *getUndergroundDataArray() const
{
DataArrayInt32 *ret=self->getUndergroundDataArray();
{
return MEDFileField1TS_getFieldWithProfile<Int64>(self,type,meshDimRelToMax,mesh);
}
-
+
DataArrayInt64 *getUndergroundDataArray() const
{
DataArrayInt64 *ret=self->getUndergroundDataArray();
{
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);
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;
return ret;
}
}
-
+
void __delitem__(PyObject *elts)
{
if(PySlice_Check(elts))
self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
}
}
-
+
void eraseTimeStepIds(PyObject *li)
{
mcIdType sw;
}
return retPy;
}
-
+
static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh)
{
std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
class MEDFileInt32FieldMultiTS;
class MEDFileInt64FieldMultiTS;
-
+
class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
{
public:
{
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();
ret->incrRef();
return ret;
}
-
+
PyObject *getUndergroundDataArrayExt(int iteration, int order) const
{
std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > > elt1Cpp;
{
return MEDFileInt32FieldMultiTS::New();
}
-
+
MEDFileInt32FieldMultiTS(const std::string& fileName, bool loadAll=true)
{
return MEDFileInt32FieldMultiTS::New(fileName,loadAll);
}
-
+
MEDFileInt32FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
{
return MEDFileInt32FieldMultiTS::New(fileName,fieldName,loadAll);
{
return MEDFileInt32FieldMultiTS::New(db);
}
-
+
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));
{
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);
{
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));
{
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));
}
}
};
-
+
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))
{
return self->iterator();
}
-
+
bool changeMeshNames(PyObject *li)
{
std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
}
return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
}
-
+
std::vector<int> getPosOfFields(PyObject *elts) const
{
if(PyList_Check(elts))
convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
self->pushFields(tmp);
}
-
+
void __delitem__(PyObject *elts)
{
if(elts && PySlice_Check(elts))
{
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)
{
mcIdType sw;
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:
PyTuple_SetItem(ret,1,ret1Py);
return ret;
}
-
+
PyObject *retrieveFamilyIdsOnNodes() const
{
DataArrayIdType *famIds(0);
}
}
};
-
+
class MeshFormatReader
{
public:
void setMEDFileDS(MEDCoupling::MEDFileData* mfd);
void write();
};
-
+
}
%pythoncode %{