31 unsigned N_1,
unsigned N_2)
34 setName(
"InterferenceFinite2DLattice");
47 double alpha,
double xi,
48 unsigned N_1,
unsigned N_2)
96 throw std::runtime_error(
"InterferenceFunctionFinite2DLattice::lattice() -> Error. "
97 "No lattice defined.");
104 return area == 0.0 ? 0.0 : 1.0 / area;
109 return std::vector<const INode*>() <<
mP_lattice;
133 double xialpha = xi +
mP_lattice->latticeAngle();
135 double qadiv2 = (
m_qx * a * std::cos(xi) +
m_qy * a * std::sin(xi)) / 2.0;
136 double qbdiv2 = (
m_qx * b * std::cos(xialpha) +
m_qy * b * std::sin(xialpha)) / 2.0;
138 double lattice_factor = ampl * ampl / (
m_N_1 *
m_N_2);
140 return lattice_factor;
Defines many exception classes in namespace Exceptionss.
Defines classes RealIntegrator, ComplexIntegrator.
Defines class InterferenceFunctionFinite2DLattice.
Defines M_PI and some more mathematical constants.
Defines namespace MathFunctions.
Defines class RealParameter.
T y() const
Returns y-component in cartesian coordinate system.
T x() const
Returns x-component in cartesian coordinate system.
Pure virtual base class of interference functions.
void registerChild(INode *node)
void setName(const std::string &name)
Interference function of a finite 2D lattice.
void setIntegrationOverXi(bool integrate_xi)
bool m_integrate_xi
Integrate over the orientation xi.
bool integrationOverXi() const
unsigned m_N_2
Size of the finite lattice in lattice units.
InterferenceFunctionFinite2DLattice(const Lattice2D &lattice, unsigned N_1, unsigned N_2)
Constructor of two-dimensional finite lattice interference function.
const Lattice2D & lattice() const
double interferenceForXi(double xi) const
void setLattice(const Lattice2D &lattice)
~InterferenceFunctionFinite2DLattice() final
InterferenceFunctionFinite2DLattice * clone() const override final
Returns a clone of this ISample object.
std::unique_ptr< Lattice2D > mP_lattice
double getParticleDensity() const override final
Returns the particle density associated with this 2d lattice.
static InterferenceFunctionFinite2DLattice * createSquare(double lattice_length, double xi, unsigned N_1, unsigned N_2)
Creates square lattice.
static InterferenceFunctionFinite2DLattice * createHexagonal(double lattice_length, double xi, unsigned N_1, unsigned N_2)
Creates hexagonal lattice.
std::vector< const INode * > getChildren() const override final
Returns a vector of children (const).
double iff_without_dw(const kvector_t q) const override final
Calculates the structure factor without Debye-Waller factor.
virtual Lattice2D * clone() const =0
To integrate a real function of a real variable.
double integrate(const std::function< double(double)> &f, double lmin, double lmax)
double Laue(const double x, size_t N)
Real Laue function: .