diff --git a/Sample/FFCompute/ComputeBA.h b/Sample/FFCompute/ComputeBA.h index 30f3f273deaacd844526e382810741ee2d65d205..17619d178f20fb3a2767bb2213a58d59ba6efc55 100644 --- a/Sample/FFCompute/ComputeBA.h +++ b/Sample/FFCompute/ComputeBA.h @@ -12,13 +12,14 @@ // // ************************************************************************************************ -#ifndef BORNAGAIN_SAMPLE_SCATTERING_COMPUTEBA_H -#define BORNAGAIN_SAMPLE_SCATTERING_COMPUTEBA_H +#ifndef BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEBA_H +#define BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEBA_H #include "Sample/FFCompute/IComputeFF.h" #include <memory> -//! Evaluates the scalar Born form factor. +//! Provides scalar form factor evaluation in Born Approximation for given IFormFactor. + //! @ingroup formfactors_internal class ComputeBA final : public IComputeFF @@ -33,4 +34,4 @@ public: complex_t evaluate(const WavevectorInfo& wavevectors) const override; }; -#endif // BORNAGAIN_SAMPLE_SCATTERING_COMPUTEBA_H +#endif // BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEBA_H diff --git a/Sample/FFCompute/ComputeBAPol.h b/Sample/FFCompute/ComputeBAPol.h index dbc6fea561e5de76f08d75103585a01f3c487908..194a3eb739e180eec596f8f082554e24a74e32a6 100644 --- a/Sample/FFCompute/ComputeBAPol.h +++ b/Sample/FFCompute/ComputeBAPol.h @@ -12,14 +12,14 @@ // // ************************************************************************************************ -#ifndef BORNAGAIN_SAMPLE_SCATTERING_COMPUTEBAPOL_H -#define BORNAGAIN_SAMPLE_SCATTERING_COMPUTEBAPOL_H +#ifndef BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEBAPOL_H +#define BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEBAPOL_H #include "Sample/FFCompute/IComputeFF.h" #include "Sample/Scattering/IFormFactor.h" #include <memory> -//! Evaluates the matrix BA term in a polarized IFormFactor. +//! Provides polarized form factor evaluation in Born Approximation for given IFormFactor. //! @ingroup formfactors_internal @@ -38,4 +38,4 @@ public: Eigen::Matrix2cd evaluatePol(const WavevectorInfo& wavevectors) const override; }; -#endif // BORNAGAIN_SAMPLE_SCATTERING_COMPUTEBAPOL_H +#endif // BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEBAPOL_H diff --git a/Sample/FFCompute/ComputeDWBA.h b/Sample/FFCompute/ComputeDWBA.h index d44f67634b825d6dcbf0ed04082e22b94fdc4c48..adf26d0e8dd5c6945c2cee1b539159ac4c496dad 100644 --- a/Sample/FFCompute/ComputeDWBA.h +++ b/Sample/FFCompute/ComputeDWBA.h @@ -12,15 +12,16 @@ // // ************************************************************************************************ -#ifndef BORNAGAIN_SAMPLE_SCATTERING_COMPUTEDWBA_H -#define BORNAGAIN_SAMPLE_SCATTERING_COMPUTEDWBA_H +#ifndef BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEDWBA_H +#define BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEDWBA_H #include "Sample/FFCompute/IComputeFF.h" #include <memory> class ILayerRTCoefficients; -//! Evaluates the coherent sum of the four DWBA terms in a scalar IFormFactor. +//! Provides scalar DWBA computation for given IFormFactor. + //! @ingroup formfactors_internal class ComputeDWBA final : public IComputeFF @@ -31,7 +32,7 @@ public: ComputeDWBA* clone() const override; - //! Calculates and returns a form factor calculation in DWBA + //! Returns the coherent sum of the four DWBA terms for scalar scattering. complex_t evaluate(const WavevectorInfo& wavevectors) const override; void setSpecularInfo(std::unique_ptr<const ILayerRTCoefficients> p_in_coeffs, @@ -44,4 +45,4 @@ private: std::unique_ptr<const ILayerRTCoefficients> m_out_coeffs; }; -#endif // BORNAGAIN_SAMPLE_SCATTERING_COMPUTEDWBA_H +#endif // BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEDWBA_H diff --git a/Sample/FFCompute/ComputeDWBAPol.cpp b/Sample/FFCompute/ComputeDWBAPol.cpp index ba48088698ea3066c1679a0b759c99ce8b688b19..9313b12eb6c07614a1f9b0a7cc6716255cec637b 100644 --- a/Sample/FFCompute/ComputeDWBAPol.cpp +++ b/Sample/FFCompute/ComputeDWBAPol.cpp @@ -43,8 +43,7 @@ ComputeDWBAPol* ComputeDWBAPol::clone() const complex_t ComputeDWBAPol::evaluate(const WavevectorInfo&) const { - throw Exceptions::NotImplementedException( - "ComputeDWBAPol::evaluate: should never be called for matrix interactions"); + throw std::runtime_error("Bug: forbidden call of ComputeDWBAPol::evaluate"); } Eigen::Matrix2cd ComputeDWBAPol::evaluatePol(const WavevectorInfo& wavevectors) const diff --git a/Sample/FFCompute/ComputeDWBAPol.h b/Sample/FFCompute/ComputeDWBAPol.h index 9d7c73bbe2d69080b3e8e74649f3f57e48275161..aa95aaed1e5af3292a3d28e888ed209c7a543d08 100644 --- a/Sample/FFCompute/ComputeDWBAPol.h +++ b/Sample/FFCompute/ComputeDWBAPol.h @@ -12,15 +12,15 @@ // // ************************************************************************************************ -#ifndef BORNAGAIN_SAMPLE_SCATTERING_COMPUTEDWBAPOL_H -#define BORNAGAIN_SAMPLE_SCATTERING_COMPUTEDWBAPOL_H +#ifndef BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEDWBAPOL_H +#define BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEDWBAPOL_H #include "Sample/FFCompute/IComputeFF.h" #include <memory> class ILayerRTCoefficients; -//! Evaluates the coherent sum of the 16 matrix DWBA terms in a polarized IFormFactor. +//! Provides polarized DWBA computation for given IFormFactor. //! @ingroup formfactors_internal @@ -32,10 +32,10 @@ public: ComputeDWBAPol* clone() const override; - //! Throws not-implemented exception + //! Throws not-implemented exception. complex_t evaluate(const WavevectorInfo& wavevectors) const override; - //! Calculates and returns a polarized form factor calculation in DWBA + //! Returns the coherent sum of the four DWBA terms for polarized scattering. Eigen::Matrix2cd evaluatePol(const WavevectorInfo& wavevectors) const override; void setSpecularInfo(std::unique_ptr<const ILayerRTCoefficients> p_in_coeffs, @@ -48,4 +48,4 @@ private: std::unique_ptr<const ILayerRTCoefficients> m_out_coeffs; }; -#endif // BORNAGAIN_SAMPLE_SCATTERING_COMPUTEDWBAPOL_H +#endif // BORNAGAIN_SAMPLE_FFCOMPUTE_COMPUTEDWBAPOL_H diff --git a/Sample/FFCompute/IComputeFF.h b/Sample/FFCompute/IComputeFF.h index ad32fff9fbe7da0486a62fb066588e3440baa482..1ebac9b68e74278380afdd3ecf8a87865c37e0ee 100644 --- a/Sample/FFCompute/IComputeFF.h +++ b/Sample/FFCompute/IComputeFF.h @@ -12,8 +12,8 @@ // // ************************************************************************************************ -#ifndef BORNAGAIN_SAMPLE_SCATTERING_ICOMPUTEFF_H -#define BORNAGAIN_SAMPLE_SCATTERING_ICOMPUTEFF_H +#ifndef BORNAGAIN_SAMPLE_FFCOMPUTE_ICOMPUTEFF_H +#define BORNAGAIN_SAMPLE_FFCOMPUTE_ICOMPUTEFF_H #include "Base/Types/Complex.h" #include <Eigen/Core> @@ -25,6 +25,12 @@ class IRotation; class Material; class WavevectorInfo; +//! Abstract base class for form factor evaluations. +//! +//! Wraps an IFormFactor, and provides functions evaluate or evaluatePol. + +//! @ingroup formfactors_internal + class IComputeFF { @@ -54,4 +60,4 @@ protected: std::unique_ptr<IFormFactor> m_ff; }; -#endif // BORNAGAIN_SAMPLE_SCATTERING_ICOMPUTEFF_H +#endif // BORNAGAIN_SAMPLE_FFCOMPUTE_ICOMPUTEFF_H