Skip to content
Snippets Groups Projects
Commit b0c3c442 authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Added interfaces for nano particle decorators

parent c11346a6
No related branches found
No related tags found
No related merge requests found
...@@ -136,7 +136,7 @@ void TestDiffuseReflection::draw() ...@@ -136,7 +136,7 @@ void TestDiffuseReflection::draw()
{ {
double alpha_i = m_data_spec->getCurrentValueOfAxis<double>("alpha_i"); double alpha_i = m_data_spec->getCurrentValueOfAxis<double>("alpha_i");
double r = m_data_spec->next(); double r = m_data_spec->next();
gr->SetPoint(m_data_spec->getCoordinate("alpha_i"), Units::rad2deg(alpha_i), r); gr->SetPoint(m_data_spec->getCurrentIndexOfAxis("alpha_i"), Units::rad2deg(alpha_i), r);
} }
// off specular plot // off specular plot
......
...@@ -28,7 +28,6 @@ SOURCES += \ ...@@ -28,7 +28,6 @@ SOURCES += \
src/MaterialManager.cpp \ src/MaterialManager.cpp \
src/StochasticGaussian.cpp \ src/StochasticGaussian.cpp \
src/MathFunctions.cpp \ src/MathFunctions.cpp \
src/DispersedParticleDecorator.cpp \
src/FormFactorCylinder.cpp \ src/FormFactorCylinder.cpp \
src/Types.cpp \ src/Types.cpp \
src/DoubleToComplexInterpolatingFunction.cpp \ src/DoubleToComplexInterpolatingFunction.cpp \
...@@ -36,7 +35,8 @@ SOURCES += \ ...@@ -36,7 +35,8 @@ SOURCES += \
src/ISingleton.cpp \ src/ISingleton.cpp \
src/IFunctionalTest.cpp \ src/IFunctionalTest.cpp \
src/IFactory.cpp \ src/IFactory.cpp \
src/DWBADiffuseReflection.cpp src/DWBADiffuseReflection.cpp \
src/NanoParticleDecorator.cpp
HEADERS += \ HEADERS += \
inc/ISample.h \ inc/ISample.h \
...@@ -60,7 +60,6 @@ HEADERS += \ ...@@ -60,7 +60,6 @@ HEADERS += \
inc/IStochasticParameter.h \ inc/IStochasticParameter.h \
inc/StochasticGaussian.h \ inc/StochasticGaussian.h \
inc/MathFunctions.h \ inc/MathFunctions.h \
inc/DispersedParticleDecorator.h \
inc/IFormFactor.h \ inc/IFormFactor.h \
inc/FormFactorCylinder.h \ inc/FormFactorCylinder.h \
inc/StochasticDiracDelta.h \ inc/StochasticDiracDelta.h \
...@@ -72,7 +71,9 @@ HEADERS += \ ...@@ -72,7 +71,9 @@ HEADERS += \
inc/IFunctionalTest.h \ inc/IFunctionalTest.h \
inc/IFactory.h \ inc/IFactory.h \
inc/Numeric.h \ inc/Numeric.h \
inc/DWBADiffuseReflection.h inc/DWBADiffuseReflection.h \
inc/NanoParticleDecorator.h \
inc/IDispersalState.h
INCLUDEPATH += /opt/local/include ./inc INCLUDEPATH += /opt/local/include ./inc
DEPENDPATH += ./inc DEPENDPATH += ./inc
......
#ifndef DISPERSEDPARTICLEDECORATOR_H #ifndef IDISPERSALSTATE_H_
#define DISPERSEDPARTICLEDECORATOR_H #define IDISPERSALSTATE_H_
// ******************************************************************** // ********************************************************************
// * The BornAgain project * // * The BornAgain project *
// * Simulation of neutron and x-ray scattering at grazing incidence * // * Simulation of neutron and x-ray scattering at grazing incidence *
...@@ -9,25 +9,22 @@ ...@@ -9,25 +9,22 @@
// * eget quam orci. Quisque porta varius dui, quis posuere nibh * // * eget quam orci. Quisque porta varius dui, quis posuere nibh *
// * mollis quis. Mauris commodo rhoncus porttitor. * // * mollis quis. Mauris commodo rhoncus porttitor. *
// ******************************************************************** // ********************************************************************
//! @file DispersedParticleDecorator.h //! @file IDispersalState.h
//! @brief Defenition of DispersedParticleDecorator //! @brief Definition of IDispersalState
//! @author Scientific Computing Group at FRM II //! @author Scientific Computing Group at FRM II
//! @date 01.05.2012 //! @date 12.06.2012
#include "ISample.h" //- -------------------------------------------------------------------
//! @class IDispersalState
//! @brief Definition of IDispersalState interface
class DispersedParticleDecorator : public ISample //- -------------------------------------------------------------------
class IDispersalState
{ {
public: public:
DispersedParticleDecorator(ISample* p_sub_sample); virtual ~IDispersalState() {}
virtual ~DispersedParticleDecorator() {}
ISample* getSubSample() const { return mp_sub_sample; } };
private:
ISample* mp_sub_sample;
};
#endif // DISPERSEDPARTICLEDECORATOR_H #endif /* IDISPERSALSTATE_H_ */
...@@ -10,19 +10,30 @@ ...@@ -10,19 +10,30 @@
// * mollis quis. Mauris commodo rhoncus porttitor. * // * mollis quis. Mauris commodo rhoncus porttitor. *
// ******************************************************************** // ********************************************************************
//! @file IFormFactor.h //! @file IFormFactor.h
//! @brief Definition of IFormFactor //! @brief Definition of IFormFactor and IBornFormFactor
//! @author Scientific Computing Group at FRM II //! @author Scientific Computing Group at FRM II
//! @date 01.04.2012 //! @date 01.04.2012
#include "Types.h" #include "Types.h"
//- -------------------------------------------------------------------
//! @class IFormFactor
//! @brief Definition of IFormfactor interface
//- -------------------------------------------------------------------
class IFormFactor class IFormFactor
{ {
public: public:
virtual ~IFormFactor() {} virtual ~IFormFactor() {}
/// calculate scattering amplitude
///
/// calculate scattering amplitude
/// @param k_i incoming wavevector
/// @param k_f outgoing wavevector
virtual complex_t evaluate(kvector_t k_i, kvector_t k_f) const=0; virtual complex_t evaluate(kvector_t k_i, kvector_t k_f) const=0;
/// return number of variable/stochastic parameters
virtual int getNumberOfStochasticParameters() { return 0; } virtual int getNumberOfStochasticParameters() { return 0; }
}; };
...@@ -36,6 +47,8 @@ public: ...@@ -36,6 +47,8 @@ public:
return evaluate_for_q(k_i - k_f); return evaluate_for_q(k_i - k_f);
} }
protected: protected:
/// evaluate scattering amplitude
/// @param q wavevector transfer \f$q\equiv k_i-k_f\f$
virtual complex_t evaluate_for_q(kvector_t q) const=0; virtual complex_t evaluate_for_q(kvector_t q) const=0;
}; };
......
...@@ -32,7 +32,7 @@ public: ...@@ -32,7 +32,7 @@ public:
Layer &operator=(const Layer &other); Layer &operator=(const Layer &other);
virtual ~Layer(); virtual ~Layer();
//! make layer's clone /// make layer's clone
virtual Layer *clone() const; virtual Layer *clone() const;
/// set layer thickness in _angstrom_ /// set layer thickness in _angstrom_
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
#include "IFormFactor.h" #include "IFormFactor.h"
//- -------------------------------------------------------------------
//! @class NanoParticle
//! @brief Definition of a nanoparticle with a form factor
//- -------------------------------------------------------------------
class NanoParticle : public ISample class NanoParticle : public ISample
{ {
public: public:
...@@ -25,7 +29,7 @@ public: ...@@ -25,7 +29,7 @@ public:
virtual ~NanoParticle(); virtual ~NanoParticle();
private: private:
IFormFactor* mp_form_factor; IFormFactor* mp_form_factor; ///< pointer to the form factor
}; };
#endif // NANOPARTICLE_H #endif // NANOPARTICLE_H
#ifndef NANOPARTICLEDECORATOR_H
#define NANOPARTICLEDECORATOR_H
// ********************************************************************
// * The BornAgain project *
// * Simulation of neutron and x-ray scattering at grazing incidence *
// * *
// * LICENSE AND DISCLAIMER *
// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris *
// * eget quam orci. Quisque porta varius dui, quis posuere nibh *
// * mollis quis. Mauris commodo rhoncus porttitor. *
// ********************************************************************
//! @file NanoParticleDecorator.h
//! @brief Definition of NanoParticleDecorator
//! @author Scientific Computing Group at FRM II
//! @date 23.05.2012
#include "NanoParticle.h"
//- -------------------------------------------------------------------
//! @class NanoParticleDecorator
//! @brief Definition of decorator class that adds nano particles to ISample objects
//- -------------------------------------------------------------------
class NanoParticleDecorator : public ISample
{
public:
NanoParticleDecorator(ISample *p_sub_sample);
virtual ~NanoParticleDecorator() {}
/// Return decorated sample
ISample* getSubSample() const { return mp_sub_sample; }
private:
std::vector<NanoParticle *> m_particles; ///< Vector of the types of nano particles
ISample* mp_sub_sample; ///< Decorated ISample object
};
#endif // NANOPARTICLEDECORATOR_H
#include "DispersedParticleDecorator.h"
DispersedParticleDecorator::DispersedParticleDecorator(ISample *p_sub_sample)
: mp_sub_sample(p_sub_sample)
{
}
#include "NanoParticleDecorator.h"
/* ************************************************************************* */
NanoParticleDecorator::NanoParticleDecorator(ISample *p_sub_sample)
: mp_sub_sample(p_sub_sample)
{
}
/* ************************************************************************* */
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