From a8952fa482832c3b07550eb218183b7ca446583a Mon Sep 17 00:00:00 2001 From: ageay Date: Thu, 21 Mar 2013 15:11:09 +0000 Subject: [PATCH] swig of computeMeshRestrictionFromTupleIds --- src/MEDCoupling_Swig/MEDCouplingCommon.i | 140 ++++++++++++++--------- 1 file changed, 83 insertions(+), 57 deletions(-) diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index 65ce6377b..1e4a99e7a 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -1987,65 +1987,8 @@ namespace ParaMEDMEM } } -%extend ParaMEDMEM::MEDCouplingFieldDiscretization -{ - MEDCouplingFieldDiscretization *clonePart(PyObject *li) - { - int sz=0,sw=-1,val1=-1; - std::vector val2; - const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2); - return self->clonePart(inp,inp+sz); - } - - PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception) - { - std::vector vVal; int iVal=-1; - int sz=-1,sw=0; - const int *tupleIdsBg=convertObjToPossibleCpp1_Safe(tupleIds,sw,sz,iVal,vVal); - if(sw==0) - throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !"); - DataArrayInt *ret0=0,*ret1=0; - self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1); - PyObject *pyRet=PyTuple_New(2); - PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); - PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); - return pyRet; - } -} - -%extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell -{ - PyObject *getArrayOfDiscIds() const - { - DataArrayInt *ret=const_cast(self->getArrayOfDiscIds()); - if(ret) - ret->incrRef(); - return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ); - } - - PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception) - { - std::vector ret1; - std::vector ret0=self->splitIntoSingleGaussDicrPerCellType(ret1); - std::size_t sz=ret0.size(); - PyObject *pyRet=PyTuple_New(2); - PyObject *pyRet0=PyList_New((int)sz); - PyObject *pyRet1=PyList_New((int)sz); - for(std::size_t i=0;i val2; + const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2); + return self->clonePart(inp,inp+sz); + } + + PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception) + { + std::vector vVal; int iVal=-1; + int sz=-1,sw=0; + const int *tupleIdsBg=convertObjToPossibleCpp1_Safe(tupleIds,sw,sz,iVal,vVal); + if(sw==0) + throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !"); + DataArrayInt *ret0=0,*ret1=0; + self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1); + PyObject *pyRet=PyTuple_New(2); + PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); + return pyRet; + } +} + +%extend ParaMEDMEM::MEDCouplingFieldDiscretizationP0 +{ + PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception) + { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); } +} + +%extend ParaMEDMEM::MEDCouplingFieldDiscretizationOnNodes +{ + PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception) + { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); } +} + +%extend ParaMEDMEM::MEDCouplingFieldDiscretizationGauss +{ + PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception) + { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); } +} + +%extend ParaMEDMEM::MEDCouplingFieldDiscretizationGaussNE +{ + PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception) + { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); } +} + +%extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell +{ + PyObject *getArrayOfDiscIds() const + { + DataArrayInt *ret=const_cast(self->getArrayOfDiscIds()); + if(ret) + ret->incrRef(); + return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ); + } + + PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception) + { + std::vector ret1; + std::vector ret0=self->splitIntoSingleGaussDicrPerCellType(ret1); + std::size_t sz=ret0.size(); + PyObject *pyRet=PyTuple_New(2); + PyObject *pyRet0=PyList_New((int)sz); + PyObject *pyRet1=PyList_New((int)sz); + for(std::size_t i=0;i