diff --git a/CMakeLists.txt b/CMakeLists.txt index b496ff846b36deddf8c80e754229420367cfdc61..ee5d52b0fb43682d4a7e7d44323e3e8f7ae5f9d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(BornAgain_VERSION_PATCH 2) # --- General project settings --- option(BORNAGAIN_PYTHON "Build with python support" ON) -option(BORNAGAIN_APP "Build test application" OFF) +option(BORNAGAIN_APP "Build test application" ON) option(BORNAGAIN_GUI "Build a graphical user interface" OFF) option(BORNAGAIN_MAN "Build a user manual" OFF) option(BUILD_DEBIAN "Build a debian package" OFF) diff --git a/Core/Samples/inc/InterferenceFunction1DParaCrystal.h b/Core/Samples/inc/InterferenceFunction1DParaCrystal.h index fe3abf840e1bfc4925a0163d4a4cd674136dc752..b3457e0f4d7843665b187524177e59e5385f5416 100644 --- a/Core/Samples/inc/InterferenceFunction1DParaCrystal.h +++ b/Core/Samples/inc/InterferenceFunction1DParaCrystal.h @@ -18,19 +18,21 @@ #include "IInterferenceFunction.h" +//! Interference function of 1D paracrystal. + class BA_CORE_API_ InterferenceFunction1DParaCrystal : public IInterferenceFunction { public: + + //! @brief constructor + //! @param peak_distance The distance to the first neighbor peak. + //! @param width Width parameter in the pair correlation function. + //! @param m_corr_length Correlation length of paracrystal. InterferenceFunction1DParaCrystal( double peak_distance, double width, double corr_length=0.0); + virtual ~InterferenceFunction1DParaCrystal() {} - virtual InterferenceFunction1DParaCrystal *clone() const { - InterferenceFunction1DParaCrystal *p_clone = - new InterferenceFunction1DParaCrystal( - m_peak_distance, m_width, m_corr_length); - p_clone->setKappa(m_kappa); - return p_clone; - } + virtual InterferenceFunction1DParaCrystal *clone() const; virtual void accept(ISampleVisitor *visitor) const { visitor->visit(this); } @@ -41,9 +43,9 @@ public: complex_t FTGaussianCorrLength(double qpar) const; protected: - double m_peak_distance; - double m_width; - double m_corr_length; + double m_peak_distance; //!< the distance to the first neighbor peak + double m_width; //!< width parameter in the pair correlation function + double m_corr_length; //!< correlation length of paracrystal bool m_use_corr_length; double m_kappa; diff --git a/Core/Samples/inc/InterferenceFunction2DLattice.h b/Core/Samples/inc/InterferenceFunction2DLattice.h index 84a47d158d181d2d7f68f3a7ef1c81da7df7a9b3..fed08cabc376172853446f7289377f33741a53dc 100644 --- a/Core/Samples/inc/InterferenceFunction2DLattice.h +++ b/Core/Samples/inc/InterferenceFunction2DLattice.h @@ -20,11 +20,14 @@ #include "Lattice2DIFParameters.h" #include "FTDistributions.h" -//! ? +//! Interference function of 2D lattice class BA_CORE_API_ InterferenceFunction2DLattice : public IInterferenceFunction { public: + + //! @brief contructor + //! @param lattice_params Lattice parameters InterferenceFunction2DLattice(const Lattice2DIFParameters& lattice_params); virtual ~InterferenceFunction2DLattice(); diff --git a/Core/Samples/inc/InterferenceFunction2DParaCrystal.h b/Core/Samples/inc/InterferenceFunction2DParaCrystal.h index 1372433ea0d121b50038dedd3553331a29e15e39..67c6695847c51ff9e4e104ad39cf7f847051833e 100644 --- a/Core/Samples/inc/InterferenceFunction2DParaCrystal.h +++ b/Core/Samples/inc/InterferenceFunction2DParaCrystal.h @@ -20,10 +20,18 @@ #include "FTDistributions.h" #include <iostream> +//! Interference function of 2D paracrystal. class BA_CORE_API_ InterferenceFunction2DParaCrystal : public IInterferenceFunction { public: + + //! @brief constructor + //! @param length_1 Lattice length 1. + //! @param length_2 Lattice length 2. + //! @param alpha_lattice Angle between lattice basis vectors. + //! @param xi Angle between first basis vector and the x-axis of incoming beam. + //! @param m_corr_length correlation length of paracrystal InterferenceFunction2DParaCrystal(double length_1, double length_2, double alpha_lattice, double xi=0.0, double corr_length=0.0); virtual ~InterferenceFunction2DParaCrystal(); @@ -36,6 +44,8 @@ public: static InterferenceFunction2DParaCrystal *createHexagonal(double peak_distance, double corr_length=0.0, double domain_size_1=0.0, double domain_size_2=0.0); + //! @brief Sets sizes of coherence domain + //! @param size_1 void setDomainSizes(double size_1, double size_2) { m_domain_sizes[0] = size_1; m_domain_sizes[1] = size_2; @@ -55,14 +65,14 @@ protected: virtual void init_parameters(); void transformToPrincipalAxes(double qx, double qy, double gamma, double delta, double& q_pa_1, double& q_pa_2) const; - double m_lattice_lengths[2]; + double m_lattice_lengths[2]; //!< the size of unit cell double m_alpha_lattice; //!< Angle between lattice basis vectors double m_xi; //!< Orientation of the lattice wrt beam axis x bool m_integrate_xi; //!< Integrate over the orientation xi IFTDistribution2D *m_pdfs[2]; double m_corr_length; bool m_use_corr_length; - double m_domain_sizes[2]; + double m_domain_sizes[2]; //!< Coherence domain sizes private: //! Returns interference function for fixed rotation xi diff --git a/Core/Samples/src/InterferenceFunction1DParaCrystal.cpp b/Core/Samples/src/InterferenceFunction1DParaCrystal.cpp index a879bb9a7fcf29f123a29b9b1bc338551c1e029b..ff067cb474383486bd211a33d0d7733d7720ff78 100644 --- a/Core/Samples/src/InterferenceFunction1DParaCrystal.cpp +++ b/Core/Samples/src/InterferenceFunction1DParaCrystal.cpp @@ -36,6 +36,16 @@ void InterferenceFunction1DParaCrystal::init_parameters() registerParameter("corr_length", &m_corr_length); } + +InterferenceFunction1DParaCrystal *InterferenceFunction1DParaCrystal::clone() const { + InterferenceFunction1DParaCrystal *p_clone = + new InterferenceFunction1DParaCrystal( + m_peak_distance, m_width, m_corr_length); + p_clone->setKappa(m_kappa); + return p_clone; +} + + double InterferenceFunction1DParaCrystal::evaluate(const cvector_t& q) const { double qxr = q.x().real();