From 4abcc1e862b39fbad41d915fbce52e59ed39721c Mon Sep 17 00:00:00 2001 From: Dmitry Yurov <d.yurov@fz-juelich.de> Date: Tue, 7 Nov 2017 18:58:06 +0100 Subject: [PATCH] Python bindings regenerated Redmine: #1871 --- auto/Wrap/libBornAgainCore.py | 27 +++++++++- auto/Wrap/libBornAgainCore_wrap.cpp | 81 +++++++++++++++++++++++++++-- 2 files changed, 103 insertions(+), 5 deletions(-) diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py index 043c43a7f1c..9a6f89fcf3b 100644 --- a/auto/Wrap/libBornAgainCore.py +++ b/auto/Wrap/libBornAgainCore.py @@ -22713,6 +22713,18 @@ class Material(_object): return _libBornAgainCore.Material_isEmpty(self) + def isDefaultMaterial(self): + """ + isDefaultMaterial(Material self) -> bool + + bool Material::isDefaultMaterial() const + + Returns true if material has refractive index of (1.0, 0.0) and zero magnetization. + + """ + return _libBornAgainCore.Material_isDefaultMaterial(self) + + def scalarSubtrSLD(self, wavevectors): """ scalarSubtrSLD(Material self, WavevectorInfo wavevectors) -> complex_t @@ -22750,7 +22762,7 @@ def HomogeneousMaterial(*args): BA_CORE_API_ Material HomogeneousMaterial() - Constructs vacuum material based on refractive coefficients. Though in practice there is no difference between vacuum materials produced with MaterialBySLD() and HomogeneousMaterial(), they are not equal because of the difference in the type of underlying data + Constructs material with zero refractive coefficients and zero magnetization. """ return _libBornAgainCore.HomogeneousMaterial(*args) @@ -22787,10 +22799,21 @@ def MaterialBySLD(*args): BA_CORE_API_ Material MaterialBySLD() - Constructs wavelength-independent vacuum material. Though in practice there is no difference between vacuum materials produced with MaterialBySLD() and HomogeneousMaterial(), they are not equal because of the difference in the type of underlying data + Constructs wavelength-independent material with zero sld and zero magnetization. """ return _libBornAgainCore.MaterialBySLD(*args) + +def createAveragedMaterial(layer_mat, regions): + """ + createAveragedMaterial(Material layer_mat, std::vector< HomogeneousRegion,std::allocator< HomogeneousRegion > > const & regions) -> Material + + BA_CORE_API_ Material createAveragedMaterial(const Material &layer_mat, const std::vector< HomogeneousRegion > ®ions) + + Creates averaged material. Square refractive index of returned material is arithmetic mean over regions and layer_mat. Magnetization (if present) is averaged linearly. + + """ + return _libBornAgainCore.createAveragedMaterial(layer_mat, regions) class MesoCrystal(IParticle): """ diff --git a/auto/Wrap/libBornAgainCore_wrap.cpp b/auto/Wrap/libBornAgainCore_wrap.cpp index 9665a82990e..ca8ee24a4c2 100644 --- a/auto/Wrap/libBornAgainCore_wrap.cpp +++ b/auto/Wrap/libBornAgainCore_wrap.cpp @@ -5990,7 +5990,7 @@ SWIG_AsVal_std_complex_Sl_double_Sg_ (PyObject *o, std::complex<double>* val) SWIGINTERNINLINE PyObject* -SWIG_From_std_complex_Sl_double_Sg_ (/*@SWIG:/home/pospelov/software/local/share/swig/3.0.8/typemaps/swigmacros.swg,104,%ifcplusplus@*/ +SWIG_From_std_complex_Sl_double_Sg_ (/*@SWIG:/usr/local/share/swig/3.0.8/typemaps/swigmacros.swg,104,%ifcplusplus@*/ const std::complex<double>& @@ -95795,6 +95795,28 @@ fail: } +SWIGINTERN PyObject *_wrap_Material_isDefaultMaterial(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Material *arg1 = (Material *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + bool result; + + if (!PyArg_ParseTuple(args,(char *)"O:Material_isDefaultMaterial",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Material, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Material_isDefaultMaterial" "', argument " "1"" of type '" "Material const *""'"); + } + arg1 = reinterpret_cast< Material * >(argp1); + result = (bool)((Material const *)arg1)->isDefaultMaterial(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Material_scalarSubtrSLD(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Material *arg1 = (Material *) 0 ; @@ -96583,6 +96605,43 @@ fail: } +SWIGINTERN PyObject *_wrap_createAveragedMaterial(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Material *arg1 = 0 ; + std::vector< HomogeneousRegion,std::allocator< HomogeneousRegion > > *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + SwigValueWrapper< Material > result; + + if (!PyArg_ParseTuple(args,(char *)"OO:createAveragedMaterial",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_Material, 0 | 0); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createAveragedMaterial" "', argument " "1"" of type '" "Material const &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "createAveragedMaterial" "', argument " "1"" of type '" "Material const &""'"); + } + arg1 = reinterpret_cast< Material * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_HomogeneousRegion_std__allocatorT_HomogeneousRegion_t_t, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "createAveragedMaterial" "', argument " "2"" of type '" "std::vector< HomogeneousRegion,std::allocator< HomogeneousRegion > > const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "createAveragedMaterial" "', argument " "2"" of type '" "std::vector< HomogeneousRegion,std::allocator< HomogeneousRegion > > const &""'"); + } + arg2 = reinterpret_cast< std::vector< HomogeneousRegion,std::allocator< HomogeneousRegion > > * >(argp2); + result = createAveragedMaterial((Material const &)*arg1,(std::vector< HomogeneousRegion,std::allocator< HomogeneousRegion > > const &)*arg2); + resultobj = SWIG_NewPointerObj((new Material(static_cast< const Material& >(result))), SWIGTYPE_p_Material, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_new_MesoCrystal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IClusteredParticles *arg1 = 0 ; @@ -122237,6 +122296,14 @@ static PyMethodDef SwigMethods[] = { "Returns true if material underlying data is nullptr. \n" "\n" ""}, + { (char *)"Material_isDefaultMaterial", _wrap_Material_isDefaultMaterial, METH_VARARGS, (char *)"\n" + "Material_isDefaultMaterial(Material self) -> bool\n" + "\n" + "bool Material::isDefaultMaterial() const\n" + "\n" + "Returns true if material has refractive index of (1.0, 0.0) and zero magnetization. \n" + "\n" + ""}, { (char *)"Material_scalarSubtrSLD", _wrap_Material_scalarSubtrSLD, METH_VARARGS, (char *)"\n" "Material_scalarSubtrSLD(Material self, WavevectorInfo wavevectors) -> complex_t\n" "\n" @@ -122262,7 +122329,7 @@ static PyMethodDef SwigMethods[] = { "\n" "BA_CORE_API_ Material HomogeneousMaterial()\n" "\n" - "Constructs vacuum material based on refractive coefficients. Though in practice there is no difference between vacuum materials produced with MaterialBySLD() and HomogeneousMaterial(), they are not equal because of the difference in the type of underlying data \n" + "Constructs material with zero refractive coefficients and zero magnetization. \n" "\n" ""}, { (char *)"MaterialByAbsCX", _wrap_MaterialByAbsCX, METH_VARARGS, (char *)"\n" @@ -122293,7 +122360,15 @@ static PyMethodDef SwigMethods[] = { "\n" "BA_CORE_API_ Material MaterialBySLD()\n" "\n" - "Constructs wavelength-independent vacuum material. Though in practice there is no difference between vacuum materials produced with MaterialBySLD() and HomogeneousMaterial(), they are not equal because of the difference in the type of underlying data \n" + "Constructs wavelength-independent material with zero sld and zero magnetization. \n" + "\n" + ""}, + { (char *)"createAveragedMaterial", _wrap_createAveragedMaterial, METH_VARARGS, (char *)"\n" + "createAveragedMaterial(Material layer_mat, std::vector< HomogeneousRegion,std::allocator< HomogeneousRegion > > const & regions) -> Material\n" + "\n" + "BA_CORE_API_ Material createAveragedMaterial(const Material &layer_mat, const std::vector< HomogeneousRegion > ®ions)\n" + "\n" + "Creates averaged material. Square refractive index of returned material is arithmetic mean over regions and layer_mat. Magnetization (if present) is averaged linearly. \n" "\n" ""}, { (char *)"new_MesoCrystal", _wrap_new_MesoCrystal, METH_VARARGS, (char *)"\n" -- GitLab