Salome HOME
Copyright update 2021
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingFieldDiscretization.i
1 // Copyright (C) 2007-2021  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
21 %newobject MEDCoupling::MEDCouplingFieldDiscretization::New;
22 %newobject MEDCoupling::MEDCouplingFieldDiscretization::deepCopy;
23 %newobject MEDCoupling::MEDCouplingFieldDiscretization::clone;
24 %newobject MEDCoupling::MEDCouplingFieldDiscretization::clonePartRange;
25 %newobject MEDCoupling::MEDCouplingFieldDiscretization::getOffsetArr;
26 %newobject MEDCoupling::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
27 %newobject MEDCoupling::MEDCouplingFieldDiscretization::getMeasureField;
28 %newobject MEDCoupling::MEDCouplingFieldDiscretization::clonePart;
29 %newobject MEDCoupling::MEDCouplingFieldDiscretization::getValueOnMulti;
30 %newobject MEDCoupling::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
31 %newobject MEDCoupling::MEDCouplingFieldDiscretizationKriging::PerformDriftOfVec;
32
33 namespace MEDCoupling
34 {
35   class MEDCouplingFieldDiscretization : public RefCountObject, public TimeLabel
36   {
37   public:
38     static MEDCouplingFieldDiscretization *New(TypeOfField type);
39     double getPrecision() const;
40     void setPrecision(double val);
41     static TypeOfField GetTypeOfFieldFromStringRepr(const std::string& repr);
42     virtual TypeOfField getEnum() const;
43     virtual bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const;
44     virtual bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
45     virtual bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const;
46     virtual MEDCouplingFieldDiscretization *deepCopy() const;
47     virtual MEDCouplingFieldDiscretization *clone() const;
48     virtual MEDCouplingFieldDiscretization *clonePartRange(int beginCellIds, int endCellIds, int stepCellIds) const;
49     virtual std::string getStringRepr() const;
50     virtual const char *getRepr() const;
51     virtual int getNumberOfTuples(const MEDCouplingMesh *mesh) const;
52     virtual int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const;
53     virtual DataArrayIdType *getOffsetArr(const MEDCouplingMesh *mesh) const;
54     virtual DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const;
55     virtual void checkCompatibilityWithNature(NatureOfField nat) const;
56     virtual double getIJK(const MEDCouplingMesh *mesh, const DataArrayDouble *da, int cellId, int nodeIdInCell, int compoId) const;
57     virtual void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArray *da) const;
58     virtual MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
59     virtual void setGaussLocalizationOnType(const MEDCouplingMesh *m, INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
60                                             const std::vector<double>& gsCoo, const std::vector<double>& wg);
61     virtual void clearGaussLocalizations();
62     virtual MEDCouplingGaussLocalization& getGaussLocalization(int locId);
63     virtual int getNbOfGaussLocalization() const;
64     virtual int getGaussLocalizationIdOfOneCell(int cellId) const;
65     virtual int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
66     %extend
67     {
68       virtual MEDCouplingFieldDiscretization *clonePart(PyObject *li)
69       {
70         mcIdType sz=0,sw=-1,val1=-1;
71         std::vector<mcIdType> val2;
72         const mcIdType *inp=convertIntStarLikePyObjToCppIntStar(li,sw,sz,val1,val2);
73         return self->clonePart(inp,inp+sz);
74       }
75       
76       virtual PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, mcIdType beginCellIds, mcIdType endCellIds, mcIdType stepCellIds, mcIdType& beginOut, mcIdType& endOut, mcIdType& stepOut, DataArrayIdType *&di) const
77       {
78         DataArrayIdType *ret1=0;
79         mcIdType bb,ee,ss;
80         MEDCouplingMesh *ret0=self->buildSubMeshDataRange(mesh,beginCellIds,endCellIds,stepCellIds,bb,ee,ss,ret1);
81         PyObject *res=PyTuple_New(2);
82         PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
83         if(ret1)
84           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
85         else
86           {
87             PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
88             PyTuple_SetItem(res,1,res1);
89           }
90         return res;
91       }
92
93       virtual mcIdType getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
94       {
95         std::vector<mcIdType> inp0;
96         convertPyToNewIntArr4(code,1,3,inp0);
97         std::vector<const DataArrayIdType *> inp1;
98         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(idsPerType,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",inp1);
99         return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
100       }
101
102       virtual PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const
103       {
104         std::vector<mcIdType> vVal; mcIdType iVal=-1;
105         mcIdType sz=-1,sw=0;
106         const mcIdType *tupleIdsBg=convertIntStarLikePyObjToCppIntStar(tupleIds,sw,sz,iVal,vVal);
107         if(sw==0)
108           throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !");
109         DataArrayIdType *ret0=0,*ret1=0;
110         self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
111         PyObject *pyRet=PyTuple_New(2);
112         PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
113         PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
114         return pyRet;
115       }
116
117       virtual PyObject *normL1(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
118       {
119         if(!arr)
120           throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::normL1 : input array is null !");
121         std::size_t sz(arr->getNumberOfComponents());
122         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
123         self->normL1(mesh,arr,tmp);
124         return convertDblArrToPyList<double>(tmp,sz);
125       }
126
127       virtual PyObject *normL2(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
128       {
129         if(!arr)
130           throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::normL2 : input array is null !");
131         std::size_t sz(arr->getNumberOfComponents());
132         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
133         self->normL2(mesh,arr,tmp);
134         return convertDblArrToPyList<double>(tmp,sz);
135       }
136
137       virtual PyObject *integral(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, bool isWAbs) const
138       {
139         if(!arr)
140           throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::integral : input array is null !");
141         std::size_t sz(arr->getNumberOfComponents());
142         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
143         self->integral(mesh,arr,isWAbs,tmp);
144         return convertDblArrToPyList<double>(tmp,sz);
145       }
146
147       virtual PyObject *getCellIdsHavingGaussLocalization(mcIdType locId) const
148       {
149         std::vector<mcIdType> tmp;
150         self->getCellIdsHavingGaussLocalization(locId,tmp);
151         DataArrayIdType *ret=DataArrayIdType::New();
152         ret->alloc(tmp.size(),1);
153         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
154         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
155       }
156
157       virtual void setGaussLocalizationOnCells(const MEDCouplingMesh *m, PyObject *li, const std::vector<double>& refCoo,
158                                                const std::vector<double>& gsCoo, const std::vector<double>& wg)
159       {
160         void *da=0;
161         int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 |  0 );
162         if (!SWIG_IsOK(res1))
163           {
164             mcIdType size;
165             INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
166             self->setGaussLocalizationOnCells(m,tmp,((mcIdType *)tmp)+size,refCoo,gsCoo,wg);
167           }
168         else
169           {
170             DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
171             if(!da2)
172               throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
173             da2->checkAllocated();
174             self->setGaussLocalizationOnCells(m,da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
175           }
176       }
177
178       virtual PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
179       {
180         std::set<mcIdType> ret=self->getGaussLocalizationIdsOfOneType(type);
181         return convertIntArrToPyList3(ret);
182       }
183
184       virtual PyObject *getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, PyObject *sl) const
185       {
186         double val;
187         DataArrayDouble *a;
188         DataArrayDoubleTuple *aa;
189         std::vector<double> bb;
190         mcIdType sw;
191         if(!mesh)
192           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDiscretization::getValueOn : no underlying mesh !");
193         int spaceDim=mesh->getSpaceDimension();
194         const char msg[]="Python wrap of MEDCouplingFieldDiscretization::getValueOn : ";
195         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
196         //
197         INTERP_KERNEL::AutoPtr<double> res(new double[spaceDim]);
198         self->getValueOn(arr,mesh,spaceLoc,res);
199         return convertDblArrToPyList<double>(res,spaceDim);
200       }
201
202       virtual PyObject *getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, mcIdType i, mcIdType j, mcIdType k) const
203       {
204         if(!arr)
205           throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::getValueOnPos : input array is null !");
206         std::size_t sz(arr->getNumberOfComponents());
207         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
208         self->getValueOnPos(arr,mesh,i,j,k,res);
209         return convertDblArrToPyList<double>(res,sz);
210       }
211       
212       virtual DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, PyObject *loc) const
213       {
214         if(!mesh)
215           throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDiscretization::getValueOnMulti : null input mesh !");
216         //
217         mcIdType sw,nbPts;
218         double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
219         const double *inp=convertObjToPossibleCpp5_Safe2(loc,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
220                                                          mesh->getSpaceDimension(),true,nbPts);
221         return self->getValueOnMulti(arr,mesh,inp,nbPts);
222       }
223
224       virtual void renumberCells(PyObject *li, bool check=true)
225       {
226         mcIdType sw,sz(-1);
227         mcIdType v0; std::vector<mcIdType> v1;
228         const mcIdType *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
229         self->renumberCells(ids,check);
230       }
231
232       virtual void renumberArraysForCell(const MEDCouplingMesh *mesh, PyObject *arrays,
233                                          PyObject *old2New, bool check)
234       {
235         std::vector<DataArray *> input1;
236         convertFromPyObjVectorOfObj<MEDCoupling::DataArray *>(arrays,SWIGTYPE_p_MEDCoupling__DataArray,"DataArray",input1);
237         //
238         mcIdType sw,sz(-1);
239         mcIdType v0; std::vector<mcIdType> v1;
240         const mcIdType *old2NewBg(convertIntStarLikePyObjToCppIntStar(old2New,sw,sz,v0,v1));
241         //
242         self->renumberArraysForCell(mesh,input1,old2NewBg,check);
243       }
244       
245       virtual DataArrayIdType *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, PyObject *cellIds) const
246       {
247         mcIdType sw,sz(-1);
248         mcIdType v0; std::vector<mcIdType> v1;
249         const mcIdType *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
250         return self->computeTupleIdsToSelectFromCellIds(mesh,cellIdsBg,cellIdsBg+sz);
251       }
252
253       virtual PyObject *buildSubMeshData(const MEDCouplingMesh *mesh, PyObject *ids)
254       {
255         mcIdType sw,sz(-1);
256         mcIdType v0; std::vector<mcIdType> v1;
257         const mcIdType *idsBg(convertIntStarLikePyObjToCppIntStar(ids,sw,sz,v0,v1));
258         DataArrayIdType *di(0);
259         MEDCouplingMesh *ret0=self->buildSubMeshData(mesh,idsBg,idsBg+sz,di);
260         PyObject *ret=PyTuple_New(2);
261         PyTuple_SetItem(ret,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
262         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(di),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
263         return ret;
264       }
265
266       virtual void renumberValuesOnNodes(double epsOnVals, PyObject *old2New, mcIdType newNbOfNodes, DataArrayDouble *arr) const
267       {
268         mcIdType sw,sz(-1);
269         mcIdType v0; std::vector<mcIdType> v1;
270         const mcIdType *old2NewBg(convertIntStarLikePyObjToCppIntStar(old2New,sw,sz,v0,v1));
271         self->renumberValuesOnNodes(epsOnVals,old2NewBg,newNbOfNodes,arr);
272       }
273
274       virtual void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, PyObject *old2New, mcIdType newSz, DataArrayDouble *arr) const
275       {
276         mcIdType sw,sz(-1);
277         mcIdType v0; std::vector<mcIdType> v1;
278         const mcIdType *old2NewBg(convertIntStarLikePyObjToCppIntStar(old2New,sw,sz,v0,v1));
279         self->renumberValuesOnCells(epsOnVals,mesh,old2NewBg,newSz,arr);
280       }
281
282       virtual void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, PyObject *new2old, mcIdType newSz, DataArrayDouble *arr) const
283       {
284         mcIdType sw,sz(-1);
285         mcIdType v0; std::vector<mcIdType> v1;
286         const mcIdType *new2oldBg(convertIntStarLikePyObjToCppIntStar(new2old,sw,sz,v0,v1));
287         self->renumberValuesOnCellsR(mesh,new2oldBg,newSz,arr);
288       }
289     }
290   };
291
292   class MEDCouplingFieldDiscretizationP0 : public MEDCouplingFieldDiscretization
293   {
294   };
295
296   class MEDCouplingFieldDiscretizationOnNodes : public MEDCouplingFieldDiscretization
297   {
298   };
299
300   class MEDCouplingFieldDiscretizationP1 : public MEDCouplingFieldDiscretizationOnNodes
301   {
302   };
303   
304   class MEDCouplingFieldDiscretizationPerCell : public MEDCouplingFieldDiscretization
305   {
306   public:
307     void setArrayOfDiscIds(const DataArrayIdType *adids);
308     void checkNoOrphanCells() const;
309     %extend
310     {
311       PyObject *getArrayOfDiscIds() const
312       {
313         DataArrayIdType *ret=const_cast<DataArrayIdType *>(self->getArrayOfDiscIds());
314         if(ret)
315           ret->incrRef();
316         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
317       }
318
319       PyObject *splitIntoSingleGaussDicrPerCellType() const
320       {
321         std::vector<mcIdType> ret1;
322         std::vector<DataArrayIdType *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
323         std::size_t sz=ret0.size();
324         PyObject *pyRet=PyTuple_New(2);
325         PyObject *pyRet0=PyList_New((mcIdType)sz);
326         PyObject *pyRet1=PyList_New((mcIdType)sz);
327         for(std::size_t i=0;i<sz;i++)
328           {
329             PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
330             PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
331           }
332         PyTuple_SetItem(pyRet,0,pyRet0);
333         PyTuple_SetItem(pyRet,1,pyRet1);
334         return pyRet;
335       }
336     }
337   protected:
338     ~MEDCouplingFieldDiscretizationPerCell();
339   };
340
341   class MEDCouplingFieldDiscretizationGauss : public MEDCouplingFieldDiscretizationPerCell
342   {
343   public:
344     MEDCouplingFieldDiscretizationGauss();
345   };
346
347   class MEDCouplingFieldDiscretizationGaussNE : public MEDCouplingFieldDiscretization
348   {
349   public:
350     %extend
351     {
352       static PyObject *GetWeightArrayFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType)
353       {
354         std::size_t sz(0);
355         const double *ret(MEDCouplingFieldDiscretizationGaussNE::GetWeightArrayFromGeometricType(geoType,sz));
356         return convertDblArrToPyList<double>(ret,ToIdType(sz));
357       }
358       
359       static PyObject *GetRefCoordsFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType)
360       {
361         std::size_t sz(0);
362         const double *ret(MEDCouplingFieldDiscretizationGaussNE::GetRefCoordsFromGeometricType(geoType,sz));
363         return convertDblArrToPyList<double>(ret,ToIdType(sz));
364       }
365       
366       static PyObject *GetLocsFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType)
367       {
368         std::size_t sz(0);
369         const double *ret(MEDCouplingFieldDiscretizationGaussNE::GetLocsFromGeometricType(geoType,sz));
370         return convertDblArrToPyList<double>(ret,ToIdType(sz));
371       }
372     }
373   };
374
375   class MEDCouplingFieldDiscretizationKriging : public MEDCouplingFieldDiscretizationOnNodes
376   {
377   public:
378     static DataArrayDouble *PerformDriftOfVec(const DataArrayDouble *arr, mcIdType isDrift);
379     %extend
380     {
381       PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
382       {
383         mcIdType ret1;
384         DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
385         PyObject *ret=PyTuple_New(2);
386         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
387         PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
388         return ret;
389       }
390       
391       PyObject *computeInverseMatrix(const MEDCouplingMesh *mesh) const
392       {
393         mcIdType ret1(-1),ret2(-1);
394         DataArrayDouble *ret0=self->computeInverseMatrix(mesh,ret1,ret2);
395         PyObject *ret=PyTuple_New(3);
396         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
397         PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
398         PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
399         return ret;
400       }
401
402       PyObject *computeMatrix(const MEDCouplingMesh *mesh) const
403       {
404         mcIdType ret1(-1),ret2(-1);
405         DataArrayDouble *ret0=self->computeMatrix(mesh,ret1,ret2);
406         PyObject *ret=PyTuple_New(3);
407         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
408         PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
409         PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
410         return ret;
411       }
412       
413       PyObject *computeEvaluationMatrixOnGivenPts(const MEDCouplingMesh *mesh, PyObject *locs) const
414       {
415         if(!mesh)
416           throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretizationKriging::computeEvaluationMatrixOnGivenPts : input mesh is empty !");
417         mcIdType sw,nbPts;
418         double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
419         const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDiscretizationKriging::computeEvaluationMatrixOnGivenPts",
420                                                          mesh->getSpaceDimension(),true,nbPts);
421         //
422         mcIdType ret1(-1);
423         DataArrayDouble *ret0=self->computeEvaluationMatrixOnGivenPts(mesh,inp,nbPts,ret1);
424         PyObject *ret=PyTuple_New(2);
425         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
426         PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
427         return ret;
428       }
429
430       void operateOnDenseMatrix(int spaceDimension, DataArrayDouble *myMatrix) const
431       {
432         if(!myMatrix || !myMatrix->isAllocated() || myMatrix->getNumberOfComponents()!=1)
433           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingFieldDiscretizationKriging::operateOnDenseMatrix : invalid input matrix as DataArrayDouble ! Must be allocated with one component !");
434         self->operateOnDenseMatrix(spaceDimension,myMatrix->getNumberOfTuples(),myMatrix->getPointer());
435       }
436
437       PyObject *performDrift(const DataArrayDouble *matr, const DataArrayDouble *arr) const
438       {
439         mcIdType ret1(-1);
440         DataArrayDouble *ret0(self->performDrift(matr,arr,ret1));
441         PyObject *res(PyTuple_New(2));
442         PyTuple_SetItem(res,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0));
443         PyTuple_SetItem(res,1,PyInt_FromLong(ret1));
444         return res;
445       }
446
447       static PyObject *PerformDriftRect(const DataArrayDouble *matr, const DataArrayDouble *arr)
448       {
449         mcIdType ret1(-1);
450         DataArrayDouble *ret0(MEDCouplingFieldDiscretizationKriging::PerformDriftRect(matr,arr,ret1));
451         PyObject *res(PyTuple_New(2));
452         PyTuple_SetItem(res,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0));
453         PyTuple_SetItem(res,1,PyInt_FromLong(ret1));
454         return res;
455       }
456
457       static void OperateOnDenseMatrixH3(DataArrayDouble *myMatrix)
458       {
459         if(!myMatrix || !myMatrix->isAllocated() || myMatrix->getNumberOfComponents()!=1)
460           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingFieldDiscretizationKriging::OperateOnDenseMatrixH3 : invalid input matrix as DataArrayDouble ! Must be allocated with one component !");
461         MEDCouplingFieldDiscretizationKriging::OperateOnDenseMatrixH3(myMatrix->getNumberOfTuples(),myMatrix->getPointer());
462       }
463       
464       static void OperateOnDenseMatrixH2Ln(DataArrayDouble *myMatrix) //throw(INTERP_KERNEL::Exception)
465       {
466         if(!myMatrix || !myMatrix->isAllocated() || myMatrix->getNumberOfComponents()!=1)
467           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingFieldDiscretizationKriging::OperateOnDenseMatrixH2Ln : invalid input matrix as DataArrayDouble ! Must be allocated with one component !");
468         MEDCouplingFieldDiscretizationKriging::OperateOnDenseMatrixH2Ln(myMatrix->getNumberOfTuples(),myMatrix->getPointer());
469       }
470     }
471   };
472 }