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
19 // Author : Anthony Geay (CEA/DEN)
21 %module MEDCouplingClient
24 #include "MEDCouplingFieldDoubleClient.hxx"
25 #include "MEDCouplingFieldTemplateClient.hxx"
26 #include "MEDCouplingMultiFieldsClient.hxx"
27 #include "MEDCouplingFieldOverTimeClient.hxx"
28 #include "MEDCouplingUMeshClient.hxx"
29 #include "MEDCouplingExtrudedMeshClient.hxx"
30 #include "MEDCouplingCMeshClient.hxx"
31 #include "DataArrayDoubleClient.hxx"
32 #include "DataArrayIntClient.hxx"
36 using namespace ParaMEDMEM;
39 %include "MEDCouplingCommon.i"
41 %newobject ParaMEDMEM::MEDCouplingFieldDoubleClient::New;
42 %newobject ParaMEDMEM::MEDCouplingFieldTemplateClient::New;
43 %newobject ParaMEDMEM::MEDCouplingUMeshClient::New;
44 %newobject ParaMEDMEM::MEDCouplingExtrudedMeshClient::New;
45 %newobject ParaMEDMEM::MEDCouplingCMeshClient::New;
46 %newobject ParaMEDMEM::MEDCouplingMultiFieldsClient::New;
47 %newobject ParaMEDMEM::MEDCouplingFieldOverTimeClient::New;
48 %newobject ParaMEDMEM::DataArrayDoubleClient::New;
49 %newobject ParaMEDMEM::DataArrayIntClient::New;
56 class MEDCouplingFieldDoubleClient
61 static MEDCouplingFieldDouble *New(PyObject *fieldPtr) throw(INTERP_KERNEL::Exception)
63 PyObject* pdict=PyDict_New();
64 PyDict_SetItemString(pdict,"__builtins__",PyEval_GetBuiltins());
65 PyRun_String("import MEDCouplingCorbaServant_idl",Py_single_input,pdict, pdict);
66 PyRun_String("import CORBA",Py_single_input,pdict, pdict);
67 PyRun_String("orbTmp15634=CORBA.ORB_init([''])", Py_single_input,pdict, pdict);
68 PyObject *orbPython=PyDict_GetItemString(pdict,"orbTmp15634");
69 // Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string
70 PyObject *iorField=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",fieldPtr);
72 throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingFieldDoubleClient.New appears to differ from CORBA reference ! Expecting a FieldDouble CORBA reference !");
73 char *ior=PyString_AsString(iorField);
75 CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
76 CORBA::Object_var fieldPtrCpp=orb->string_to_object(ior);
77 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_var fieldPtrCppC=SALOME_MED::MEDCouplingFieldDoubleCorbaInterface::_narrow(fieldPtrCpp);
78 if(CORBA::is_nil(fieldPtrCppC))
79 throw INTERP_KERNEL::Exception("error corba pointer is not a SALOME_MED.MEDCouplingFieldDoubleCorbaInterface_ptr !");
82 MEDCouplingFieldDouble *ret=MEDCouplingFieldDoubleClient::New(fieldPtrCppC);
88 class MEDCouplingFieldTemplateClient
93 static MEDCouplingFieldTemplate *New(PyObject *fieldPtr) throw(INTERP_KERNEL::Exception)
95 PyObject* pdict=PyDict_New();
96 PyDict_SetItemString(pdict,"__builtins__",PyEval_GetBuiltins());
97 PyRun_String("import MEDCouplingCorbaServant_idl",Py_single_input,pdict, pdict);
98 PyRun_String("import CORBA",Py_single_input,pdict, pdict);
99 PyRun_String("orbTmp15634=CORBA.ORB_init([''])", Py_single_input,pdict, pdict);
100 PyObject *orbPython=PyDict_GetItemString(pdict,"orbTmp15634");
101 // Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string
102 PyObject *iorField=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",fieldPtr);
104 throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingFieldTemplateClient.New appears to differ from CORBA reference ! Expecting a FieldTemplate CORBA reference !");
105 char *ior=PyString_AsString(iorField);
107 CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
108 CORBA::Object_var fieldPtrCpp=orb->string_to_object(ior);
109 SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_var fieldPtrCppC=SALOME_MED::MEDCouplingFieldTemplateCorbaInterface::_narrow(fieldPtrCpp);
110 if(CORBA::is_nil(fieldPtrCppC))
111 throw INTERP_KERNEL::Exception("error corba pointer is not a SALOME_MED.MEDCouplingFieldTemplateCorbaInterface_ptr !");
114 MEDCouplingFieldTemplate *ret=MEDCouplingFieldTemplateClient::New(fieldPtrCppC);
120 class MEDCouplingMultiFieldsClient
125 static MEDCouplingMultiFields *New(PyObject *fieldPtr) throw(INTERP_KERNEL::Exception)
127 PyObject* pdict=PyDict_New();
128 PyDict_SetItemString(pdict,"__builtins__",PyEval_GetBuiltins());
129 PyRun_String("import MEDCouplingCorbaServant_idl",Py_single_input,pdict, pdict);
130 PyRun_String("import CORBA",Py_single_input,pdict, pdict);
131 PyRun_String("orbTmp15634=CORBA.ORB_init([''])", Py_single_input,pdict, pdict);
132 PyObject *orbPython=PyDict_GetItemString(pdict,"orbTmp15634");
133 // Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string
134 PyObject *iorField=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",fieldPtr);
136 throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingFieldTemplateClient.New appears to differ from CORBA reference ! Expecting a MultiFields CORBA reference !");
137 char *ior=PyString_AsString(iorField);
139 CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
140 CORBA::Object_var fieldPtrCpp=orb->string_to_object(ior);
141 SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_var fieldPtrCppC=SALOME_MED::MEDCouplingMultiFieldsCorbaInterface::_narrow(fieldPtrCpp);
142 if(CORBA::is_nil(fieldPtrCppC))
143 throw INTERP_KERNEL::Exception("error corba pointer is not a SALOME_MED.MEDCouplingMultiFieldsCorbaInterface_ptr !");
146 MEDCouplingMultiFields *ret=MEDCouplingMultiFieldsClient::New(fieldPtrCppC);
152 class MEDCouplingFieldOverTimeClient : public MEDCouplingFieldOverTime
155 std::vector<double> getTimeSteps() const;
158 static MEDCouplingFieldOverTimeClient *New(PyObject *fieldPtr) throw(INTERP_KERNEL::Exception)
160 PyObject* pdict=PyDict_New();
161 PyDict_SetItemString(pdict,"__builtins__",PyEval_GetBuiltins());
162 PyRun_String("import MEDCouplingCorbaServant_idl",Py_single_input,pdict, pdict);
163 PyRun_String("import CORBA",Py_single_input,pdict, pdict);
164 PyRun_String("orbTmp15634=CORBA.ORB_init([''])", Py_single_input,pdict, pdict);
165 PyObject *orbPython=PyDict_GetItemString(pdict,"orbTmp15634");
166 // Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string
167 PyObject *iorField=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",fieldPtr);
169 throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingFieldOverTimeClient.New appears to differ from CORBA reference ! Expecting a FieldOverTime CORBA reference !");
170 char *ior=PyString_AsString(iorField);
172 CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
173 CORBA::Object_var fieldPtrCpp=orb->string_to_object(ior);
174 SALOME_MED::MEDCouplingFieldOverTimeCorbaInterface_var fieldPtrCppC=SALOME_MED::MEDCouplingFieldOverTimeCorbaInterface::_narrow(fieldPtrCpp);
175 if(CORBA::is_nil(fieldPtrCppC))
176 throw INTERP_KERNEL::Exception("error corba pointer is not a SALOME_MED.MEDCouplingFieldOverTimeCorbaInterface_ptr !");
179 MEDCouplingFieldOverTimeClient *ret=MEDCouplingFieldOverTimeClient::New(fieldPtrCppC);
185 class MEDCouplingUMeshClient
190 static MEDCouplingUMesh *New(PyObject *meshPtr) throw(INTERP_KERNEL::Exception)
192 PyObject* pdict=PyDict_New();
193 PyDict_SetItemString(pdict,"__builtins__",PyEval_GetBuiltins());
194 PyRun_String("import MEDCouplingCorbaServant_idl",Py_single_input,pdict, pdict);
195 PyRun_String("import CORBA",Py_single_input,pdict, pdict);
196 PyRun_String("orbTmp15634=CORBA.ORB_init([''])", Py_single_input,pdict, pdict);
197 PyObject *orbPython=PyDict_GetItemString(pdict,"orbTmp15634");
198 // Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string
199 PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
201 throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingUMeshClient.New appears to differ from CORBA reference ! Expecting a UMeshCorbaInterface CORBA reference !");
202 char *ior=PyString_AsString(iorMesh);
204 CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
205 CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
206 SALOME_MED::MEDCouplingUMeshCorbaInterface_var meshPtrCppC=SALOME_MED::MEDCouplingUMeshCorbaInterface::_narrow(meshPtrCpp);
207 if(CORBA::is_nil(meshPtrCppC))
208 throw INTERP_KERNEL::Exception("error corba pointer is not a SALOME_MED.MEDCouplingUMeshInterface_ptr !");
211 MEDCouplingUMesh *ret=MEDCouplingUMeshClient::New(meshPtrCppC);
217 class MEDCouplingExtrudedMeshClient
222 static MEDCouplingExtrudedMesh *New(PyObject *meshPtr) throw(INTERP_KERNEL::Exception)
224 PyObject* pdict=PyDict_New();
225 PyDict_SetItemString(pdict,"__builtins__",PyEval_GetBuiltins());
226 PyRun_String("import MEDCouplingCorbaServant_idl",Py_single_input,pdict, pdict);
227 PyRun_String("import CORBA",Py_single_input,pdict, pdict);
228 PyRun_String("orbTmp15634=CORBA.ORB_init([''])", Py_single_input,pdict, pdict);
229 PyObject *orbPython=PyDict_GetItemString(pdict,"orbTmp15634");
230 // Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string
231 PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
233 throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingExtrudedMeshClient.New appears to differ from CORBA reference ! Expecting an ExtrudedMeshCorbaInterface CORBA reference !");
234 char *ior=PyString_AsString(iorMesh);
236 CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
237 CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
238 SALOME_MED::MEDCouplingExtrudedMeshCorbaInterface_var meshPtrCppC=SALOME_MED::MEDCouplingExtrudedMeshCorbaInterface::_narrow(meshPtrCpp);
239 if(CORBA::is_nil(meshPtrCppC))
240 throw INTERP_KERNEL::Exception("error corba pointer is not a SALOME_MED.MEDCouplingExtrudedMeshInterface_ptr !");
243 MEDCouplingExtrudedMesh *ret=MEDCouplingExtrudedMeshClient::New(meshPtrCppC);
249 class MEDCouplingCMeshClient
254 static MEDCouplingCMesh *New(PyObject *meshPtr) throw(INTERP_KERNEL::Exception)
256 PyObject* pdict=PyDict_New();
257 PyDict_SetItemString(pdict,"__builtins__",PyEval_GetBuiltins());
258 PyRun_String("import MEDCouplingCorbaServant_idl",Py_single_input,pdict, pdict);
259 PyRun_String("import CORBA",Py_single_input,pdict, pdict);
260 PyRun_String("orbTmp15634=CORBA.ORB_init([''])", Py_single_input,pdict, pdict);
261 PyObject *orbPython=PyDict_GetItemString(pdict,"orbTmp15634");
262 // Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string
263 PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
265 throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingCMeshClient.New appears to differ from CORBA reference ! Expecting a CMeshCorbaInterface CORBA reference !");
266 char *ior=PyString_AsString(iorMesh);
268 CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
269 CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
270 SALOME_MED::MEDCouplingCMeshCorbaInterface_var meshPtrCppC=SALOME_MED::MEDCouplingCMeshCorbaInterface::_narrow(meshPtrCpp);
271 if(CORBA::is_nil(meshPtrCppC))
272 throw INTERP_KERNEL::Exception("error corba pointer is not a SALOME_MED.MEDCouplingCMeshInterface_ptr !");
275 MEDCouplingCMesh *ret=MEDCouplingCMeshClient::New(meshPtrCppC);
281 class DataArrayDoubleClient
286 static DataArrayDouble *New(PyObject *meshPtr) throw(INTERP_KERNEL::Exception)
288 PyObject* pdict=PyDict_New();
289 PyDict_SetItemString(pdict,"__builtins__",PyEval_GetBuiltins());
290 PyRun_String("import MEDCouplingCorbaServant_idl",Py_single_input,pdict, pdict);
291 PyRun_String("import CORBA",Py_single_input,pdict, pdict);
292 PyRun_String("orbTmp15634=CORBA.ORB_init([''])", Py_single_input,pdict, pdict);
293 PyObject *orbPython=PyDict_GetItemString(pdict,"orbTmp15634");
294 // Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string
295 PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
297 throw INTERP_KERNEL::Exception("Error : the input parameter of DataArrayDoubleClient.New appears to differ from CORBA reference ! Expecting a DataArrayDoubleCorbaInterface CORBA reference !");
298 char *ior=PyString_AsString(iorMesh);
300 CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
301 CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
302 SALOME_MED::DataArrayDoubleCorbaInterface_var meshPtrCppC=SALOME_MED::DataArrayDoubleCorbaInterface::_narrow(meshPtrCpp);
303 if(CORBA::is_nil(meshPtrCppC))
304 throw INTERP_KERNEL::Exception("error corba pointer is not a SALOME_MED.DataArrayDoubleInterface_ptr ");
307 DataArrayDouble *ret=DataArrayDoubleClient::New(meshPtrCppC);
313 class DataArrayIntClient
318 static DataArrayInt *New(PyObject *meshPtr) throw(INTERP_KERNEL::Exception)
320 PyObject* pdict=PyDict_New();
321 PyDict_SetItemString(pdict,"__builtins__",PyEval_GetBuiltins());
322 PyRun_String("import MEDCouplingCorbaServant_idl",Py_single_input,pdict, pdict);
323 PyRun_String("import CORBA",Py_single_input,pdict, pdict);
324 PyRun_String("orbTmp15634=CORBA.ORB_init([''])", Py_single_input,pdict, pdict);
325 PyObject *orbPython=PyDict_GetItemString(pdict,"orbTmp15634");
326 // Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string
327 PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
329 throw INTERP_KERNEL::Exception("Error : the input parameter of DataArrayIntClient.New appears to differ from CORBA reference ! Expecting a DataArrayIntCorbaInterface CORBA reference !");
330 char *ior=PyString_AsString(iorMesh);
332 CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
333 CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
334 SALOME_MED::DataArrayIntCorbaInterface_var meshPtrCppC=SALOME_MED::DataArrayIntCorbaInterface::_narrow(meshPtrCpp);
335 if(CORBA::is_nil(meshPtrCppC))
336 throw INTERP_KERNEL::Exception("error corba pointer is not a SALOME_MED.DataArrayIntInterface_ptr !");
339 DataArrayInt *ret=DataArrayIntClient::New(meshPtrCppC);
347 def ParaMEDMEMDataArrayDoubleIadd(self,*args):
348 import _MEDCouplingClient
349 return _MEDCouplingClient.DataArrayDouble____iadd___(self, self, *args)
350 def ParaMEDMEMDataArrayDoubleIsub(self,*args):
351 import _MEDCouplingClient
352 return _MEDCouplingClient.DataArrayDouble____isub___(self, self, *args)
353 def ParaMEDMEMDataArrayDoubleImul(self,*args):
354 import _MEDCouplingClient
355 return _MEDCouplingClient.DataArrayDouble____imul___(self, self, *args)
356 def ParaMEDMEMDataArrayDoubleIdiv(self,*args):
357 import _MEDCouplingClient
358 return _MEDCouplingClient.DataArrayDouble____idiv___(self, self, *args)
359 def ParaMEDMEMMEDCouplingFieldDoubleIadd(self,*args):
360 import _MEDCouplingClient
361 return _MEDCouplingClient.MEDCouplingFieldDouble____iadd___(self, self, *args)
362 def ParaMEDMEMMEDCouplingFieldDoubleIsub(self,*args):
363 import _MEDCouplingClient
364 return _MEDCouplingClient.MEDCouplingFieldDouble____isub___(self, self, *args)
365 def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args):
366 import _MEDCouplingClient
367 return _MEDCouplingClient.MEDCouplingFieldDouble____imul___(self, self, *args)
368 def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args):
369 import _MEDCouplingClient
370 return _MEDCouplingClient.MEDCouplingFieldDouble____idiv___(self, self, *args)
371 def ParaMEDMEMDataArrayIntIadd(self,*args):
372 import _MEDCouplingClient
373 return _MEDCouplingClient.DataArrayInt____iadd___(self, self, *args)
374 def ParaMEDMEMDataArrayIntIsub(self,*args):
375 import _MEDCouplingClient
376 return _MEDCouplingClient.DataArrayInt____isub___(self, self, *args)
377 def ParaMEDMEMDataArrayIntImul(self,*args):
378 import _MEDCouplingClient
379 return _MEDCouplingClient.DataArrayInt____imul___(self, self, *args)
380 def ParaMEDMEMDataArrayIntIdiv(self,*args):
381 import _MEDCouplingClient
382 return _MEDCouplingClient.DataArrayInt____idiv___(self, self, *args)
383 def ParaMEDMEMDataArrayIntImod(self,*args):
384 import _MEDCouplingClient
385 return _MEDCouplingClient.DataArrayInt____imod___(self, self, *args)
386 def ParaMEDMEMDataArrayDoubleTupleIadd(self,*args):
387 import _MEDCouplingClient
388 return _MEDCouplingClient.DataArrayDoubleTuple____iadd___(self, self, *args)
389 def ParaMEDMEMDataArrayDoubleTupleIsub(self,*args):
390 import _MEDCouplingClient
391 return _MEDCouplingClient.DataArrayDoubleTuple____isub___(self, self, *args)
392 def ParaMEDMEMDataArrayDoubleTupleImul(self,*args):
393 import _MEDCouplingClient
394 return _MEDCouplingClient.DataArrayDoubleTuple____imul___(self, self, *args)
395 def ParaMEDMEMDataArrayDoubleTupleIdiv(self,*args):
396 import _MEDCouplingClient
397 return _MEDCouplingClient.DataArrayDoubleTuple____idiv___(self, self, *args)
398 def ParaMEDMEMDataArrayIntTupleIadd(self,*args):
399 import _MEDCouplingClient
400 return _MEDCouplingClient.DataArrayIntTuple____iadd___(self, self, *args)
401 def ParaMEDMEMDataArrayIntTupleIsub(self,*args):
402 import _MEDCouplingClient
403 return _MEDCouplingClient.DataArrayIntTuple____isub___(self, self, *args)
404 def ParaMEDMEMDataArrayIntTupleImul(self,*args):
405 import _MEDCouplingClient
406 return _MEDCouplingClient.DataArrayIntTuple____imul___(self, self, *args)
407 def ParaMEDMEMDataArrayIntTupleIdiv(self,*args):
408 import _MEDCouplingClient
409 return _MEDCouplingClient.DataArrayIntTuple____idiv___(self, self, *args)
410 def ParaMEDMEMDataArrayIntTupleImod(self,*args):
411 import _MEDCouplingClient
412 return _MEDCouplingClient.DataArrayIntTuple____imod___(self, self, *args)
415 %include "MEDCouplingFinalize.i"