Mantid
Loading...
Searching...
No Matches
StructureFactorCalculator.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8
9namespace Mantid::Geometry {
10
23 crystalStructureSetHook(crystalStructure);
24}
25
28 StructureFactor sf = getF(hkl);
29
30 return sf.real() * sf.real() + sf.imag() * sf.imag();
31}
32
43std::vector<StructureFactor> StructureFactorCalculator::getFs(const std::vector<Kernel::V3D> &hkls) const {
44 std::vector<StructureFactor> structureFactors(hkls.size());
45 using namespace std::placeholders;
46 std::transform(hkls.begin(), hkls.end(), structureFactors.begin(),
47 std::bind(&StructureFactorCalculator::getF, this, _1));
48
49 return structureFactors;
50}
51
62std::vector<double> StructureFactorCalculator::getFsSquared(const std::vector<Kernel::V3D> &hkls) const {
63 std::vector<double> fSquareds(hkls.size());
64 using namespace std::placeholders;
65 std::transform(hkls.begin(), hkls.end(), fSquareds.begin(),
66 std::bind(&StructureFactorCalculator::getFSquared, this, _1));
67
68 return fSquareds;
69}
70
75 UNUSED_ARG(crystalStructure)
76}
77
78} // namespace Mantid::Geometry
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Definition: System.h:64
Three components are required to describe a crystal structure:
virtual std::vector< StructureFactor > getFs(const std::vector< Kernel::V3D > &hkls) const
Returns structure factors for each HKL in the container.
virtual double getFSquared(const Kernel::V3D &hkl) const
Returns F^2 for the given HKL, calling StructureFactorCalculator::getF().
void setCrystalStructure(const CrystalStructure &crystalStructure)
Sets the crystal structure for which to calculate structure factors.
virtual StructureFactor getF(const Kernel::V3D &hkl) const =0
In implementations this method should return the structure factor for the specified HKL.
virtual void crystalStructureSetHook(const CrystalStructure &crystalStructure)
This function is called from StructureFactorCalculator::setCrystalStructure() and can be overriden to...
virtual std::vector< double > getFsSquared(const std::vector< Kernel::V3D > &hkls) const
Returns structure factors for each HKL in the container.
Class for 3D vectors.
Definition: V3D.h:34
std::complex< double > StructureFactor