Salome HOME
Fix of reference connectivity of faces of PENTA15 cell from Roberto Da Via
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingRemapper.i
index c77a2d09f465215ca70ae6dd5987de025df9bf6a..96d02abeff412fde1edc2d27b5491b160f0a2f6c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2021  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
 
 %module MEDCouplingRemapper
 
-#define MEDCOUPLING_EXPORT
-#define INTERPKERNEL_EXPORT
-#define MEDCOUPLINGREMAPPER_EXPORT
-
-%{
-#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingUMesh.hxx"
-#include "MEDCouplingField.hxx"
-#include "MEDCouplingFieldDouble.hxx"
-#include "MEDCouplingRemapper.hxx"
-
-using namespace ParaMEDMEM;
-using namespace INTERP_KERNEL;
-%}
-
-%newobject ParaMEDMEM::MEDCouplingRemapper::transferField;
-%newobject ParaMEDMEM::MEDCouplingRemapper::reverseTransferField;
-
 %include "MEDCouplingCommon.i"
-%include "InterpolationOptions.hxx"
-
-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:
-      void updateTime() const;
-    public:
-      MEDCouplingRemapper();
-      ~MEDCouplingRemapper();
-      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) 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);
-      %extend
-         {
-           PyObject *getCrudeMatrix() const throw(INTERP_KERNEL::Exception)
-           {
-             const std::vector<std::map<int,double> >& m=self->getCrudeMatrix();
-             std::size_t sz=m.size();
-             PyObject *ret=PyList_New(sz);
-             for(std::size_t i=0;i<sz;i++)
-               {
-                 const std::map<int,double>& row=m[i];
-                 PyObject *ret0=PyDict_New();
-                 for(std::map<int,double>::const_iterator it=row.begin();it!=row.end();it++)
-                   PyDict_SetItem(ret0,PyInt_FromLong((*it).first),PyFloat_FromDouble((*it).second));
-                 PyList_SetItem(ret,i,ret0);
-               }
-             return ret;
-           }
-#if defined(WITH_NUMPY) && defined(WITH_SCIPY)
-           PyObject *getCrudeCSRMatrix() const throw(INTERP_KERNEL::Exception)
-           {
-             return ToCSRMatrix(self->getCrudeMatrix(),self->getNumberOfColsOfMatrix());
-           }
-#endif
-         }
-    };
-}
+%include "MEDCouplingRemapperCommon.i"
 
 %pythoncode %{
-def ParaMEDMEMDataArrayDoubleIadd(self,*args):
+def MEDCouplingDataArrayDoubleIadd(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.DataArrayDouble____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIsub(self,*args):
+def MEDCouplingDataArrayDoubleIsub(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.DataArrayDouble____isub___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleImul(self,*args):
+def MEDCouplingDataArrayDoubleImul(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.DataArrayDouble____imul___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIdiv(self,*args):
+def MEDCouplingDataArrayDoubleIdiv(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.DataArrayDouble____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIpow(self,*args):
+def MEDCouplingDataArrayDoubleIpow(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.DataArrayDouble____ipow___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIadd(self,*args):
+def MEDCouplingFieldDoubleIadd(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.MEDCouplingFieldDouble____iadd___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIsub(self,*args):
+def MEDCouplingFieldDoubleIsub(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.MEDCouplingFieldDouble____isub___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args):
+def MEDCouplingFieldDoubleImul(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.MEDCouplingFieldDouble____imul___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args):
+def MEDCouplingFieldDoubleIdiv(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.MEDCouplingFieldDouble____idiv___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args):
+def MEDCouplingFieldDoubleIpow(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.MEDCouplingFieldDouble____ipow___(self, self, *args)
-def ParaMEDMEMDataArrayIntIadd(self,*args):
+def MEDCouplingDataArrayFloatIadd(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayFloat____iadd___(self, self, *args)
+def MEDCouplingDataArrayFloatIsub(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayFloat____isub___(self, self, *args)
+def MEDCouplingDataArrayFloatImul(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayFloat____imul___(self, self, *args)
+def MEDCouplingDataArrayFloatIdiv(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayFloat____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32Iadd(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt32____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt32Isub(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt32____isub___(self, self, *args)
+def MEDCouplingDataArrayInt32Imul(self,*args):
     import _MEDCouplingRemapper
-    return _MEDCouplingRemapper.DataArrayInt____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayIntIsub(self,*args):
+    return _MEDCouplingRemapper.DataArrayInt32____imul___(self, self, *args)
+def MEDCouplingDataArrayInt32Idiv(self,*args):
     import _MEDCouplingRemapper
-    return _MEDCouplingRemapper.DataArrayInt____isub___(self, self, *args)
-def ParaMEDMEMDataArrayIntImul(self,*args):
+    return _MEDCouplingRemapper.DataArrayInt32____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32Imod(self,*args):
     import _MEDCouplingRemapper
-    return _MEDCouplingRemapper.DataArrayInt____imul___(self, self, *args)
-def ParaMEDMEMDataArrayIntIdiv(self,*args):
+    return _MEDCouplingRemapper.DataArrayInt32____imod___(self, self, *args)
+def MEDCouplingDataArrayInt32Ipow(self,*args):
     import _MEDCouplingRemapper
-    return _MEDCouplingRemapper.DataArrayInt____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntImod(self,*args):
+    return _MEDCouplingRemapper.DataArrayInt32____ipow___(self, self, *args)
+def MEDCouplingDataArrayInt64Iadd(self,*args):
     import _MEDCouplingRemapper
-    return _MEDCouplingRemapper.DataArrayInt____imod___(self, self, *args)
-def ParaMEDMEMDataArrayIntIpow(self,*args):
+    return _MEDCouplingRemapper.DataArrayInt64____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt64Isub(self,*args):
     import _MEDCouplingRemapper
-    return _MEDCouplingRemapper.DataArrayInt____ipow___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIadd(self,*args):
+    return _MEDCouplingRemapper.DataArrayInt64____isub___(self, self, *args)
+def MEDCouplingDataArrayInt64Imul(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt64____imul___(self, self, *args)
+def MEDCouplingDataArrayInt64Idiv(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt64____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt64Imod(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt64____imod___(self, self, *args)
+def MEDCouplingDataArrayInt64Ipow(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt64____ipow___(self, self, *args)
+def MEDCouplingDataArrayDoubleTupleIadd(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.DataArrayDoubleTuple____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIsub(self,*args):
+def MEDCouplingDataArrayDoubleTupleIsub(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.DataArrayDoubleTuple____isub___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleImul(self,*args):
+def MEDCouplingDataArrayDoubleTupleImul(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.DataArrayDoubleTuple____imul___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIdiv(self,*args):
+def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
     import _MEDCouplingRemapper
     return _MEDCouplingRemapper.DataArrayDoubleTuple____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIadd(self,*args):
+def MEDCouplingDataArrayInt32TupleIadd(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt32Tuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIsub(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt32Tuple____isub___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleImul(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt32Tuple____imul___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIdiv(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt32Tuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleImod(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt32Tuple____imod___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIadd(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt64Tuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIsub(self,*args):
+    import _MEDCouplingRemapper
+    return _MEDCouplingRemapper.DataArrayInt64Tuple____isub___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleImul(self,*args):
     import _MEDCouplingRemapper
-    return _MEDCouplingRemapper.DataArrayIntTuple____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIsub(self,*args):
+    return _MEDCouplingRemapper.DataArrayInt64Tuple____imul___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIdiv(self,*args):
     import _MEDCouplingRemapper
-    return _MEDCouplingRemapper.DataArrayIntTuple____isub___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleImul(self,*args):
+    return _MEDCouplingRemapper.DataArrayInt64Tuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleImod(self,*args):
     import _MEDCouplingRemapper
-    return _MEDCouplingRemapper.DataArrayIntTuple____imul___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIdiv(self,*args):
+    return _MEDCouplingRemapper.DataArrayInt64Tuple____imod___(self, self, *args)
+def MEDCouplingDenseMatrixIadd(self,*args):
     import _MEDCouplingRemapper
-    return _MEDCouplingRemapper.DataArrayIntTuple____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleImod(self,*args):
+    return _MEDCouplingRemapper.DenseMatrix____iadd___(self, self, *args)
+def MEDCouplingDenseMatrixIsub(self,*args):
     import _MEDCouplingRemapper
-    return _MEDCouplingRemapper.DataArrayIntTuple____imod___(self, self, *args)
+    return _MEDCouplingRemapper.DenseMatrix____isub___(self, self, *args)
 %}
 
 %include "MEDCouplingFinalize.i"