Skip to content
Snippets Groups Projects
Commit 5e6e2f7f authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

ditto for IComputeScalar

parent 14711d58
No related branches found
No related tags found
1 merge request!203Simplify things below IComputeFF
......@@ -15,6 +15,7 @@
#include "Resample/FFCompute/ComputeBA.h"
#include "Base/Vector/WavevectorInfo.h"
#include "Sample/Scattering/IFormFactor.h"
#include "Resample/Element/DiffuseElement.h"
ComputeBA::ComputeBA(const IFormFactor& ff, size_t i_layer) : IComputeScalar(ff, i_layer) {}
......@@ -25,9 +26,8 @@ ComputeBA* ComputeBA::clone() const
return new ComputeBA(*m_ff, m_i_layer);
}
complex_t ComputeBA::computeFF(const WavevectorInfo& wavevectors,
const std::unique_ptr<const IFlux>&,
const std::unique_ptr<const IFlux>&) const
complex_t ComputeBA::coherentFF(const DiffuseElement& ele) const
{
const WavevectorInfo& wavevectors = ele.wavevectorInfo();
return m_ff->theFF(wavevectors);
}
......@@ -33,9 +33,7 @@ public:
ComputeBA* clone() const override;
//! Calculates and returns a form factor calculation in BA
complex_t computeFF(const WavevectorInfo& wavevectors,
const std::unique_ptr<const IFlux>& inFlux,
const std::unique_ptr<const IFlux>& outFlux) const override;
complex_t coherentFF(const DiffuseElement& ele) const override;
};
#endif // BORNAGAIN_RESAMPLE_FFCOMPUTE_COMPUTEBA_H
......
......@@ -14,6 +14,7 @@
#include "Resample/FFCompute/ComputeDWBA.h"
#include "Base/Vector/WavevectorInfo.h"
#include "Resample/Element/DiffuseElement.h"
#include "Resample/Flux/IFlux.h"
#include "Sample/Scattering/IFormFactor.h"
......@@ -26,10 +27,12 @@ ComputeDWBA* ComputeDWBA::clone() const
return new ComputeDWBA(*m_ff, m_i_layer);
}
complex_t ComputeDWBA::computeFF(const WavevectorInfo& wavevectors,
const std::unique_ptr<const IFlux>& inFlux,
const std::unique_ptr<const IFlux>& outFlux) const
complex_t ComputeDWBA::coherentFF(const DiffuseElement& ele) const
{
const WavevectorInfo& wavevectors = ele.wavevectorInfo();
const IFlux* inFlux = ele.fluxesIn()[m_i_layer].get();
const IFlux* outFlux = ele.fluxesOut()[m_i_layer].get();
// Retrieve the two different incoming wavevectors in the layer
const cvector_t& ki = wavevectors.getKi();
const complex_t kiz = inFlux->getScalarKz();
......
......@@ -35,9 +35,7 @@ public:
ComputeDWBA* clone() const override;
//! Returns the coherent sum of the four DWBA terms for scalar scattering.
complex_t computeFF(const WavevectorInfo& wavevectors,
const std::unique_ptr<const IFlux>& inFlux,
const std::unique_ptr<const IFlux>& outFlux) const override;
complex_t coherentFF(const DiffuseElement& ele) const override;
friend class TestPolarizedDWBATerm;
};
......
// ************************************************************************************************
//
// BornAgain: simulate and fit reflection and scattering
//
//! @file Resample/FFCompute/IComputeScalar.cpp
//! @brief Implements class ComputeBA.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************************************
#include "Resample/FFCompute/IComputeScalar.h"
#include "Base/Vector/WavevectorInfo.h"
#include "Resample/Element/DiffuseElement.h"
#include "Resample/Flux/IFlux.h"
complex_t IComputeScalar::coherentFF(const DiffuseElement& ele) const
{
return computeFF(ele.wavevectorInfo(), ele.fluxesIn()[m_i_layer], ele.fluxesOut()[m_i_layer]);
}
......@@ -31,10 +31,7 @@ class WavevectorInfo;
class IComputeScalar : public IComputeFF {
public:
virtual complex_t computeFF(const WavevectorInfo& wavevectors,
const std::unique_ptr<const IFlux>& inFlux,
const std::unique_ptr<const IFlux>& outFlux) const = 0;
complex_t coherentFF(const DiffuseElement& sim_element) const;
virtual complex_t coherentFF(const DiffuseElement& sim_element) const = 0;
protected:
IComputeScalar(const IFormFactor& ff, size_t i_layer) : IComputeFF(ff, i_layer) {}
......
......@@ -42,7 +42,7 @@ C++ includes: ComputeBA.h
%feature("docstring") ComputeBA::clone "ComputeBA * ComputeBA::clone() const override
";
%feature("docstring") ComputeBA::computeFF "complex_t ComputeBA::computeFF(const WavevectorInfo &wavevectors, const std::unique_ptr< const IFlux > &inFlux, const std::unique_ptr< const IFlux > &outFlux) const override
%feature("docstring") ComputeBA::coherentFF "complex_t ComputeBA::coherentFF(const DiffuseElement &ele) const override
Calculates and returns a form factor calculation in BA.
";
......@@ -88,7 +88,7 @@ C++ includes: ComputeDWBA.h
%feature("docstring") ComputeDWBA::clone "ComputeDWBA * ComputeDWBA::clone() const override
";
%feature("docstring") ComputeDWBA::computeFF "complex_t ComputeDWBA::computeFF(const WavevectorInfo &wavevectors, const std::unique_ptr< const IFlux > &inFlux, const std::unique_ptr< const IFlux > &outFlux) const override
%feature("docstring") ComputeDWBA::coherentFF "complex_t ComputeDWBA::coherentFF(const DiffuseElement &ele) const override
Returns the coherent sum of the four DWBA terms for scalar scattering.
";
......@@ -282,10 +282,7 @@ Provides scalar form factor evaluation for given IFormFactor. Inherited by Comp
C++ includes: IComputeScalar.h
";
%feature("docstring") IComputeScalar::computeFF "virtual complex_t IComputeScalar::computeFF(const WavevectorInfo &wavevectors, const std::unique_ptr< const IFlux > &inFlux, const std::unique_ptr< const IFlux > &outFlux) const =0
";
%feature("docstring") IComputeScalar::coherentFF "complex_t IComputeScalar::coherentFF(const DiffuseElement &sim_element) const
%feature("docstring") IComputeScalar::coherentFF "virtual complex_t IComputeScalar::coherentFF(const DiffuseElement &sim_element) const =0
";
......@@ -926,31 +923,31 @@ C++ includes: SSCAStrategy.h
// File: namespace_0d10.xml
// File: namespace_0d18.xml
// File: namespace_0d17.xml
// File: namespace_0d26.xml
// File: namespace_0d25.xml
// File: namespace_0d30.xml
// File: namespace_0d29.xml
// File: namespace_0d32.xml
// File: namespace_0d31.xml
// File: namespace_0d34.xml
// File: namespace_0d33.xml
// File: namespace_0d36.xml
// File: namespace_0d35.xml
// File: namespace_0d38.xml
// File: namespace_0d37.xml
// File: namespace_0d45.xml
// File: namespace_0d44.xml
// File: namespace_0d47.xml
// File: namespace_0d46.xml
// File: namespaceSampleUtils.xml
......@@ -1045,9 +1042,6 @@ Get default z limits for generating a material profile.
// File: IComputePol_8h.xml
// File: IComputeScalar_8cpp.xml
// File: IComputeScalar_8h.xml
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment