#include "MEDFileParameter.hxx"
#include "MEDFileData.hxx"
#include "MEDFileEquivalence.hxx"
+#include "MEDFileEntities.hxx"
#include "MEDFileMeshReadSelector.hxx"
#include "MEDFileFieldOverView.hxx"
#include "MEDLoaderTypemaps.i"
%newobject ReadUMeshFromFamiliesSwig;
%newobject ReadUMeshFromGroupsSwig;
+%newobject ReadFieldSwig;
%newobject MEDCoupling::ReadUMeshFromFile;
%newobject MEDCoupling::ReadMeshFromFile;
-%newobject MEDCoupling::ReadField;
%newobject MEDCoupling::ReadFieldCell;
%newobject MEDCoupling::ReadFieldNode;
%newobject MEDCoupling::ReadFieldGauss;
%newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
%newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
%newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
+%newobject MEDCoupling::MEDFileMesh::getGlobalNumFieldAtLevel;
%newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
%newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
%newobject MEDCoupling::MEDFileMesh::getEquivalences;
%newobject MEDCoupling::MEDFileMeshes::__getitem__;
%newobject MEDCoupling::MEDFileMeshes::__iter__;
+%newobject MEDCoupling::MEDFileMeshSupports::New;
+%newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
+
+%newobject MEDCoupling::MEDFileStructureElements::New;
+
%newobject MEDCoupling::MEDFileFields::New;
+%newobject MEDCoupling::MEDFileFields::NewAdv;
+%newobject MEDCoupling::MEDFileFields::NewWithDynGT;
%newobject MEDCoupling::MEDFileFields::LoadPartOf;
%newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
%newobject MEDCoupling::MEDFileFields::deepCopy;
%newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
%newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
%newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
+%newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
%newobject MEDCoupling::MEDFileFields::__iter__;
%newobject MEDCoupling::MEDFileFields::extractPart;
%newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
%newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
+%newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
%newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
%newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
%newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
%newobject MEDCoupling::MEDFileData::getParams;
%newobject MEDCoupling::MEDFileData::Aggregate;
+%newobject MEDCoupling::MEDFileEntities::BuildFrom;
+
%newobject MEDCoupling::MEDFileParameterDouble1TS::New;
%newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
%newobject MEDCoupling::MEDFileParameterMultiTS::New;
%newobject MEDCoupling::MEDFileJointCorrespondence::New;
%newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
%newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
+%newobject MEDCoupling::MEDFileJointCorrespondence::getCorrespondence;
%newobject MEDCoupling::MEDFileJointOneStep::New;
%newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
%newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
+%newobject MEDCoupling::MEDFileJointOneStep::getCorrespondenceAtPos;
+%newobject MEDCoupling::MEDFileJointOneStep::__getitem__;
%newobject MEDCoupling::MEDFileJoint::New;
%newobject MEDCoupling::MEDFileJoint::deepCopy;
%newobject MEDCoupling::MEDFileJoint::shallowCpy;
+%newobject MEDCoupling::MEDFileJoint::getStepAtPos;
+%newobject MEDCoupling::MEDFileJoint::__getitem__;
%newobject MEDCoupling::MEDFileJoints::New;
%newobject MEDCoupling::MEDFileJoints::deepCopy;
%newobject MEDCoupling::MEDFileJoints::getJointAtPos;
%feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
%feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
%feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
+%feature("unref") MEDFileMeshSupports "$this->decrRef();"
+%feature("unref") MEDFileStructureElements "$this->decrRef();"
%feature("unref") MEDFileFields "$this->decrRef();"
%feature("unref") MEDFileParameter1TS "$this->decrRef();"
%feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDCouplingFieldDouble *ReadField(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
MEDCoupling::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
MEDCoupling::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
MEDCoupling::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
%rename (GetTypesOfField) GetTypesOfFieldSwig;
%rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
%rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
+%rename (ReadField) ReadFieldSwig;
%inline
{
return ret;
}
+ MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName) throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName));
+ return ret.retn();
+ }
+
+ MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName));
+ return ret.retn();
+ }
+
+ MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
+ return ret.retn();
+ }
+
+ MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
+ return ret.retn();
+ }
+
PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
{
std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
bool isNodeNameFieldReading() const;
bool isCellNumFieldReading() const;
bool isNodeNumFieldReading() const;
+ bool isGlobalNodeNumFieldReading() const;
void setCellFamilyFieldReading(bool b);
void setNodeFamilyFieldReading(bool b);
void setCellNameFieldReading(bool b);
void setNodeNameFieldReading(bool b);
void setCellNumFieldReading(bool b);
void setNodeNumFieldReading(bool b);
+ void setGlobalNodeNumFieldReading(bool b);
%extend
{
std::string __str__() const throw(INTERP_KERNEL::Exception)
void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
- const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
%extend
{
return self->simpleRepr();
}
+
+ DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception)
+ {
+ const DataArrayInt *ret(self->getCorrespondence());
+ if(ret)
+ ret->incrRef();
+ return const_cast<DataArrayInt *>(ret);
+ }
}
};
int getIteration() const;
void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
int getNumberOfCorrespondences() const;
- MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
%extend
{
return self->simpleRepr();
}
+
+ MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const throw(INTERP_KERNEL::Exception)
+ {
+ MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ MEDFileJointCorrespondence *__getitem__(int i) const throw(INTERP_KERNEL::Exception)
+ {
+ return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
+ }
}
};
public:
static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
- static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
+ static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception);
MEDFileJoint *deepCopy() const;
MEDFileJoint *shallowCpy() const;
bool isEqual(const MEDFileJoint *other) const;
int getDomainNumber() const;
void pushStep(MEDFileJointOneStep* step);
int getNumberOfSteps() const;
- MEDFileJointOneStep *getStepAtPos(int i) const;
std::string simpleRepr() const;
%extend
{
return MEDFileJoint::New(fileName,mName,num);
}
+ MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
+ }
+
std::string __str__() const throw(INTERP_KERNEL::Exception)
{
return self->simpleRepr();
}
+
+ MEDFileJointOneStep *getStepAtPos(int i) const throw(INTERP_KERNEL::Exception)
+ {
+ MEDFileJointOneStep *ret(self->getStepAtPos(i));
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ MEDFileJointOneStep *__getitem__(int i) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
+ }
}
};
virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
+ virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr) throw(INTERP_KERNEL::Exception);
virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
void setJoints( MEDFileJoints* joints );
void initializeEquivalences();
void killEquivalences();
+ bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
+ void killStructureElements() throw(INTERP_KERNEL::Exception);
%extend
{
std::string __str__() const throw(INTERP_KERNEL::Exception)
if(ret) ret->incrRef();
return ret;
}
+
+ virtual DataArrayInt *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<DataArrayInt> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
+ return ret.retn();
+ }
}
};
void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
void cartesianizeMe() throw(INTERP_KERNEL::Exception);
+ bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
+ void killStructureElements() throw(INTERP_KERNEL::Exception);
%extend
{
MEDFileMeshes()
void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
+ void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
%extend
{
PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
}
};
+ class MEDFileEntities
+ {
+ public:
+ %extend
+ {
+ static MEDFileEntities *BuildFrom(PyObject *entities) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
+ std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
+ {
+ std::size_t sz(inp0.size());
+ inp.resize(sz);
+ for(std::size_t i=0;i<sz;i++)
+ inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
+ }
+ return MEDFileEntities::BuildFrom(&inp);
+ }
+ }
+ private:
+ MEDFileEntities();
+ };
+
class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
{
public:
static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
void loadArrays() throw(INTERP_KERNEL::Exception);
void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
void unloadArrays() throw(INTERP_KERNEL::Exception);
std::vector<int> pos2;
DataArrayInt *pos3=0;
DataArrayIntTuple *pos4=0;
- convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
+ convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
switch(sw)
{
case 1:
}
}
};
+
+ class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
+ {
+ public:
+ static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
+ %extend
+ {
+ MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
+ {
+ const MEDFileUMesh *ret(self->getSupMeshWithName(name));
+ MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
+ if(ret2)
+ ret2->incrRef();
+ return ret2;
+ }
+ }
+ };
+
+ class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
+ {
+ public:
+ static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
+ private:
+ MEDFileStructureElements();
+ };
class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
{
static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
+ static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
void loadArrays() throw(INTERP_KERNEL::Exception);
MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
+ bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
+ void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
+ void killStructureElements() throw(INTERP_KERNEL::Exception);
+ void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
+ void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
+ void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
%extend
{
return MEDFileFields::New(db);
}
+
+ MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileFields::NewAdv(fileName,loadAll,entities);
+ }
// serialization
static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
{
return self->simpleRepr();
}
+
+ MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
+ return ret.retn();
+ }
+ MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
+ return ret.retn();
+ }
+
static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
{
std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
}
+ PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<std::string,std::string> > ps;
+ self->getMeshSENames(ps);
+ return convertVectPairStToPy(ps);
+ }
+
PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
{
bool ret1;
std::vector<int> pos2;
DataArrayInt *pos3=0;
DataArrayIntTuple *pos4=0;
- convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
+ convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
switch(sw)
{
case 1:
//
bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
+ void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
std::string getHeader() const throw(INTERP_KERNEL::Exception);
void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
//