X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling_Swig%2FMEDCouplingRemapper.i;h=135958b8814de52a8c8e87ffe1cf24d09f591476;hb=0d89ead3756a73241e61fc46b60e59104b4be02c;hp=3b2359a61f6b28cc6ccb3b5800093b5c7b9988bb;hpb=293a6104470482e450701aa8061d9b244f2057d5;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling_Swig/MEDCouplingRemapper.i b/src/MEDCoupling_Swig/MEDCouplingRemapper.i index 3b2359a61..135958b88 100644 --- a/src/MEDCoupling_Swig/MEDCouplingRemapper.i +++ b/src/MEDCoupling_Swig/MEDCouplingRemapper.i @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D +// Copyright (C) 2007-2015 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 // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -42,6 +42,14 @@ using namespace INTERP_KERNEL; namespace ParaMEDMEM { + typedef enum + { + IK_ONLY_PREFERED = 0, + NOT_IK_ONLY_PREFERED = 1, + IK_ONLY_FORCED = 2, + NOT_IK_ONLY_FORCED =3 + } InterpolationMatrixPolicy; + class MEDCouplingRemapper : public TimeLabel, public INTERP_KERNEL::InterpolationOptions { private: @@ -49,23 +57,27 @@ namespace ParaMEDMEM public: MEDCouplingRemapper(); ~MEDCouplingRemapper(); - int prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const char *method) throw(INTERP_KERNEL::Exception); + int prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const std::string& method) throw(INTERP_KERNEL::Exception); int prepareEx(const MEDCouplingFieldTemplate *src, const MEDCouplingFieldTemplate *target) throw(INTERP_KERNEL::Exception); void transfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception); void partialTransfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField) throw(INTERP_KERNEL::Exception); void reverseTransfer(MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *transferField(const MEDCouplingFieldDouble *srcField, double dftValue) throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *reverseTransferField(const MEDCouplingFieldDouble *targetField, double dftValue) throw(INTERP_KERNEL::Exception); - bool setOptionInt(const std::string& key, int value); - bool setOptionDouble(const std::string& key, double value); - bool setOptionString(const std::string& key, const std::string& value); + bool setOptionInt(const std::string& key, int value) throw(INTERP_KERNEL::Exception); + bool setOptionDouble(const std::string& key, double value) throw(INTERP_KERNEL::Exception); + bool setOptionString(const std::string& key, const std::string& value) throw(INTERP_KERNEL::Exception); + int getInterpolationMatrixPolicy() const throw(INTERP_KERNEL::Exception); + void setInterpolationMatrixPolicy(int newInterpMatPol) throw(INTERP_KERNEL::Exception); // int nullifiedTinyCoeffInCrudeMatrixAbs(double maxValAbs) throw(INTERP_KERNEL::Exception); int nullifiedTinyCoeffInCrudeMatrix(double scaleFactor) throw(INTERP_KERNEL::Exception); double getMaxValueInCrudeMatrix() const throw(INTERP_KERNEL::Exception); + int getNumberOfColsOfMatrix() const throw(INTERP_KERNEL::Exception); + static std::string BuildMethodFrom(const std::string& meth1, const std::string& meth2) throw(INTERP_KERNEL::Exception); %extend { - PyObject *getCrudeMatrix() const + PyObject *getCrudeMatrix() const throw(INTERP_KERNEL::Exception) { const std::vector >& m=self->getCrudeMatrix(); std::size_t sz=m.size(); @@ -80,11 +92,20 @@ namespace ParaMEDMEM } return ret; } +#if defined(WITH_NUMPY) && defined(WITH_SCIPY) + PyObject *getCrudeCSRMatrix() const throw(INTERP_KERNEL::Exception) + { + return ToCSRMatrix(self->getCrudeMatrix(),self->getNumberOfColsOfMatrix()); + } +#endif } }; } %pythoncode %{ +def ParaMEDMEMDataArrayDoublenew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.DataArrayDouble____new___(cls,args) def ParaMEDMEMDataArrayDoubleIadd(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.DataArrayDouble____iadd___(self, self, *args) @@ -97,6 +118,12 @@ def ParaMEDMEMDataArrayDoubleImul(self,*args): def ParaMEDMEMDataArrayDoubleIdiv(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.DataArrayDouble____idiv___(self, self, *args) +def ParaMEDMEMDataArrayDoubleIpow(self,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.DataArrayDouble____ipow___(self, self, *args) +def ParaMEDMEMMEDCouplingFieldDoublenew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingFieldDouble____new___(cls,args) def ParaMEDMEMMEDCouplingFieldDoubleIadd(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.MEDCouplingFieldDouble____iadd___(self, self, *args) @@ -109,6 +136,15 @@ def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args): def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.MEDCouplingFieldDouble____idiv___(self, self, *args) +def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingFieldDouble____ipow___(self, self, *args) +def ParaMEDMEMDataArrayIntnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.DataArrayInt____new___(cls,args) +def ParaMEDMEMDataArrayIntnew(cls,*args): + import _MEDCoupling + return _MEDCoupling.DataArrayInt____new___(cls,args) def ParaMEDMEMDataArrayIntIadd(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.DataArrayInt____iadd___(self, self, *args) @@ -124,6 +160,9 @@ def ParaMEDMEMDataArrayIntIdiv(self,*args): def ParaMEDMEMDataArrayIntImod(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.DataArrayInt____imod___(self, self, *args) +def ParaMEDMEMDataArrayIntIpow(self,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.DataArrayInt____ipow___(self, self, *args) def ParaMEDMEMDataArrayDoubleTupleIadd(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.DataArrayDoubleTuple____iadd___(self, self, *args) @@ -151,6 +190,33 @@ def ParaMEDMEMDataArrayIntTupleIdiv(self,*args): def ParaMEDMEMDataArrayIntTupleImod(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.DataArrayIntTuple____imod___(self, self, *args) +def ParaMEDMEMDenseMatrixIadd(self,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.DenseMatrix____iadd___(self, self, *args) +def ParaMEDMEMDenseMatrixIsub(self,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.DenseMatrix____isub___(self, self, *args) +def ParaMEDMEMMEDCouplingUMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingUMesh____new___(cls,args) +def ParaMEDMEMMEDCoupling1DGTUMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCoupling1DGTUMesh____new___(cls,args) +def ParaMEDMEMMEDCoupling1SGTUMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCoupling1SGTUMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingCurveLinearMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingCurveLinearMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingCMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingCMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingIMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingIMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingExtrudedMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingExtrudedMesh____new___(cls,args) %} %include "MEDCouplingFinalize.i"