diff --git a/Core/HardParticle/ProfileRipple1.cpp b/Core/HardParticle/ProfileRipple1.cpp index 24e2df63e3f58afc8d602ad52398c2094f1ef865..c2bf9699a23287ac14c45fb67da3bb53f953722b 100644 --- a/Core/HardParticle/ProfileRipple1.cpp +++ b/Core/HardParticle/ProfileRipple1.cpp @@ -27,28 +27,12 @@ ProfileRipple1::ProfileRipple1(double length, double width, double height) : m_length(length), m_width(width), m_height(height) { - check_initialization(); registerParameter("Length", &m_length).setUnit("nm").setNonnegative(); registerParameter("Width", &m_width).setUnit("nm").setNonnegative(); registerParameter("Height", &m_height).setUnit("nm").setNonnegative(); onChange(); } -bool ProfileRipple1::check_initialization() const -{ - bool result(true); - if (m_height <= 0.0 || m_width <= 0.0 || m_length <= 0.0) { - std::ostringstream ostr; - ostr << "ProfileRipple1() -> Error in class initialization with parameters "; - ostr << " height:" << m_height; - ostr << " width:" << m_width; - ostr << " length:" << m_length << "\n\n"; - ostr << "Check for 'height>0.0 && width>0.0 && length>0.0' failed."; - throw Exceptions::ClassInitializationException(ostr.str()); - } - return result; -} - double ProfileRipple1::radialExtension() const { return (m_width + m_length) / 4.0; @@ -77,7 +61,7 @@ complex_t ProfileRipple1::factor_yz(complex_t qy, complex_t qz) const const auto integrand = [&](double u) -> complex_t { return sin(u) * exp(az * std::cos(u)) * (ay == 0. ? u : sin(ay * u) / ay); }; - complex_t integral = m_integrator.integrate(integrand, 0, M_PI); + complex_t integral = ComplexIntegrator().integrate(integrand, 0, M_PI); return factor * integral * exp(az) * (m_height / 2); } diff --git a/Core/HardParticle/ProfileRipple1.h b/Core/HardParticle/ProfileRipple1.h index 1a0a6527b2a211d00b89dca20ae5dd85f6d2e131..c0155a08a0d36f5f73423a6d1b319d138b8dc065 100644 --- a/Core/HardParticle/ProfileRipple1.h +++ b/Core/HardParticle/ProfileRipple1.h @@ -46,8 +46,6 @@ protected: private: complex_t factor_yz(complex_t qy, complex_t qz) const; - bool check_initialization() const; - mutable ComplexIntegrator m_integrator; }; #endif // BORNAGAIN_CORE_HARDPARTICLE_PROFILERIPPLE1_H diff --git a/Core/HardParticle/ProfileRipple2.cpp b/Core/HardParticle/ProfileRipple2.cpp index 3e42fbed8049f35d78dbdb9c015927ddae32f036..83c05077f8e2bf5ddfb630b57f7ac36ac6adecec 100644 --- a/Core/HardParticle/ProfileRipple2.cpp +++ b/Core/HardParticle/ProfileRipple2.cpp @@ -27,7 +27,6 @@ ProfileRipple2::ProfileRipple2(double length, double width, double height, double asymmetry) : m_length(length), m_width(width), m_height(height), m_asymmetry(asymmetry) { - check_initialization(); registerParameter("Length", &m_length).setUnit("nm").setNonnegative(); registerParameter("Width", &m_width).setUnit("nm").setNonnegative(); registerParameter("Height", &m_height).setUnit("nm").setNonnegative(); @@ -35,21 +34,6 @@ ProfileRipple2::ProfileRipple2(double length, double width, double height, doubl onChange(); } -bool ProfileRipple2::check_initialization() const -{ - bool result(true); - if (m_height <= 0.0 || m_width <= 0.0 || m_length <= 0.0) { - std::ostringstream ostr; - ostr << "ProfileRipple2() -> Error in class initialization with parameters "; - ostr << " height:" << m_height; - ostr << " width:" << m_width; - ostr << " length:" << m_length << "\n\n"; - ostr << "Check for 'height>0.0 && width>0.0 && length>0.0' failed."; - throw Exceptions::ClassInitializationException(ostr.str()); - } - return result; -} - double ProfileRipple2::radialExtension() const { return (m_width + m_length) / 4.0; diff --git a/Core/HardParticle/ProfileRipple2.h b/Core/HardParticle/ProfileRipple2.h index 726547f9aa3a0c0dbb7fc25a63999b4fbfc5b2d7..718c78dc8497627fd0ce31d36e0db2eaf090326c 100644 --- a/Core/HardParticle/ProfileRipple2.h +++ b/Core/HardParticle/ProfileRipple2.h @@ -48,8 +48,6 @@ protected: private: complex_t factor_yz(complex_t qy, complex_t qz) const; - bool check_initialization() const; - mutable ComplexIntegrator m_integrator; }; #endif // BORNAGAIN_CORE_HARDPARTICLE_PROFILERIPPLE2_H