1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #include <numpy/arrayobject.h>
24 static PyObject *convertMesh(ParaMEDMEM::MEDCouplingMesh *mesh, int owner) throw(INTERP_KERNEL::Exception)
27 if(dynamic_cast<ParaMEDMEM::MEDCouplingUMesh *>(mesh))
28 ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,owner);
29 if(dynamic_cast<ParaMEDMEM::MEDCouplingExtrudedMesh *>(mesh))
30 ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingExtrudedMesh,owner);
31 if(dynamic_cast<ParaMEDMEM::MEDCouplingCMesh *>(mesh))
32 ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh,owner);
34 throw INTERP_KERNEL::Exception("Not recognized type of mesh on downcast !");
38 static PyObject *convertFieldDiscretization(ParaMEDMEM::MEDCouplingFieldDiscretization *fd, int owner) throw(INTERP_KERNEL::Exception)
41 if(dynamic_cast<ParaMEDMEM::MEDCouplingFieldDiscretizationP0 *>(fd))
42 ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDiscretizationP0,owner);
43 if(dynamic_cast<ParaMEDMEM::MEDCouplingFieldDiscretizationP1 *>(fd))
44 ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDiscretizationP1,owner);
45 if(dynamic_cast<ParaMEDMEM::MEDCouplingFieldDiscretizationGauss *>(fd))
46 ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDiscretizationGauss,owner);
47 if(dynamic_cast<ParaMEDMEM::MEDCouplingFieldDiscretizationGaussNE *>(fd))
48 ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDiscretizationGaussNE,owner);
49 if(dynamic_cast<ParaMEDMEM::MEDCouplingFieldDiscretizationKriging *>(fd))
50 ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDiscretizationKriging,owner);
52 throw INTERP_KERNEL::Exception("Not recognized type of field discretization on downcast !");
56 static PyObject* convertMultiFields(ParaMEDMEM::MEDCouplingMultiFields *mfs, int owner) throw(INTERP_KERNEL::Exception)
59 if(dynamic_cast<ParaMEDMEM::MEDCouplingFieldOverTime *>(mfs))
60 ret=SWIG_NewPointerObj((void*)mfs,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldOverTime,owner);
62 ret=SWIG_NewPointerObj((void*)mfs,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMultiFields,owner);
66 static PyObject *convertIntArrToPyList(const int *ptr, int size) throw(INTERP_KERNEL::Exception)
69 PyObject *ret=PyList_New(size);
70 for(int i=0;i<size;i++)
71 PyList_SetItem(ret,i,PyInt_FromLong(ptr[i]));
74 npy_intp dim = (npy_intp) size;
75 int *tmp=new int[size];
76 std::copy(ptr,ptr+size,tmp);
77 return PyArray_SimpleNewFromData(1,&dim,NPY_INT,const_cast<int *>(tmp));
81 static PyObject *convertIntArrToPyList2(const std::vector<int>& v) throw(INTERP_KERNEL::Exception)
85 PyObject *ret=PyList_New(size);
86 for(int i=0;i<size;i++)
87 PyList_SetItem(ret,i,PyInt_FromLong(v[i]));
90 npy_intp dim = (npy_intp) v.size();
91 int *tmp=new int[v.size()];
92 std::copy(v.begin(),v.end(),tmp);
93 return PyArray_SimpleNewFromData(1,&dim,NPY_INT,tmp);
97 static PyObject *convertIntArrToPyList3(const std::set<int>& v) throw(INTERP_KERNEL::Exception)
100 PyObject *ret=PyList_New(size);
101 std::set<int>::const_iterator it=v.begin();
102 for(int i=0;i<size;i++,it++)
103 PyList_SetItem(ret,i,PyInt_FromLong(*it));
107 static PyObject *convertIntArrToPyListOfTuple(const int *vals, int nbOfComp, int nbOfTuples) throw(INTERP_KERNEL::Exception)
109 PyObject *ret=PyList_New(nbOfTuples);
110 for(int i=0;i<nbOfTuples;i++)
112 PyObject *t=PyTuple_New(nbOfComp);
113 for(int j=0;j<nbOfComp;j++)
114 PyTuple_SetItem(t,j,PyInt_FromLong(vals[i*nbOfComp+j]));
115 PyList_SetItem(ret,i,t);
120 static int *convertPyToNewIntArr2(PyObject *pyLi, int *size) throw(INTERP_KERNEL::Exception)
122 if(PyList_Check(pyLi))
124 *size=PyList_Size(pyLi);
125 int *tmp=new int[*size];
126 for(int i=0;i<*size;i++)
128 PyObject *o=PyList_GetItem(pyLi,i);
131 int val=(int)PyInt_AS_LONG(o);
137 throw INTERP_KERNEL::Exception("list must contain integers only");
142 else if(PyTuple_Check(pyLi))
144 *size=PyTuple_Size(pyLi);
145 int *tmp=new int[*size];
146 for(int i=0;i<*size;i++)
148 PyObject *o=PyTuple_GetItem(pyLi,i);
151 int val=(int)PyInt_AS_LONG(o);
157 throw INTERP_KERNEL::Exception("tuple must contain integers only");
165 throw INTERP_KERNEL::Exception("convertPyToNewIntArr2 : not a list");
167 if(PyArray_Check(pyLi))
169 npy_intp mySize = PyArray_SIZE(pyLi);
170 int *ret=(int *)PyArray_BYTES(pyLi);
176 throw INTERP_KERNEL::Exception("convertPyToNewIntArr2 : not a list nor PyArray");
182 static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair<int,int> >& arr) throw(INTERP_KERNEL::Exception)
184 const char msg[]="list must contain tuples of 2 integers only or tuple must contain tuples of 2 integers only !";
185 if(PyList_Check(pyLi))
187 int size=PyList_Size(pyLi);
189 for(int i=0;i<size;i++)
191 PyObject *o=PyList_GetItem(pyLi,i);
194 int sz2=PyTuple_Size(o);
196 throw INTERP_KERNEL::Exception(msg);
197 PyObject *o_0=PyTuple_GetItem(o,0);
198 if(!PyInt_Check(o_0))
199 throw INTERP_KERNEL::Exception(msg);
200 PyObject *o_1=PyTuple_GetItem(o,1);
201 if(!PyInt_Check(o_1))
202 throw INTERP_KERNEL::Exception(msg);
203 arr[i].first=(int)PyInt_AS_LONG(o_0);
204 arr[i].second=(int)PyInt_AS_LONG(o_1);
207 throw INTERP_KERNEL::Exception(msg);
210 else if(PyTuple_Check(pyLi))
212 int size=PyTuple_Size(pyLi);
214 for(int i=0;i<size;i++)
216 PyObject *o=PyTuple_GetItem(pyLi,i);
219 int sz2=PyTuple_Size(o);
221 throw INTERP_KERNEL::Exception(msg);
222 PyObject *o_0=PyTuple_GetItem(o,0);
223 if(!PyInt_Check(o_0))
224 throw INTERP_KERNEL::Exception(msg);
225 PyObject *o_1=PyTuple_GetItem(o,1);
226 if(!PyInt_Check(o_1))
227 throw INTERP_KERNEL::Exception(msg);
228 arr[i].first=(int)PyInt_AS_LONG(o_0);
229 arr[i].second=(int)PyInt_AS_LONG(o_1);
232 throw INTERP_KERNEL::Exception(msg);
236 throw INTERP_KERNEL::Exception(msg);
239 static void convertPyToNewIntArr3(PyObject *pyLi, std::vector<int>& arr) throw(INTERP_KERNEL::Exception)
241 if(PyList_Check(pyLi))
243 int size=PyList_Size(pyLi);
245 for(int i=0;i<size;i++)
247 PyObject *o=PyList_GetItem(pyLi,i);
250 int val=(int)PyInt_AS_LONG(o);
254 throw INTERP_KERNEL::Exception("list must contain integers only");
257 else if(PyTuple_Check(pyLi))
259 int size=PyTuple_Size(pyLi);
261 for(int i=0;i<size;i++)
263 PyObject *o=PyTuple_GetItem(pyLi,i);
266 int val=(int)PyInt_AS_LONG(o);
270 throw INTERP_KERNEL::Exception("tuple must contain integers only");
276 throw INTERP_KERNEL::Exception("convertPyToNewIntArr3 : not a list nor a tuple");
278 if(PyArray_Check(pyLi))
280 npy_intp mySize = PyArray_SIZE(pyLi);
281 int *ret=(int *)PyArray_BYTES(pyLi);
283 std::copy(ret,ret+mySize,arr.begin());
287 throw INTERP_KERNEL::Exception("convertPyToNewIntArr3 : not a list nor a tuple nor PyArray");
292 static void convertPyToNewIntArr4(PyObject *pyLi, int recurseLev, int nbOfSubPart, std::vector<int>& arr) throw(INTERP_KERNEL::Exception)
295 throw INTERP_KERNEL::Exception("convertPyToNewIntArr4 : invalid list of integers level of recursion !");
297 if(PyList_Check(pyLi))
299 int size=PyList_Size(pyLi);
300 for(int i=0;i<size;i++)
302 PyObject *o=PyList_GetItem(pyLi,i);
305 int val=(int)PyInt_AS_LONG(o);
310 std::vector<int> arr2;
311 convertPyToNewIntArr4(o,recurseLev-1,nbOfSubPart,arr2);
312 if(nbOfSubPart>=1 && nbOfSubPart!=(int)arr2.size())
314 std::ostringstream oss; oss << "convertPyToNewIntArr4 : input list at lev " << recurseLev << " invalid nb of subpart elts expected " << nbOfSubPart << " having " << arr2.size() << " !";
315 throw INTERP_KERNEL::Exception(oss.str().c_str());
317 arr.insert(arr.end(),arr2.begin(),arr2.end());
321 else if(PyTuple_Check(pyLi))
323 int size=PyTuple_Size(pyLi);
324 for(int i=0;i<size;i++)
326 PyObject *o=PyTuple_GetItem(pyLi,i);
329 int val=(int)PyInt_AS_LONG(o);
334 std::vector<int> arr2;
335 convertPyToNewIntArr4(o,recurseLev-1,nbOfSubPart,arr2);
336 if(nbOfSubPart>=1 && nbOfSubPart!=(int)arr2.size())
338 std::ostringstream oss; oss << "convertPyToNewIntArr4 : input list at lev " << recurseLev << " invalid nb of subpart elts expected " << nbOfSubPart << " having " << arr2.size() << " !";
339 throw INTERP_KERNEL::Exception(oss.str().c_str());
341 arr.insert(arr.end(),arr2.begin(),arr2.end());
346 throw INTERP_KERNEL::Exception("convertPyToNewIntArr4 : not a list nor a tuple recursively !");
350 static void fillArrayWithPyListInt(PyObject *pyLi, int *arrToFill, int sizeOfArray, int dftVal, bool chckSize) throw(INTERP_KERNEL::Exception)
352 if(PyList_Check(pyLi))
354 int size=PyList_Size(pyLi);
356 if(size!=sizeOfArray)
358 std::ostringstream oss; oss << "fillArrayWithPyListInt : List expected to be of size " << sizeOfArray << " but the size is " << size << " !";
359 throw INTERP_KERNEL::Exception(oss.str().c_str());
361 for(int i=0;i<size;i++)
363 PyObject *o=PyList_GetItem(pyLi,i);
366 int val=(int)PyInt_AS_LONG(o);
371 throw INTERP_KERNEL::Exception("fillArrayWithPyListInt : List must contain integers only !");
373 for(int i=size;i<sizeOfArray;i++)
378 else if(PyTuple_Check(pyLi))
380 int size=PyTuple_Size(pyLi);
382 if(size!=sizeOfArray)
384 std::ostringstream oss; oss << "fillArrayWithPyListInt : Tuple expected to be of size " << sizeOfArray << " but the size is " << size << " !";
385 throw INTERP_KERNEL::Exception(oss.str().c_str());
387 for(int i=0;i<size;i++)
389 PyObject *o=PyTuple_GetItem(pyLi,i);
392 int val=(int)PyInt_AS_LONG(o);
397 throw INTERP_KERNEL::Exception("tuple must contain integers only");
399 for(int i=size;i<sizeOfArray;i++)
404 throw INTERP_KERNEL::Exception("fillArrayWithPyListInt : not a list");
407 static PyObject *convertDblArrToPyList(const double *ptr, int size) throw(INTERP_KERNEL::Exception)
409 PyObject *ret=PyList_New(size);
410 for(int i=0;i<size;i++)
411 PyList_SetItem(ret,i,PyFloat_FromDouble(ptr[i]));
415 static PyObject *convertDblArrToPyList2(const std::vector<double>& v) throw(INTERP_KERNEL::Exception)
418 PyObject *ret=PyList_New(size);
419 for(int i=0;i<size;i++)
420 PyList_SetItem(ret,i,PyFloat_FromDouble(v[i]));
424 static PyObject *convertDblArrToPyListOfTuple(const double *vals, int nbOfComp, int nbOfTuples) throw(INTERP_KERNEL::Exception)
426 PyObject *ret=PyList_New(nbOfTuples);
427 for(int i=0;i<nbOfTuples;i++)
429 PyObject *t=PyTuple_New(nbOfComp);
430 for(int j=0;j<nbOfComp;j++)
431 PyTuple_SetItem(t,j,PyFloat_FromDouble(vals[i*nbOfComp+j]));
432 PyList_SetItem(ret,i,t);
437 static double *convertPyToNewDblArr2(PyObject *pyLi, int *size) throw(INTERP_KERNEL::Exception)
439 if(PyList_Check(pyLi))
441 *size=PyList_Size(pyLi);
442 double *tmp=new double[*size];
443 for(int i=0;i<*size;i++)
445 PyObject *o=PyList_GetItem(pyLi,i);
448 double val=PyFloat_AS_DOUBLE(o);
451 else if(PyInt_Check(o))
453 long val0=PyInt_AS_LONG(o);
460 throw INTERP_KERNEL::Exception("convertPyToNewDblArr2 : list must contain floats/integers only");
465 else if(PyTuple_Check(pyLi))
467 *size=PyTuple_Size(pyLi);
468 double *tmp=new double[*size];
469 for(int i=0;i<*size;i++)
471 PyObject *o=PyTuple_GetItem(pyLi,i);
474 double val=PyFloat_AS_DOUBLE(o);
477 else if(PyInt_Check(o))
479 long val0=PyInt_AS_LONG(o);
486 throw INTERP_KERNEL::Exception("convertPyToNewDblArr2 : tuple must contain floats/integers only");
492 throw INTERP_KERNEL::Exception("convertPyToNewDblArr2 : not a list");
495 static void fillArrayWithPyListDbl(PyObject *pyLi, double *arrToFill, int sizeOfArray, double dftVal, bool chckSize) throw(INTERP_KERNEL::Exception)
497 if(PyList_Check(pyLi))
499 int size=PyList_Size(pyLi);
501 if(size!=sizeOfArray)
503 std::ostringstream oss; oss << "fillArrayWithPyListDbl : List expected to be of size " << sizeOfArray << " but the size is " << size << " !";
504 throw INTERP_KERNEL::Exception(oss.str().c_str());
506 for(int i=0;i<size;i++)
508 PyObject *o=PyList_GetItem(pyLi,i);
511 double val=PyFloat_AS_DOUBLE(o);
515 else if(PyInt_Check(o))
517 long val0=PyInt_AS_LONG(o);
523 throw INTERP_KERNEL::Exception("fillArrayWithPyListDbl : list must contain floats/integers only");
525 for(int i=size;i<sizeOfArray;i++)
529 else if(PyTuple_Check(pyLi))
531 int size=PyTuple_Size(pyLi);
533 if(size!=sizeOfArray)
535 std::ostringstream oss; oss << "fillArrayWithPyListDbl : Tuple expected to be of size " << sizeOfArray << " but the size is " << size << " !";
536 throw INTERP_KERNEL::Exception(oss.str().c_str());
538 for(int i=0;i<size;i++)
540 PyObject *o=PyTuple_GetItem(pyLi,i);
543 double val=PyFloat_AS_DOUBLE(o);
546 else if(PyInt_Check(o))
548 long val0=PyInt_AS_LONG(o);
553 throw INTERP_KERNEL::Exception("fillArrayWithPyListDbl : tuple must contain floats/integers only");
555 for(int i=size;i<sizeOfArray;i++)
560 throw INTERP_KERNEL::Exception("convertPyToNewIntArr : not a list");
563 //convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(pyLi,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh")
565 static void convertFromPyObjVectorOfObj(PyObject *pyLi, swig_type_info *ty, const char *typeStr, typename std::vector<T>& ret)
568 if(PyList_Check(pyLi))
570 int size=PyList_Size(pyLi);
572 for(int i=0;i<size;i++)
574 PyObject *obj=PyList_GetItem(pyLi,i);
575 int status=SWIG_ConvertPtr(obj,&argp,ty,0|0);
576 if(!SWIG_IsOK(status))
577 throw INTERP_KERNEL::Exception("list must contain only MEDCouplingUMesh");
578 T arg=reinterpret_cast< T >(argp);
582 else if(PyTuple_Check(pyLi))
584 int size=PyTuple_Size(pyLi);
586 for(int i=0;i<size;i++)
588 PyObject *obj=PyTuple_GetItem(pyLi,i);
590 int status=SWIG_ConvertPtr(obj,&argp,ty,0|0);
591 if(!SWIG_IsOK(status))
593 std::ostringstream oss; oss << "tuple must contain only " << typeStr;
594 throw INTERP_KERNEL::Exception(oss.str().c_str());
596 T arg=reinterpret_cast< T >(argp);
600 else if(SWIG_IsOK(SWIG_ConvertPtr(pyLi,&argp,ty,0|0)))
603 T arg=reinterpret_cast< T >(argp);
607 throw INTERP_KERNEL::Exception("convertFromPyObjVectorOfObj : not a list nor a tuple");
611 * if python int -> cpp int sw=1
612 * if python list[int] -> cpp vector<int> sw=2
613 * if python tuple[int] -> cpp vector<int> sw=2
614 * if python DataArrayInt -> cpp DataArrayInt sw=3
615 * if python DataArrayIntTuple -> cpp DataArrayIntTuple sw=4
617 * switch between (int,vector<int>,DataArrayInt)
619 static void convertObjToPossibleCpp1(PyObject *value, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, ParaMEDMEM::DataArrayInt *& daIntTyypp, ParaMEDMEM::DataArrayIntTuple *&daIntTuple) throw(INTERP_KERNEL::Exception)
622 if(PyInt_Check(value))
624 iTyypp=(int)PyInt_AS_LONG(value);
628 if(PyTuple_Check(value))
630 int size=PyTuple_Size(value);
631 stdvecTyypp.resize(size);
632 for(int i=0;i<size;i++)
634 PyObject *o=PyTuple_GetItem(value,i);
636 stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
639 std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
640 throw INTERP_KERNEL::Exception(oss.str().c_str());
646 if(PyList_Check(value))
648 int size=PyList_Size(value);
649 stdvecTyypp.resize(size);
650 for(int i=0;i<size;i++)
652 PyObject *o=PyList_GetItem(value,i);
654 stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
657 std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
658 throw INTERP_KERNEL::Exception(oss.str().c_str());
665 int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
666 if(SWIG_IsOK(status))
668 daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
672 status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,0|0);
673 if(SWIG_IsOK(status))
675 daIntTuple=reinterpret_cast< ParaMEDMEM::DataArrayIntTuple * >(argp);
679 throw INTERP_KERNEL::Exception("5 types accepted : integer, tuple of integer, list of integer, DataArrayInt, DataArrayIntTuple");
683 * if python double -> cpp double sw=1
684 * if python int -> cpp double sw=1
685 * if python list[double] -> cpp vector<double> sw=2
686 * if python list[int] -> cpp vector<double> sw=2
687 * if python tuple[double] -> cpp vector<double> sw=2
688 * if python tuple[int] -> cpp vector<double> sw=2
689 * if python DataArrayDouble -> cpp DataArrayDouble sw=3
691 * switch between (int,vector<int>,DataArrayInt)
693 static void convertObjToPossibleCpp4(PyObject *value, int& sw, double& iTyypp, std::vector<double>& stdvecTyypp, ParaMEDMEM::DataArrayDouble *& daIntTyypp) throw(INTERP_KERNEL::Exception)
696 if(PyFloat_Check(value))
698 iTyypp=PyFloat_AS_DOUBLE(value);
702 if(PyInt_Check(value))
704 iTyypp=(double)PyInt_AS_LONG(value);
708 if(PyTuple_Check(value))
710 int size=PyTuple_Size(value);
711 stdvecTyypp.resize(size);
712 for(int i=0;i<size;i++)
714 PyObject *o=PyTuple_GetItem(value,i);
716 stdvecTyypp[i]=PyFloat_AS_DOUBLE(o);
717 else if(PyInt_Check(o))
718 stdvecTyypp[i]=(double)PyInt_AS_LONG(o);
721 std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
722 throw INTERP_KERNEL::Exception(oss.str().c_str());
728 if(PyList_Check(value))
730 int size=PyList_Size(value);
731 stdvecTyypp.resize(size);
732 for(int i=0;i<size;i++)
734 PyObject *o=PyList_GetItem(value,i);
736 stdvecTyypp[i]=PyFloat_AS_DOUBLE(o);
737 else if(PyInt_Check(o))
738 stdvecTyypp[i]=(double)PyInt_AS_LONG(o);
741 std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
742 throw INTERP_KERNEL::Exception(oss.str().c_str());
749 int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
750 if(!SWIG_IsOK(status))
751 throw INTERP_KERNEL::Exception("5 types accepted : double float, integer, tuple of double float or int, list of double float or int, DataArrayDouble");
752 daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp);
757 * if python double -> cpp double sw=1
758 * if python int -> cpp double sw=1
759 * if python list[double] -> cpp vector<double> sw=2
760 * if python list[int] -> cpp vector<double> sw=2
761 * if python tuple[double] -> cpp vector<double> sw=2
762 * if python tuple[int] -> cpp vector<double> sw=2
763 * if python DataArrayDoubleTuple -> cpp DataArrayDoubleTuple sw=3
765 * switch between (int,vector<int>,DataArrayInt)
767 static void convertObjToPossibleCpp44(PyObject *value, int& sw, double& iTyypp, std::vector<double>& stdvecTyypp, ParaMEDMEM::DataArrayDoubleTuple *& daIntTyypp) throw(INTERP_KERNEL::Exception)
770 if(PyFloat_Check(value))
772 iTyypp=PyFloat_AS_DOUBLE(value);
776 if(PyInt_Check(value))
778 iTyypp=(double)PyInt_AS_LONG(value);
782 if(PyTuple_Check(value))
784 int size=PyTuple_Size(value);
785 stdvecTyypp.resize(size);
786 for(int i=0;i<size;i++)
788 PyObject *o=PyTuple_GetItem(value,i);
790 stdvecTyypp[i]=PyFloat_AS_DOUBLE(o);
791 else if(PyInt_Check(o))
792 stdvecTyypp[i]=(double)PyInt_AS_LONG(o);
795 std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
796 throw INTERP_KERNEL::Exception(oss.str().c_str());
802 if(PyList_Check(value))
804 int size=PyList_Size(value);
805 stdvecTyypp.resize(size);
806 for(int i=0;i<size;i++)
808 PyObject *o=PyList_GetItem(value,i);
810 stdvecTyypp[i]=PyFloat_AS_DOUBLE(o);
811 else if(PyInt_Check(o))
812 stdvecTyypp[i]=(double)PyInt_AS_LONG(o);
815 std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
816 throw INTERP_KERNEL::Exception(oss.str().c_str());
823 int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0);
824 if(!SWIG_IsOK(status))
825 throw INTERP_KERNEL::Exception("5 types accepted : double float, integer, tuple of double float or int, list of double float or int, DataArrayDoubleTuple");
826 daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp);
831 * if python int -> cpp int sw=1
832 * if python list[int] -> cpp vector<int> sw=2
833 * if python tuple[int] -> cpp vector<int> sw=2
834 * if python slicp -> cpp pair sw=3
835 * if python DataArrayInt -> cpp DataArrayInt sw=4
837 * switch between (int,vector<int>,DataArrayInt)
839 static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, ParaMEDMEM::DataArrayInt *& daIntTyypp) throw(INTERP_KERNEL::Exception)
841 const char *msg="5 types accepted : integer, tuple of integer, list of integer, slice, DataArrayInt, DataArrayIntTuple";
843 if(PyInt_Check(value))
845 iTyypp=(int)PyInt_AS_LONG(value);
849 if(PyTuple_Check(value))
851 int size=PyTuple_Size(value);
852 stdvecTyypp.resize(size);
853 for(int i=0;i<size;i++)
855 PyObject *o=PyTuple_GetItem(value,i);
857 stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
860 std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
861 throw INTERP_KERNEL::Exception(oss.str().c_str());
867 if(PyList_Check(value))
869 int size=PyList_Size(value);
870 stdvecTyypp.resize(size);
871 for(int i=0;i<size;i++)
873 PyObject *o=PyList_GetItem(value,i);
875 stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
878 std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
879 throw INTERP_KERNEL::Exception(oss.str().c_str());
885 if(PySlice_Check(value))
887 Py_ssize_t strt,stp,step;
888 PySliceObject *oC=reinterpret_cast<PySliceObject *>(value);
889 if(PySlice_GetIndices(oC,nbelem,&strt,&stp,&step)!=0)
891 std::ostringstream oss; oss << "Slice in subscriptable object DataArray invalid : number of elemnts is : " << nbelem;
892 throw INTERP_KERNEL::Exception(oss.str().c_str());
896 p.second.second=step;
901 int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
902 if(SWIG_IsOK(status))
904 daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
907 std::ostringstream oss; oss << msg << " Instance in null !";
908 throw INTERP_KERNEL::Exception(oss.str().c_str());
913 status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,0|0);;
914 if(SWIG_IsOK(status))
916 ParaMEDMEM::DataArrayIntTuple *tmp=reinterpret_cast< ParaMEDMEM::DataArrayIntTuple * >(argp);
919 std::ostringstream oss; oss << msg << " Instance in null !";
920 throw INTERP_KERNEL::Exception(oss.str().c_str());
922 stdvecTyypp.resize(tmp->getNumberOfCompo());
923 std::copy(tmp->getConstPointer(),tmp->getConstPointer()+tmp->getNumberOfCompo(),stdvecTyypp.begin());
927 throw INTERP_KERNEL::Exception(msg);
930 static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, ParaMEDMEM::DataArrayIntTuple *& daIntTyypp) throw(INTERP_KERNEL::Exception)
933 if(PyInt_Check(value))
935 iTyypp=(int)PyInt_AS_LONG(value);
939 if(PyTuple_Check(value))
941 int size=PyTuple_Size(value);
942 stdvecTyypp.resize(size);
943 for(int i=0;i<size;i++)
945 PyObject *o=PyTuple_GetItem(value,i);
947 stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
950 std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
951 throw INTERP_KERNEL::Exception(oss.str().c_str());
957 if(PyList_Check(value))
959 int size=PyList_Size(value);
960 stdvecTyypp.resize(size);
961 for(int i=0;i<size;i++)
963 PyObject *o=PyList_GetItem(value,i);
965 stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
968 std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
969 throw INTERP_KERNEL::Exception(oss.str().c_str());
975 if(PySlice_Check(value))
977 Py_ssize_t strt,stp,step;
978 PySliceObject *oC=reinterpret_cast<PySliceObject *>(value);
979 if(PySlice_GetIndices(oC,nbelem,&strt,&stp,&step)!=0)
981 std::ostringstream oss; oss << "Slice in subscriptable object DataArray invalid : number of elemnts is : " << nbelem;
982 throw INTERP_KERNEL::Exception(oss.str().c_str());
986 p.second.second=step;
991 int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,0|0);
992 if(!SWIG_IsOK(status))
993 throw INTERP_KERNEL::Exception("4 types accepted : integer, tuple of integer, list of integer, slice, DataArrayIntTuple");
994 daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayIntTuple * >(argp);
999 * if value int -> cpp it sw=1
1000 * if value list[int] -> vt sw=2
1001 * if value tuple[int] -> vt sw=2
1002 * if value slice -> pt sw=3
1003 * if value DataArrayInt -> dt sw=4
1004 * if value tuple [int,int] -> cpp it,ip sw=5
1005 * if value tuple [list[int],int] -> cpp vt,ip sw=6
1006 * if value tuple [tuple[int],int] -> cpp vt,ip sw=6
1007 * if value tuple [slice,int] -> cpp pt,ip sw=7
1008 * if value tuple [DaI,int] -> cpp dt,ip sw=8
1009 * if value tuple [int,list[int]] -> cpp it,vc sw=9
1010 * if value tuple [list[int],list[int]] -> cpp vt,vc sw=10
1011 * if value tuple [tuple[int],list[int]] -> cpp vt,vc sw=10
1012 * if value tuple [slice,list[int]] -> cpp pt,vc sw=11
1013 * if value tuple [DaI,list[int]] -> cpp dt,vc sw=12
1014 * if value tuple [int,tuple[int]] -> cpp it,vc sw=9
1015 * if value tuple [list[int],tuple[int]] -> cpp vt,vc sw=10
1016 * if value tuple [tuple[int],tuple[int]] -> cpp vt,vc sw=10
1017 * if value tuple [slice,tuple[int]] -> cpp pt,vc sw=11
1018 * if value tuple [DaI,tuple[int]] -> cpp dt,vc sw=12
1019 * if value tuple [int,slice] -> cpp it,pc sw=13
1020 * if value tuple [list[int],slice] -> cpp vt,pc sw=14
1021 * if value tuple [tuple[int],slice] -> cpp vt,pc sw=14
1022 * if value tuple [slice,slice] -> cpp pt,pc sw=15
1023 * if value tuple [DaI,slice] -> cpp dt,pc sw=16
1025 * switch between (int,vector<int>,DataArrayInt)
1027 static void convertObjToPossibleCpp3(PyObject *value, int nbTuple, int nbCompo, int& sw, int& it, int& ic, std::vector<int>& vt, std::vector<int>& vc,
1028 std::pair<int, std::pair<int,int> >& pt, std::pair<int, std::pair<int,int> >& pc,
1029 ParaMEDMEM::DataArrayInt *&dt, ParaMEDMEM::DataArrayInt *&dc) throw(INTERP_KERNEL::Exception)
1031 if(!PyTuple_Check(value))
1033 convertObjToPossibleCpp2(value,nbTuple,sw,it,vt,pt,dt);
1038 int sz=PyTuple_Size(value);
1040 throw INTERP_KERNEL::Exception("Unexpected nb of slice element : 1 or 2 expected !\n1st is for tuple selection, 2nd for component selection !");
1041 PyObject *ob0=PyTuple_GetItem(value,0);
1043 convertObjToPossibleCpp2(ob0,nbTuple,sw1,it,vt,pt,dt);
1044 PyObject *ob1=PyTuple_GetItem(value,1);
1045 convertObjToPossibleCpp2(ob1,nbCompo,sw2,ic,vc,pc,dc);
1051 * if value int -> cpp val sw=1
1052 * if value double -> cpp val sw=1
1053 * if value DataArrayDouble -> cpp DataArrayDouble sw=2
1054 * if value DataArrayDoubleTuple -> cpp DataArrayDoubleTuple sw=3
1055 * if value list[int,double] -> cpp std::vector<double> sw=4
1056 * if value tuple[int,double] -> cpp std::vector<double> sw=4
1058 static void convertObjToPossibleCpp5(PyObject *value, int& sw, double& val, ParaMEDMEM::DataArrayDouble *&d, ParaMEDMEM::DataArrayDoubleTuple *&e, std::vector<double>& f)
1061 if(PyFloat_Check(value))
1063 val=PyFloat_AS_DOUBLE(value);
1067 if(PyInt_Check(value))
1069 val=(double)PyInt_AS_LONG(value);
1073 if(PyTuple_Check(value))
1075 int size=PyTuple_Size(value);
1077 for(int i=0;i<size;i++)
1079 PyObject *o=PyTuple_GetItem(value,i);
1080 if(PyFloat_Check(o))
1081 f[i]=PyFloat_AS_DOUBLE(o);
1082 else if(PyInt_Check(o))
1083 f[i]=(double)PyInt_AS_LONG(o);
1086 std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
1087 throw INTERP_KERNEL::Exception(oss.str().c_str());
1093 if(PyList_Check(value))
1095 int size=PyList_Size(value);
1097 for(int i=0;i<size;i++)
1099 PyObject *o=PyList_GetItem(value,i);
1100 if(PyFloat_Check(o))
1101 f[i]=PyFloat_AS_DOUBLE(o);
1102 else if(PyInt_Check(o))
1103 f[i]=(double)PyInt_AS_LONG(o);
1106 std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
1107 throw INTERP_KERNEL::Exception(oss.str().c_str());
1114 int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
1115 if(SWIG_IsOK(status))
1117 d=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp);
1121 status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0);
1122 if(SWIG_IsOK(status))
1124 e=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp);
1128 throw INTERP_KERNEL::Exception("4 types accepted : integer, double, DataArrayDouble, DataArrayDoubleTuple");
1132 * if value int -> cpp val sw=1
1133 * if value double -> cpp val sw=1
1134 * if value DataArrayDouble -> cpp DataArrayDouble sw=2
1135 * if value DataArrayDoubleTuple -> cpp DataArrayDoubleTuple sw=3
1136 * if value list[int,double] -> cpp std::vector<double> sw=4
1137 * if value tuple[int,double] -> cpp std::vector<double> sw=4
1139 static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, double& val, ParaMEDMEM::DataArrayDouble *&d, ParaMEDMEM::DataArrayDoubleTuple *&e, std::vector<double>& f,
1140 const char *msg, int nbTuplesExpected, int nbCompExpected, bool throwIfNullPt) throw(INTERP_KERNEL::Exception)
1143 if(PyFloat_Check(value))
1145 val=PyFloat_AS_DOUBLE(value);
1147 if(nbTuplesExpected*nbCompExpected!=1)
1149 std::ostringstream oss; oss << msg << "dimension expected to be " << nbTuplesExpected*nbCompExpected << " , and your data in input has dimension one (single PyFloat) !";
1150 throw INTERP_KERNEL::Exception(oss.str().c_str());
1154 if(PyInt_Check(value))
1156 val=(double)PyInt_AS_LONG(value);
1158 if(nbTuplesExpected*nbCompExpected!=1)
1160 std::ostringstream oss; oss << msg << "dimension expected to be " << nbTuplesExpected*nbCompExpected << " , and your data in input has dimension one (single PyInt) !";
1161 throw INTERP_KERNEL::Exception(oss.str().c_str());
1165 if(PyTuple_Check(value))
1167 int size=PyTuple_Size(value);
1169 for(int i=0;i<size;i++)
1171 PyObject *o=PyTuple_GetItem(value,i);
1172 if(PyFloat_Check(o))
1173 f[i]=PyFloat_AS_DOUBLE(o);
1174 else if(PyInt_Check(o))
1175 f[i]=(double)PyInt_AS_LONG(o);
1178 std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
1179 throw INTERP_KERNEL::Exception(oss.str().c_str());
1183 if(nbTuplesExpected*nbCompExpected!=(int)f.size())
1185 std::ostringstream oss; oss << msg << "dimension expected to be " << nbTuplesExpected*nbCompExpected << " , and your data in input has dimension " << f.size() << " !";
1186 throw INTERP_KERNEL::Exception(oss.str().c_str());
1190 if(PyList_Check(value))
1192 int size=PyList_Size(value);
1194 for(int i=0;i<size;i++)
1196 PyObject *o=PyList_GetItem(value,i);
1197 if(PyFloat_Check(o))
1198 f[i]=PyFloat_AS_DOUBLE(o);
1199 else if(PyInt_Check(o))
1200 f[i]=(double)PyInt_AS_LONG(o);
1203 std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
1204 throw INTERP_KERNEL::Exception(oss.str().c_str());
1208 if(nbTuplesExpected*nbCompExpected!=(int)f.size())
1210 std::ostringstream oss; oss << msg << "dimension expected to be " << nbTuplesExpected*nbCompExpected << " , and your data in input has dimension " << f.size() << " !";
1211 throw INTERP_KERNEL::Exception(oss.str().c_str());
1216 int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
1217 if(SWIG_IsOK(status))
1219 d=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp);
1223 if(d->getNumberOfTuples()==nbTuplesExpected)
1225 if(d->getNumberOfComponents()==nbCompExpected)
1227 return d->getConstPointer();
1231 std::ostringstream oss; oss << msg << "nb of components expected to be " << nbCompExpected << " , and input has " << d->getNumberOfComponents() << " components !";
1232 throw INTERP_KERNEL::Exception(oss.str().c_str());
1237 std::ostringstream oss; oss << msg << " input DataArrayDouble should have a number of tuples equal to " << nbTuplesExpected << " and there are " << d->getNumberOfTuples() << " tuples !";
1238 throw INTERP_KERNEL::Exception(oss.str().c_str());
1245 std::ostringstream oss; oss << msg << " null pointer not accepted!";
1246 throw INTERP_KERNEL::Exception(oss.str().c_str());
1252 status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0);
1253 if(SWIG_IsOK(status))
1255 e=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp);
1257 if(e->getNumberOfCompo()==nbCompExpected)
1259 if(nbTuplesExpected==1)
1260 return e->getConstPointer();
1263 std::ostringstream oss; oss << msg << "nb of tuples expected to be " << nbTuplesExpected << " , and input DataArrayDoubleTuple has always one tuple by contruction !";
1264 throw INTERP_KERNEL::Exception(oss.str().c_str());
1269 std::ostringstream oss; oss << msg << "nb of components expected to be " << nbCompExpected << " , and input DataArrayDoubleTuple has " << e->getNumberOfCompo() << " components !";
1270 throw INTERP_KERNEL::Exception(oss.str().c_str());
1273 throw INTERP_KERNEL::Exception("4 types accepted : integer, double, DataArrayDouble, DataArrayDoubleTuple");
1277 * if value int -> cpp val sw=1
1278 * if value double -> cpp val sw=1
1279 * if value DataArrayDouble -> cpp DataArrayDouble sw=2
1280 * if value DataArrayDoubleTuple -> cpp DataArrayDoubleTuple sw=3
1281 * if value list[int,double] -> cpp std::vector<double> sw=4
1282 * if value tuple[int,double] -> cpp std::vector<double> sw=4
1284 static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, double& val, ParaMEDMEM::DataArrayDouble *&d, ParaMEDMEM::DataArrayDoubleTuple *&e, std::vector<double>& f,
1285 const char *msg, int nbCompExpected, bool throwIfNullPt, int& nbTuples) throw(INTERP_KERNEL::Exception)
1288 if(PyFloat_Check(value))
1290 val=PyFloat_AS_DOUBLE(value);
1292 if(nbCompExpected!=1)
1294 std::ostringstream oss; oss << msg << "dimension expected to be " << nbCompExpected << " , and your data in input has dimension one (single PyFloat) !";
1295 throw INTERP_KERNEL::Exception(oss.str().c_str());
1300 if(PyInt_Check(value))
1302 val=(double)PyInt_AS_LONG(value);
1304 if(nbCompExpected!=1)
1306 std::ostringstream oss; oss << msg << "dimension expected to be " << nbCompExpected << " , and your data in input has dimension one (single PyInt) !";
1307 throw INTERP_KERNEL::Exception(oss.str().c_str());
1312 if(PyTuple_Check(value))
1314 int size=PyTuple_Size(value);
1316 for(int i=0;i<size;i++)
1318 PyObject *o=PyTuple_GetItem(value,i);
1319 if(PyFloat_Check(o))
1320 f[i]=PyFloat_AS_DOUBLE(o);
1321 else if(PyInt_Check(o))
1322 f[i]=(double)PyInt_AS_LONG(o);
1325 std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
1326 throw INTERP_KERNEL::Exception(oss.str().c_str());
1330 if(size%nbCompExpected!=0)
1332 std::ostringstream oss; oss << msg << "dimension expected to be a multiple of " << nbCompExpected << " , and your data in input has dimension " << f.size() << " !";
1333 throw INTERP_KERNEL::Exception(oss.str().c_str());
1335 nbTuples=size/nbCompExpected;
1338 if(PyList_Check(value))
1340 int size=PyList_Size(value);
1342 for(int i=0;i<size;i++)
1344 PyObject *o=PyList_GetItem(value,i);
1345 if(PyFloat_Check(o))
1346 f[i]=PyFloat_AS_DOUBLE(o);
1347 else if(PyInt_Check(o))
1348 f[i]=(double)PyInt_AS_LONG(o);
1351 std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
1352 throw INTERP_KERNEL::Exception(oss.str().c_str());
1356 if(size%nbCompExpected!=0)
1358 std::ostringstream oss; oss << msg << "dimension expected to be a multiple of " << nbCompExpected << " , and your data in input has dimension " << f.size() << " !";
1359 throw INTERP_KERNEL::Exception(oss.str().c_str());
1361 nbTuples=size/nbCompExpected;
1365 int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
1366 if(SWIG_IsOK(status))
1368 d=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp);
1372 if(d->getNumberOfComponents()==nbCompExpected)
1374 nbTuples=d->getNumberOfTuples();
1375 return d->getConstPointer();
1379 std::ostringstream oss; oss << msg << "nb of components expected to be a multiple of " << nbCompExpected << " , and input has " << d->getNumberOfComponents() << " components !";
1380 throw INTERP_KERNEL::Exception(oss.str().c_str());
1387 std::ostringstream oss; oss << msg << " null pointer not accepted!";
1388 throw INTERP_KERNEL::Exception(oss.str().c_str());
1394 status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0);
1395 if(SWIG_IsOK(status))
1397 e=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp);
1399 if(e->getNumberOfCompo()==nbCompExpected)
1402 return e->getConstPointer();
1406 std::ostringstream oss; oss << msg << "nb of components expected to be " << nbCompExpected << " , and input DataArrayDoubleTuple has " << e->getNumberOfCompo() << " components !";
1407 throw INTERP_KERNEL::Exception(oss.str().c_str());
1410 throw INTERP_KERNEL::Exception("4 types accepted : integer, double, DataArrayDouble, DataArrayDoubleTuple");