-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016 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::ReadFieldGaussNE;
%newobject MEDCoupling::MEDFileMesh::New;
%newobject MEDCoupling::MEDFileMesh::createNewEmpty;
-%newobject MEDCoupling::MEDFileMesh::deepCpy;
+%newobject MEDCoupling::MEDFileMesh::deepCopy;
%newobject MEDCoupling::MEDFileMesh::shallowCpy;
%newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
%newobject MEDCoupling::MEDFileMesh::__getitem__;
%newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
%newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
%newobject MEDCoupling::MEDFileUMesh::zipCoords;
+%newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
+%newobject MEDCoupling::MEDFileUMesh::extractPart;
%newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
%newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
%newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
+%newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
+%newobject MEDCoupling::MEDFileUMesh::Aggregate;
+%newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
%newobject MEDCoupling::MEDFileCMesh::New;
%newobject MEDCoupling::MEDFileCurveLinearMesh::New;
%newobject MEDCoupling::MEDFileMeshMultiTS::New;
-%newobject MEDCoupling::MEDFileMeshMultiTS::deepCpy;
+%newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
%newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
%newobject MEDCoupling::MEDFileMeshes::New;
-%newobject MEDCoupling::MEDFileMeshes::deepCpy;
+%newobject MEDCoupling::MEDFileMeshes::deepCopy;
%newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
%newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
%newobject MEDCoupling::MEDFileMeshes::__getitem__;
%newobject MEDCoupling::MEDFileFields::New;
%newobject MEDCoupling::MEDFileFields::LoadPartOf;
%newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
-%newobject MEDCoupling::MEDFileFields::deepCpy;
+%newobject MEDCoupling::MEDFileFields::deepCopy;
%newobject MEDCoupling::MEDFileFields::shallowCpy;
%newobject MEDCoupling::MEDFileFields::getFieldWithName;
%newobject MEDCoupling::MEDFileFields::getFieldAtPos;
%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::MEDFileWritableStandAlone::serialize;
%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
-%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCpy;
+%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
+%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
+%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
%newobject MEDCoupling::MEDFileFieldMultiTS::New;
%newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
+%newobject MEDCoupling::MEDFileFieldMultiTS::field;
%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
%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::MEDFileAnyTypeField1TS::New;
%newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
-%newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCpy;
+%newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
+%newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
%newobject MEDCoupling::MEDFileField1TS::New;
+%newobject MEDCoupling::MEDFileField1TS::field;
%newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
%newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
%newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
%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::MEDFileData::New;
-%newobject MEDCoupling::MEDFileData::deepCpy;
+%newobject MEDCoupling::MEDFileData::deepCopy;
%newobject MEDCoupling::MEDFileData::getMeshes;
%newobject MEDCoupling::MEDFileData::getFields;
%newobject MEDCoupling::MEDFileData::getParams;
+%newobject MEDCoupling::MEDFileData::Aggregate;
%newobject MEDCoupling::MEDFileParameterDouble1TS::New;
-%newobject MEDCoupling::MEDFileParameterDouble1TS::deepCpy;
+%newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
%newobject MEDCoupling::MEDFileParameterMultiTS::New;
-%newobject MEDCoupling::MEDFileParameterMultiTS::deepCpy;
+%newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
%newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
%newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
%newobject MEDCoupling::MEDFileParameters::New;
-%newobject MEDCoupling::MEDFileParameters::deepCpy;
+%newobject MEDCoupling::MEDFileParameters::deepCopy;
%newobject MEDCoupling::MEDFileParameters::getParamAtPos;
%newobject MEDCoupling::MEDFileParameters::getParamWithName;
%newobject MEDCoupling::MEDFileParameters::__getitem__;
%newobject MEDCoupling::MEDFileJointCorrespondence::New;
-%newobject MEDCoupling::MEDFileJointCorrespondence::deepCpy;
+%newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
%newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
%newobject MEDCoupling::MEDFileJointOneStep::New;
-%newobject MEDCoupling::MEDFileJointOneStep::deepCpy;
+%newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
%newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
%newobject MEDCoupling::MEDFileJoint::New;
-%newobject MEDCoupling::MEDFileJoint::deepCpy;
+%newobject MEDCoupling::MEDFileJoint::deepCopy;
%newobject MEDCoupling::MEDFileJoint::shallowCpy;
%newobject MEDCoupling::MEDFileJoints::New;
-%newobject MEDCoupling::MEDFileJoints::deepCpy;
+%newobject MEDCoupling::MEDFileJoints::deepCopy;
%newobject MEDCoupling::MEDFileJoints::getJointAtPos;
%newobject MEDCoupling::MEDFileJoints::getJointWithName;
%newobject MEDCoupling::MEDFileJoints::__getitem__;
%newobject MEDCoupling::MEDFileMeshStruct::New;
%newobject MEDCoupling::MEDMeshMultiLev::prepare;
%newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
+%newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
%newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
%newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
namespace MEDCoupling
{
bool HasXDR();
- std::string MEDFileVersionStr();
+ std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
+ std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
%inline
{
- PyObject *MEDFileVersionSwig()
+ PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
{
int major,minor,release;
MEDCoupling::MEDFileVersion(major,minor,release);
return ret;
}
- PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
+ 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);
PyObject *ret=PyList_New(res.size());
int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
};
+
+ class MEDFileWritableStandAlone : public MEDFileWritable
+ {
+ public:
+ void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ %extend
+ {
+ DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<DataArrayByte> ret(self->serialize());
+ return ret.retn();
+ }
+
+ PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
+ {
+ PyObject *ret(PyList_New(0));
+ return ret;
+ }
+ void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
+ {
+ }
+
+ PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
+ {
+#ifdef WITH_NUMPY
+ PyObject *ret(PyTuple_New(1));
+ PyObject *ret0(PyDict_New());
+ DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
+ PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
+ {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
+ PyObject *tmp1(PyInt_FromLong(0));
+ PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
+ PyTuple_SetItem(ret,0,ret0);
+ }
+ return ret;
+#else
+ throw INTERP_KERNEL::Exception("PyWrap of MEDFileData.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
+#endif
+ }
+ }
+ };
+
class MEDFileMeshReadSelector
{
public:
INTERP_KERNEL::NormalizedCellType rem_geo_type)
throw(INTERP_KERNEL::Exception);
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDFileJointCorrespondence *deepCpy() const;
+ MEDFileJointCorrespondence *deepCopy() const;
MEDFileJointCorrespondence *shallowCpy() const;
void setIsNodal(bool isNodal);
bool getIsNodal() const;
public:
static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
- MEDFileJointOneStep *deepCpy() const;
+ MEDFileJointOneStep *deepCopy() const;
MEDFileJointOneStep *shallowCpy() const;
bool isEqual(const MEDFileJointOneStep *other) const;
void setOrder(int order);
}
};
- class MEDFileJoint : public RefCountObject, public MEDFileWritable
+ class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
{
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);
- MEDFileJoint *deepCpy() const;
+ MEDFileJoint *deepCopy() const;
MEDFileJoint *shallowCpy() const;
bool isEqual(const MEDFileJoint *other) const;
void setLocalMeshName(const std::string& name);
void pushStep(MEDFileJointOneStep* step);
int getNumberOfSteps() const;
MEDFileJointOneStep *getStepAtPos(int i) const;
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const;
%extend
{
}
};
- class MEDFileJoints : public RefCountObject, public MEDFileWritable
+ class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
{
public:
static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- MEDFileJoints *deepCpy() const;
+ MEDFileJoints *deepCopy() const;
std::string simpleRepr() const;
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
std::string getMeshName() const;
int getNumberOfJoints() const;
std::vector<std::string> getJointsNames() const;
}
};
- class MEDFileEquivalenceBase : public RefCountObject
+ class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
{
private:
MEDFileEquivalenceBase();
}
};
- class MEDFileEquivalencePair : public RefCountObject
+ class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
{
private:
MEDFileEquivalencePair();
}
};
- class MEDFileEquivalences : public RefCountObject
+ class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
{
private:
MEDFileEquivalences();
}
};
- class MEDFileMesh : public RefCountObject, public MEDFileWritable
+ class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
{
public:
static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
- virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
+ virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
void setName(const std::string& name);
double getTimeValue() const;
void setTimeUnit(const std::string& unit);
std::string getTimeUnit() const;
- void setAxType(MEDCouplingAxisType at);
- MEDCouplingAxisType getAxType() const;
+ void setAxisType(MEDCouplingAxisType at);
+ MEDCouplingAxisType getAxisType() const;
virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
//
bool existsGroup(const std::string& groupName) 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)
public:
static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
+ static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
+ static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
static MEDFileUMesh *New();
+ static const char *GetSpeStr4ExtMesh();
~MEDFileUMesh();
int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
+ void checkConsistency() const throw(INTERP_KERNEL::Exception);
+ void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
+ void clearNodeAndCellNumbers();
//
MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
//
void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
+ void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
%extend
{
MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
return MEDFileUMesh::New(fileName,mrs);
}
+ MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileUMesh::New(mem);
+ }
+
+ MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileUMesh::New(db);
+ }
+
MEDFileUMesh()
{
return MEDFileUMesh::New();
std::vector<double> a0;
std::vector<int> a1;
std::vector<std::string> a2;
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
+ std::vector< MCAuto<DataArrayInt> > a3;
+ MCAuto<DataArrayDouble> a4;
self->serialize(a0,a1,a2,a3,a4);
PyObject *ret(PyTuple_New(5));
PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
std::vector<double> a0;
std::vector<int> a1;
std::vector<std::string> a2;
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
+ std::vector< MCAuto<DataArrayInt> > a3;
+ MCAuto<DataArrayDouble> a4;
//
PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
int tmp(-1);
self->removeMeshAtLevel(meshDimRelToMax);
}
+ MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
+ {
+ const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
+ double val,val2;
+ DataArrayDouble *a,*a2;
+ DataArrayDoubleTuple *aa,*aa2;
+ std::vector<double> bb,bb2;
+ int 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));
+ return ret.retn();
+ }
+
+ static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<const MEDFileUMesh *> meshesCpp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
+ MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
+ return ret.retn();
+ }
+
+ PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
+ return convertVecPairIntToPy(ret);
+ }
+
+ DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
+ {
+ std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
+ convertToMapIntDataArrayInt(extractDef,extractDefCpp);
+ return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
+ }
+
+ MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
+ {
+ std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
+ convertToMapIntDataArrayInt(extractDef,extractDefCpp);
+ return self->extractPart(extractDefCpp);
+ }
+
void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
{
std::vector<const MEDCouplingUMesh *> ms;
{
public:
static MEDFileCMesh *New();
+ static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
{
return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
}
+
+ MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileCMesh::New(db);
+ }
+
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
+ {
+ return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
+ }
PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
{
{
public:
static MEDFileCurveLinearMesh *New();
+ static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
{
return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
}
+
+ MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileCurveLinearMesh::New(db);
+ }
+
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
+ {
+ return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
+ }
PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
{
}
};
- class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
+ class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
{
public:
static MEDFileMeshMultiTS *New();
static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
- MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
std::string getName() const throw(INTERP_KERNEL::Exception);
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
void cartesianizeMe() throw(INTERP_KERNEL::Exception);
%extend
}
};
- class MEDFileMeshes : public RefCountObject, public MEDFileWritable
+ class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
{
public:
static MEDFileMeshes *New();
- static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
+ MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
//
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()
return MEDFileMeshes::New(fileName);
}
+ MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileMeshes::New(db);
+ }
+
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
+ {
+ return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
+ }
+
std::string __str__() const throw(INTERP_KERNEL::Exception)
{
return self->simpleRepr();
}
};
- class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
+ 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);
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
void loadArrays() throw(INTERP_KERNEL::Exception);
void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
void unloadArrays() throw(INTERP_KERNEL::Exception);
bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
- MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
%extend
PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
+ std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
+ std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
+ std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
return retPy;
}
+
+ MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
+ {
+ std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
+ convertToMapIntDataArrayInt(extractDef,extractDefCpp);
+ return self->extractPart(extractDefCpp,mm);
+ }
}
};
static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
static MEDFileField1TS *New();
MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
}
+ MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileField1TS::New(db);
+ }
+
MEDFileField1TS()
{
return MEDFileField1TS::New();
}
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
+ {
+ return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
+ }
+
void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
{
const DataArrayDouble *arr=0;
public:
static MEDFileIntField1TS *New();
static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
//
- void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
- void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
+ void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
+ void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
%extend
{
MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
}
- std::string __str__() const throw(INTERP_KERNEL::Exception)
- {
- return self->simpleRepr();
- }
-
- PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
+ MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
{
- DataArrayInt *ret1=0;
- MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
+ return MEDFileIntField1TS::New(db);
}
- PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
{
- DataArrayInt *ret1=0;
- MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
+ return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
}
- PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *ret1=0;
- MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *ret1=0;
- MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
+ std::string __str__() const throw(INTERP_KERNEL::Exception)
{
- DataArrayInt *ret1=0;
- MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
+ return self->simpleRepr();
}
PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
}
};
- class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
+ class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
{
public:
static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
std::string getName() const throw(INTERP_KERNEL::Exception);
void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
void loadArrays() throw(INTERP_KERNEL::Exception);
void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
void unloadArrays() throw(INTERP_KERNEL::Exception);
MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
+ MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
%extend
{
int __len__() const throw(INTERP_KERNEL::Exception)
PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
{
- std::vector< std::pair<int,int> > res=self->getIterations();
- PyObject *ret=PyList_New(res.size());
- int rk=0;
- for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
- {
- PyObject *elt=PyTuple_New(2);
- PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
- PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
- PyList_SetItem(ret,rk,elt);
- }
- return ret;
+ std::vector< std::pair<int,int> > res(self->getIterations());
+ return convertVecPairIntToPy(res);
}
PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
if(elt0 && PyList_Check(elt0))
{
int sz=PyList_Size(elt0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
+ MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
int *pt=da->getPointer();
for(int i=0;i<sz;i++,pt++)
{
PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
+ std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
+ std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
+ std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
}
}
+ MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
+ {
+ std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
+ convertToMapIntDataArrayInt(extractDef,extractDefCpp);
+ return self->extractPart(extractDefCpp,mm);
+ }
+
static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
{
std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
+ std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
if(ret2.size()!=ret.size())
{
static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
//
+ MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
{
return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
}
+
+ MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileFieldMultiTS::New(db);
+ }
+
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
+ {
+ return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
+ }
static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
{
static MEDFileIntFieldMultiTS *New();
static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
//
- void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
- void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
+ void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
+ void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
%extend
{
MEDFileIntFieldMultiTS()
return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
}
+ MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileIntFieldMultiTS::New(db);
+ }
+
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
+ {
+ return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
+ }
+
static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
{
std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
return self->simpleRepr();
}
- PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *ret1=0;
- MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *ret1=0;
- MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *ret1=0;
- MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *ret1=0;
- MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
- PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
- {
- DataArrayInt *ret1=0;
- MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
- PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- return ret;
- }
-
PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
{
DataArrayInt *ret1=0;
}
};
- class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
+ class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
{
public:
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 *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
- MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
void loadArrays() throw(INTERP_KERNEL::Exception);
void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
void unloadArrays() throw(INTERP_KERNEL::Exception);
void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
int getNumberOfFields() const;
std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getMeshesNames() const 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 killStructureElements() throw(INTERP_KERNEL::Exception);
void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
%extend
{
return MEDFileFields::New(fileName,loadAll);
}
+
+ MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileFields::New(db);
+ }
+
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
+ {
+ return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
+ }
std::string __str__() const throw(INTERP_KERNEL::Exception)
{
return self->simpleRepr();
}
-
+
+ MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
+ 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));
if(obj && PyList_Check(obj))
{
int sz=PyList_Size(obj);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
+ MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
int *pt=da->getPointer();
for(int i=0;i<sz;i++,pt++)
{
self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
}
}
+
+ MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
+ {
+ std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
+ convertToMapIntDataArrayInt(extractDef,extractDefCpp);
+ return self->extractPart(extractDefCpp,mm);
+ }
}
};
static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
- virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
+ virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
std::string getName() const throw(INTERP_KERNEL::Exception);
static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
std::string getName() const;
void setName(const std::string& name);
- MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
}
};
- class MEDFileParameters : public RefCountObject, public MEDFileWritable
+ class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
{
public:
static MEDFileParameters *New();
static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
+ MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
void resize(int newSize) throw(INTERP_KERNEL::Exception);
return MEDFileParameters::New(fileName);
}
+ MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileParameters::New(db);
+ }
+
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
+ {
+ return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
+ }
+
std::string __str__() const throw(INTERP_KERNEL::Exception)
{
return self->simpleRepr();
}
};
- class MEDFileData : public RefCountObject, public MEDFileWritable
+ class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
{
public:
+ static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
static MEDFileData *New();
- MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
//
bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
+ std::string getHeader() const throw(INTERP_KERNEL::Exception);
+ void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
//
- void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
%extend
{
MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
return MEDFileData::New(fileName);
}
+ MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileData::New(db);
+ }
+
MEDFileData()
{
return MEDFileData::New();
std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
return self->changeMeshNames(modifTab);
}
+
+ static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<const MEDFileData *> mfdsCpp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
+ MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
+ return ret.retn();
+ }
+
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
+ {
+ return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
+ }
}
};
public:
virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
protected:
~MEDMeshMultiLev();
public: