diff --git a/Core/HardParticle/IFormFactorPrism.cpp b/Core/HardParticle/IFormFactorPrism.cpp index 9580b6d388a6b9e1afdb09f8926ceaeaec57be8c..3e3dfff7d05e0400517dc57ec0a3ef6cdae5af35 100644 --- a/Core/HardParticle/IFormFactorPrism.cpp +++ b/Core/HardParticle/IFormFactorPrism.cpp @@ -69,6 +69,9 @@ double IFormFactorPrism::volume() const return height() * m_base->area(); } +double IFormFactorPrism::getHeight() const { return height(); } +double IFormFactorPrism::radialExtension() const { return std::sqrt(m_base->area()); } + //! Returns the form factor F(q) of this polyhedron, respecting the offset height/2. complex_t IFormFactorPrism::evaluate_for_q(cvector_t q) const diff --git a/Core/HardParticle/IFormFactorPrism.h b/Core/HardParticle/IFormFactorPrism.h index 93dbcf52d1e1da3fd54959aafb3446a753def2d9..dbad76ea93d5a387cf8063e2e1cd0ec9fc57a425 100644 --- a/Core/HardParticle/IFormFactorPrism.h +++ b/Core/HardParticle/IFormFactorPrism.h @@ -31,15 +31,17 @@ public: double bottomZ(const IRotation& rotation) const override final; double topZ(const IRotation& rotation) const override final; - virtual complex_t evaluate_for_q(cvector_t q) const override; - virtual double volume() const override; - double getHeight() const { return height(); } - virtual double radialExtension() const override { return std::sqrt(m_base->area()); } + complex_t evaluate_for_q(cvector_t q) const override; + double volume() const override; + double radialExtension() const override; + double getHeight() const; protected: + void setPrism(bool symmetry_Ci, const std::vector<kvector_t>& vertices); + +private: virtual double height() const = 0; std::unique_ptr<PolyhedralFace> m_base; - void setPrism(bool symmetry_Ci, const std::vector<kvector_t>& vertices); std::vector<kvector_t> m_vertices; //! for topZ, bottomZ computation only }; diff --git a/auto/Wrap/doxygen_core.i b/auto/Wrap/doxygen_core.i index aa8d77bbc9b818695ee1d85a09109890df1170f6..9d8558caeffa2d23781194861bb98b36c3f5c7b5 100644 --- a/auto/Wrap/doxygen_core.i +++ b/auto/Wrap/doxygen_core.i @@ -3049,7 +3049,7 @@ Calls the INodeVisitor's visit method. %feature("docstring") FormFactorBox::volume "double FormFactorBox::volume() const override final -Returns the volume of this prism. +Returns the total volume of the particle of this form factor's shape. "; %feature("docstring") FormFactorBox::radialExtension "double FormFactorBox::radialExtension() const override final @@ -3059,7 +3059,7 @@ Returns the (approximate in some cases) radial size of the particle of this form %feature("docstring") FormFactorBox::evaluate_for_q "complex_t FormFactorBox::evaluate_for_q(cvector_t q) const override final -Returns the form factor F(q) of this polyhedron, respecting the offset height/2. +Returns scattering amplitude for complex scattering wavevector q=k_i-k_f. This method is public only for convenience of plotting form factors in Python. "; @@ -7071,14 +7071,14 @@ Returns the form factor F(q) of this polyhedron, respecting the offset height/2. Returns the volume of this prism. "; -%feature("docstring") IFormFactorPrism::getHeight "double IFormFactorPrism::getHeight() const -"; - -%feature("docstring") IFormFactorPrism::radialExtension "virtual double IFormFactorPrism::radialExtension() const override +%feature("docstring") IFormFactorPrism::radialExtension "double IFormFactorPrism::radialExtension() const override Returns the (approximate in some cases) radial size of the particle of this form factor's shape. This is used for SSCA calculations "; +%feature("docstring") IFormFactorPrism::getHeight "double IFormFactorPrism::getHeight() const +"; + // File: classIFresnelMap.xml %feature("docstring") IFresnelMap " diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py index e6aa79eb3c2c42f740b7fb2e044e48f5d1bd182f..1cb2cdc2dc526fd70c054c4d9c1f42e6c6b555b5 100644 --- a/auto/Wrap/libBornAgainCore.py +++ b/auto/Wrap/libBornAgainCore.py @@ -14775,23 +14775,23 @@ class IFormFactorPrism(IFormFactorBorn): """ return _libBornAgainCore.IFormFactorPrism_volume(self) - def getHeight(self): - r""" - getHeight(IFormFactorPrism self) -> double - double IFormFactorPrism::getHeight() const - - """ - return _libBornAgainCore.IFormFactorPrism_getHeight(self) - def radialExtension(self): r""" radialExtension(IFormFactorPrism self) -> double - virtual double IFormFactorPrism::radialExtension() const override + double IFormFactorPrism::radialExtension() const override Returns the (approximate in some cases) radial size of the particle of this form factor's shape. This is used for SSCA calculations """ return _libBornAgainCore.IFormFactorPrism_radialExtension(self) + + def getHeight(self): + r""" + getHeight(IFormFactorPrism self) -> double + double IFormFactorPrism::getHeight() const + + """ + return _libBornAgainCore.IFormFactorPrism_getHeight(self) __swig_destroy__ = _libBornAgainCore.delete_IFormFactorPrism # Register IFormFactorPrism in _libBornAgainCore: @@ -15070,7 +15070,7 @@ class FormFactorBox(IFormFactorPrism): volume(FormFactorBox self) -> double double FormFactorBox::volume() const override final - Returns the volume of this prism. + Returns the total volume of the particle of this form factor's shape. """ return _libBornAgainCore.FormFactorBox_volume(self) @@ -15090,7 +15090,7 @@ class FormFactorBox(IFormFactorPrism): evaluate_for_q(FormFactorBox self, cvector_t q) -> complex_t complex_t FormFactorBox::evaluate_for_q(cvector_t q) const override final - Returns the form factor F(q) of this polyhedron, respecting the offset height/2. + Returns scattering amplitude for complex scattering wavevector q=k_i-k_f. This method is public only for convenience of plotting form factors in Python. """ return _libBornAgainCore.FormFactorBox_evaluate_for_q(self, q) diff --git a/auto/Wrap/libBornAgainCore_wrap.cpp b/auto/Wrap/libBornAgainCore_wrap.cpp index c24b49f2f5442515e2c5f5614ddcaba3d012e277..0e05e2da2d98b886b9602adc287d725300d8875e 100644 --- a/auto/Wrap/libBornAgainCore_wrap.cpp +++ b/auto/Wrap/libBornAgainCore_wrap.cpp @@ -91435,7 +91435,7 @@ fail: } -SWIGINTERN PyObject *_wrap_IFormFactorPrism_getHeight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IFormFactorPrism_radialExtension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IFormFactorPrism *arg1 = (IFormFactorPrism *) 0 ; void *argp1 = 0 ; @@ -91447,10 +91447,10 @@ SWIGINTERN PyObject *_wrap_IFormFactorPrism_getHeight(PyObject *SWIGUNUSEDPARM(s swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IFormFactorPrism, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IFormFactorPrism_getHeight" "', argument " "1"" of type '" "IFormFactorPrism const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IFormFactorPrism_radialExtension" "', argument " "1"" of type '" "IFormFactorPrism const *""'"); } arg1 = reinterpret_cast< IFormFactorPrism * >(argp1); - result = (double)((IFormFactorPrism const *)arg1)->getHeight(); + result = (double)((IFormFactorPrism const *)arg1)->radialExtension(); resultobj = SWIG_From_double(static_cast< double >(result)); return resultobj; fail: @@ -91458,7 +91458,7 @@ fail: } -SWIGINTERN PyObject *_wrap_IFormFactorPrism_radialExtension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IFormFactorPrism_getHeight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IFormFactorPrism *arg1 = (IFormFactorPrism *) 0 ; void *argp1 = 0 ; @@ -91470,10 +91470,10 @@ SWIGINTERN PyObject *_wrap_IFormFactorPrism_radialExtension(PyObject *SWIGUNUSED swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IFormFactorPrism, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IFormFactorPrism_radialExtension" "', argument " "1"" of type '" "IFormFactorPrism const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IFormFactorPrism_getHeight" "', argument " "1"" of type '" "IFormFactorPrism const *""'"); } arg1 = reinterpret_cast< IFormFactorPrism * >(argp1); - result = (double)((IFormFactorPrism const *)arg1)->radialExtension(); + result = (double)((IFormFactorPrism const *)arg1)->getHeight(); resultobj = SWIG_From_double(static_cast< double >(result)); return resultobj; fail: @@ -129226,18 +129226,18 @@ static PyMethodDef SwigMethods[] = { "Returns the volume of this prism. \n" "\n" ""}, - { "IFormFactorPrism_getHeight", _wrap_IFormFactorPrism_getHeight, METH_O, "\n" - "IFormFactorPrism_getHeight(IFormFactorPrism self) -> double\n" - "double IFormFactorPrism::getHeight() const\n" - "\n" - ""}, { "IFormFactorPrism_radialExtension", _wrap_IFormFactorPrism_radialExtension, METH_O, "\n" "IFormFactorPrism_radialExtension(IFormFactorPrism self) -> double\n" - "virtual double IFormFactorPrism::radialExtension() const override\n" + "double IFormFactorPrism::radialExtension() const override\n" "\n" "Returns the (approximate in some cases) radial size of the particle of this form factor's shape. This is used for SSCA calculations \n" "\n" ""}, + { "IFormFactorPrism_getHeight", _wrap_IFormFactorPrism_getHeight, METH_O, "\n" + "IFormFactorPrism_getHeight(IFormFactorPrism self) -> double\n" + "double IFormFactorPrism::getHeight() const\n" + "\n" + ""}, { "delete_IFormFactorPrism", _wrap_delete_IFormFactorPrism, METH_O, "delete_IFormFactorPrism(IFormFactorPrism self)"}, { "IFormFactorPrism_swigregister", IFormFactorPrism_swigregister, METH_O, NULL}, { "IProfileRipple_getLength", _wrap_IProfileRipple_getLength, METH_O, "\n" @@ -129359,7 +129359,7 @@ static PyMethodDef SwigMethods[] = { "FormFactorBox_volume(FormFactorBox self) -> double\n" "double FormFactorBox::volume() const override final\n" "\n" - "Returns the volume of this prism. \n" + "Returns the total volume of the particle of this form factor's shape. \n" "\n" ""}, { "FormFactorBox_radialExtension", _wrap_FormFactorBox_radialExtension, METH_O, "\n" @@ -129373,7 +129373,7 @@ static PyMethodDef SwigMethods[] = { "FormFactorBox_evaluate_for_q(FormFactorBox self, cvector_t q) -> complex_t\n" "complex_t FormFactorBox::evaluate_for_q(cvector_t q) const override final\n" "\n" - "Returns the form factor F(q) of this polyhedron, respecting the offset height/2. \n" + "Returns scattering amplitude for complex scattering wavevector q=k_i-k_f. This method is public only for convenience of plotting form factors in Python. \n" "\n" ""}, { "delete_FormFactorBox", _wrap_delete_FormFactorBox, METH_O, "delete_FormFactorBox(FormFactorBox self)"},