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

Refactoring: NanoParticleCrystalFormFactor -> CrystalFormFactor

parent 18612bee
Branches
Tags
No related merge requests found
...@@ -73,7 +73,7 @@ SOURCES += \ ...@@ -73,7 +73,7 @@ SOURCES += \
Samples/src/Particle.cpp \ Samples/src/Particle.cpp \
Samples/src/ParticleBuilder.cpp \ Samples/src/ParticleBuilder.cpp \
Samples/src/Crystal.cpp \ Samples/src/Crystal.cpp \
Samples/src/NanoParticleCrystalFormFactor.cpp \ Samples/src/CrystalFormFactor.cpp \
Samples/src/ParticleDecoration.cpp \ Samples/src/ParticleDecoration.cpp \
Samples/src/ParticleInfo.cpp \ Samples/src/ParticleInfo.cpp \
Samples/src/ParameterPool.cpp \ Samples/src/ParameterPool.cpp \
...@@ -174,7 +174,7 @@ HEADERS += \ ...@@ -174,7 +174,7 @@ HEADERS += \
Samples/inc/Particle.h \ Samples/inc/Particle.h \
Samples/inc/ParticleBuilder.h \ Samples/inc/ParticleBuilder.h \
Samples/inc/Crystal.h \ Samples/inc/Crystal.h \
Samples/inc/NanoParticleCrystalFormFactor.h \ Samples/inc/CrystalFormFactor.h \
Samples/inc/ParticleDecoration.h \ Samples/inc/ParticleDecoration.h \
Samples/inc/ParticleInfo.h \ Samples/inc/ParticleInfo.h \
Samples/inc/ParameterPool.h \ Samples/inc/ParameterPool.h \
......
#ifndef NANOPARTICLECRYSTALFORMFACTOR_H_ #ifndef CRYSTALFORMFACTOR_H_
#define NANOPARTICLECRYSTALFORMFACTOR_H_ #define CRYSTALFORMFACTOR_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,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// * 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 NanoParticleCrystalFormFactor.h //! @file CrystalFormFactor.h
//! @brief Definition of NanoParticleCrystalFormFactor //! @brief Definition of NanoParticleCrystalFormFactor
//! @author Scientific Computing Group at FRM II //! @author Scientific Computing Group at FRM II
//! @date Jul 12, 2012 //! @date Jul 12, 2012
...@@ -19,17 +19,17 @@ ...@@ -19,17 +19,17 @@
#include "Types.h" #include "Types.h"
//- ------------------------------------------------------------------- //- -------------------------------------------------------------------
//! @class NanoParticleCrystalFormFactor //! @class CrystalFormFactor
//! @brief Definition of a form factor for mesocrystals with a bulk crystal structure of nano particles //! @brief Definition of a form factor for mesocrystals with a bulk crystal structure of particles
//- ------------------------------------------------------------------- //- -------------------------------------------------------------------
class NanoParticleCrystalFormFactor : public IBornFormFactor class CrystalFormFactor : public IBornFormFactor
{ {
public: public:
NanoParticleCrystalFormFactor(const Crystal *p_crystal, CrystalFormFactor(const Crystal *p_crystal,
const IFormFactor &meso_crystal_form_factor, complex_t ambient_refractive_index); const IFormFactor &meso_crystal_form_factor, complex_t ambient_refractive_index);
virtual ~NanoParticleCrystalFormFactor(); virtual ~CrystalFormFactor();
virtual NanoParticleCrystalFormFactor *clone() const; virtual CrystalFormFactor *clone() const;
virtual void setAmbientRefractiveIndex(complex_t refractive_index); virtual void setAmbientRefractiveIndex(complex_t refractive_index);
...@@ -37,15 +37,13 @@ protected: ...@@ -37,15 +37,13 @@ protected:
virtual complex_t evaluate_for_q(cvector_t q) const; virtual complex_t evaluate_for_q(cvector_t q) const;
private: private:
void calculateLargestReciprocalDistance(); void calculateLargestReciprocalDistance();
// void initializeDiffuseNanoparticleFormfactors();
Lattice m_lattice; Lattice m_lattice;
Particle *mp_particle; Particle *mp_particle;
IFormFactor *mp_basis_form_factor; IFormFactor *mp_basis_form_factor;
IFormFactor *mp_meso_form_factor; IFormFactor *mp_meso_form_factor;
complex_t m_ambient_refractive_index; complex_t m_ambient_refractive_index;
double m_max_rec_length; double m_max_rec_length;
// std::vector<IFormFactor *> m_diffuse_nanoparticle_ffs;
}; };
#endif /* NANOPARTICLECRYSTALFORMFACTOR_H_ */ #endif /* CRYSTALFORMFACTOR_H_ */
#include "Crystal.h" #include "Crystal.h"
#include "NanoParticleCrystalFormFactor.h" #include "CrystalFormFactor.h"
#include "FormFactorDecoratorDebyeWaller.h" #include "FormFactorDecoratorDebyeWaller.h"
#include "Units.h" #include "Units.h"
#include "MathFunctions.h" #include "MathFunctions.h"
...@@ -32,7 +32,7 @@ IFormFactor* Crystal::createTotalFormFactor( ...@@ -32,7 +32,7 @@ IFormFactor* Crystal::createTotalFormFactor(
const IFormFactor& meso_crystal_form_factor, const IFormFactor& meso_crystal_form_factor,
complex_t ambient_refractive_index) const complex_t ambient_refractive_index) const
{ {
IFormFactor *p_npcrystal = new NanoParticleCrystalFormFactor(this, meso_crystal_form_factor, ambient_refractive_index); IFormFactor *p_npcrystal = new CrystalFormFactor(this, meso_crystal_form_factor, ambient_refractive_index);
if (m_dw_factor>0.0) { if (m_dw_factor>0.0) {
return new FormFactorDecoratorDebyeWaller(p_npcrystal, m_dw_factor); return new FormFactorDecoratorDebyeWaller(p_npcrystal, m_dw_factor);
} }
......
#include "NanoParticleCrystalFormFactor.h" #include "CrystalFormFactor.h"
#include "Units.h" #include "Units.h"
NanoParticleCrystalFormFactor::NanoParticleCrystalFormFactor( CrystalFormFactor::CrystalFormFactor(
const Crystal* p_crystal, const Crystal* p_crystal,
const IFormFactor& meso_crystal_form_factor, const IFormFactor& meso_crystal_form_factor,
complex_t ambient_refractive_index) complex_t ambient_refractive_index)
...@@ -16,28 +16,28 @@ NanoParticleCrystalFormFactor::NanoParticleCrystalFormFactor( ...@@ -16,28 +16,28 @@ NanoParticleCrystalFormFactor::NanoParticleCrystalFormFactor(
calculateLargestReciprocalDistance(); calculateLargestReciprocalDistance();
} }
NanoParticleCrystalFormFactor::~NanoParticleCrystalFormFactor() CrystalFormFactor::~CrystalFormFactor()
{ {
delete mp_particle; delete mp_particle;
delete mp_meso_form_factor; delete mp_meso_form_factor;
} }
NanoParticleCrystalFormFactor* NanoParticleCrystalFormFactor::clone() const CrystalFormFactor* CrystalFormFactor::clone() const
{ {
Crystal np_crystal(*mp_particle, m_lattice); Crystal np_crystal(*mp_particle, m_lattice);
NanoParticleCrystalFormFactor *p_new = new NanoParticleCrystalFormFactor(&np_crystal, CrystalFormFactor *p_new = new CrystalFormFactor(&np_crystal,
*mp_meso_form_factor, m_ambient_refractive_index); *mp_meso_form_factor, m_ambient_refractive_index);
return p_new; return p_new;
} }
void NanoParticleCrystalFormFactor::setAmbientRefractiveIndex( void CrystalFormFactor::setAmbientRefractiveIndex(
complex_t refractive_index) complex_t refractive_index)
{ {
mp_particle->setAmbientRefractiveIndex(refractive_index); mp_particle->setAmbientRefractiveIndex(refractive_index);
mp_basis_form_factor->setAmbientRefractiveIndex(refractive_index); mp_basis_form_factor->setAmbientRefractiveIndex(refractive_index);
} }
complex_t NanoParticleCrystalFormFactor::evaluate_for_q(cvector_t q) const complex_t CrystalFormFactor::evaluate_for_q(cvector_t q) const
{ {
// construct a real reciprocal vector // construct a real reciprocal vector
kvector_t q_real(q.x().real(), q.y().real(), q.z().real()); kvector_t q_real(q.x().real(), q.y().real(), q.z().real());
...@@ -62,7 +62,7 @@ complex_t NanoParticleCrystalFormFactor::evaluate_for_q(cvector_t q) const ...@@ -62,7 +62,7 @@ complex_t NanoParticleCrystalFormFactor::evaluate_for_q(cvector_t q) const
return 8.0*pi3*result/volume; return 8.0*pi3*result/volume;
} }
void NanoParticleCrystalFormFactor::calculateLargestReciprocalDistance() void CrystalFormFactor::calculateLargestReciprocalDistance()
{ {
kvector_t a1 = m_lattice.getBasisVectorA(); kvector_t a1 = m_lattice.getBasisVectorA();
kvector_t a2 = m_lattice.getBasisVectorB(); kvector_t a2 = m_lattice.getBasisVectorB();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment