-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2017 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
//
// Author : Anthony Geay (EDF R&D)
-%module MEDLoader
-
#define MEDCOUPLING_EXPORT
#define MEDLOADER_EXPORT
%newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
%newobject MEDCoupling::MEDFileFields::__iter__;
%newobject MEDCoupling::MEDFileFields::extractPart;
+%newobject MEDCoupling::MEDFileFields::linearToQuadratic;
%newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
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
- }
}
};
static std::string GetMagicFamilyStr();
void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
+ void removeGroupAtLevel(int meshDimRelToMaxExt, const std::string& name) throw(INTERP_KERNEL::Exception);
void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
return MEDFileUMesh::New();
}
- // serialization
- static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
- {
- return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
- }
-
static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<int>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
{
std::vector<int> typesCpp1;
return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
}
- PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
- {// put an empty dict in input to say to __new__ to call __init__...
- PyObject *ret(PyTuple_New(1));
- PyObject *ret0(PyDict_New());
- PyTuple_SetItem(ret,0,ret0);
- return ret;
- }
-
PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
{
std::vector<double> a0;
{
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)
{
{
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)
{
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();
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);
+ int getProfileId(const std::string& pfl) const throw(INTERP_KERNEL::Exception);
void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
%extend
{
static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
static MEDFileField1TS *New();
MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf) 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);
//
void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
+ void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
%extend
{
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)
{
//
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);
+ void setFieldProfileFlatly(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
+ void copyTimeInfoFrom(MEDCouplingFieldInt *mcf) 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);
return MEDFileIntField1TS::New(db);
}
- // serialization
- static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
- {
- return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
- }
-
std::string __str__() const throw(INTERP_KERNEL::Exception)
{
return self->simpleRepr();
//
void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
+ void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
+ void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf) throw(INTERP_KERNEL::Exception);
MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
return MEDFileFloatField1TS::New(db);
}
- // serialization
- static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
- {
- return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFloatField1TS");
- }
-
std::string __str__() const throw(INTERP_KERNEL::Exception)
{
return self->simpleRepr();
{
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)
{
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 MEDFileFloatFieldMultiTS::New(db);
}
- // serialization
- static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
- {
- return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFloatFieldMultiTS");
- }
-
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));
return MEDFileFields::NewAdv(fileName,loadAll,entities);
}
- // 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();
convertToMapIntDataArrayInt(extractDef,extractDefCpp);
return self->extractPart(extractDefCpp,mm);
}
+
+ MEDFileFields *linearToQuadratic(const MEDFileMeshes *oldLin, const MEDFileMeshes *newQuad) const throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<MEDFileFields> ret(self->linearToQuadratic(oldLin,newQuad));
+ return ret.retn();
+ }
}
};
{
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)
{
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");
- }
}
};