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

+ const, rm unused

parent dc3a4ace
No related branches found
No related tags found
1 merge request!177simplify slicing machinery
...@@ -37,7 +37,7 @@ private: ...@@ -37,7 +37,7 @@ private:
double scalarCalculation(const SimulationElement& sim_element) const override; double scalarCalculation(const SimulationElement& sim_element) const override;
double polarizedCalculation(const SimulationElement& sim_element) const override; double polarizedCalculation(const SimulationElement& sim_element) const override;
std::unique_ptr<IInterferenceFunction> m_iff; const std::unique_ptr<IInterferenceFunction> m_iff;
}; };
#endif // BORNAGAIN_RESAMPLE_INTERPARTICLE_DECOUPLINGAPPROXIMATIONSTRATEGY_H #endif // BORNAGAIN_RESAMPLE_INTERPARTICLE_DECOUPLINGAPPROXIMATIONSTRATEGY_H
......
...@@ -17,16 +17,27 @@ ...@@ -17,16 +17,27 @@
#include "Resample/Coherence/FFSum.h" #include "Resample/Coherence/FFSum.h"
#include "Sample/Aggregate/InterferenceFunctionRadialParaCrystal.h" #include "Sample/Aggregate/InterferenceFunctionRadialParaCrystal.h"
namespace {
double meanRadius(const std::vector<CoherentFFSum>& weighted_formfactors)
{
double result = 0.0;
for (const auto& ffw : weighted_formfactors)
result += ffw.relativeAbundance() * ffw.radialExtension();
return result;
}
} // namespace
SSCAStrategy::SSCAStrategy(const std::vector<CoherentFFSum>& weighted_formfactors, SSCAStrategy::SSCAStrategy(const std::vector<CoherentFFSum>& weighted_formfactors,
const InterferenceFunctionRadialParaCrystal* iff, const InterferenceFunctionRadialParaCrystal* iff,
SimulationOptions sim_params, bool polarized, double kappa) SimulationOptions sim_params, bool polarized, double kappa)
: IInterparticleStrategy(weighted_formfactors, sim_params, polarized) : IInterparticleStrategy(weighted_formfactors, sim_params, polarized)
, m_iff(iff->clone()) , m_iff(iff->clone())
, m_kappa(kappa) , m_kappa(kappa)
, m_mean_radius(meanRadius(weighted_formfactors))
{ {
m_mean_radius = 0.0;
for (const auto& ffw : m_weighted_formfactors)
m_mean_radius += ffw.relativeAbundance() * ffw.radialExtension();
} }
//! Returns the total scattering intensity for given kf and //! Returns the total scattering intensity for given kf and
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#define BORNAGAIN_RESAMPLE_INTERPARTICLE_SSCASTRATEGY_H #define BORNAGAIN_RESAMPLE_INTERPARTICLE_SSCASTRATEGY_H
#include "Resample/Interparticle/IInterparticleStrategy.h" #include "Resample/Interparticle/IInterparticleStrategy.h"
#include <Eigen/StdVector>
class InterferenceFunctionRadialParaCrystal; class InterferenceFunctionRadialParaCrystal;
class SimulationElement; class SimulationElement;
...@@ -39,15 +38,13 @@ private: ...@@ -39,15 +38,13 @@ private:
double scalarCalculation(const SimulationElement& sim_element) const override; double scalarCalculation(const SimulationElement& sim_element) const override;
double polarizedCalculation(const SimulationElement& sim_element) const override; double polarizedCalculation(const SimulationElement& sim_element) const override;
void init(const std::vector<CoherentFFSum>& ff_wrappers);
complex_t getCharacteristicSizeCoupling(double qp, complex_t getCharacteristicSizeCoupling(double qp,
const std::vector<CoherentFFSum>& ff_wrappers) const; const std::vector<CoherentFFSum>& ff_wrappers) const;
complex_t calculatePositionOffsetPhase(double qp, double radial_extension) const; complex_t calculatePositionOffsetPhase(double qp, double radial_extension) const;
std::unique_ptr<InterferenceFunctionRadialParaCrystal> m_iff; const std::unique_ptr<InterferenceFunctionRadialParaCrystal> m_iff;
double m_kappa; const double m_kappa;
double m_mean_radius; const double m_mean_radius;
}; };
#endif // BORNAGAIN_RESAMPLE_INTERPARTICLE_SSCASTRATEGY_H #endif // BORNAGAIN_RESAMPLE_INTERPARTICLE_SSCASTRATEGY_H
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment