Mantid
Loading...
Searching...
No Matches
StructureFactorCalculator.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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 +
7#pragma once
8
10#include "MantidGeometry/DllConfig.h"
11
12namespace Mantid {
13namespace Geometry {
14
25class MANTID_GEOMETRY_DLL StructureFactorCalculator {
26public:
27 virtual ~StructureFactorCalculator() = default;
28
29 void setCrystalStructure(const CrystalStructure &crystalStructure);
30
33 virtual StructureFactor getF(const Kernel::V3D &hkl) const = 0;
34 virtual double getFSquared(const Kernel::V3D &hkl) const;
35
36 virtual std::vector<StructureFactor> getFs(const std::vector<Kernel::V3D> &hkls) const;
37 virtual std::vector<double> getFsSquared(const std::vector<Kernel::V3D> &hkls) const;
38
39protected:
40 virtual void crystalStructureSetHook(const CrystalStructure &crystalStructure);
41};
42
43using StructureFactorCalculator_sptr = std::shared_ptr<StructureFactorCalculator>;
44
45namespace StructureFactorCalculatorFactory {
48template <typename T> StructureFactorCalculator_sptr create(const CrystalStructure &crystalStructure) {
49 std::shared_ptr<T> calculator = std::make_shared<T>();
50 calculator->setCrystalStructure(crystalStructure);
51
52 return calculator;
53}
54} // namespace StructureFactorCalculatorFactory
55
56} // namespace Geometry
57} // namespace Mantid
Three components are required to describe a crystal structure:
virtual StructureFactor getF(const Kernel::V3D &hkl) const =0
In implementations this method should return the structure factor for the specified HKL.
Class for 3D vectors.
Definition: V3D.h:34
std::unique_ptr< T > create(const P &parent, const IndexArg &indexArg, const HistArg &histArg)
This is the create() method that all the other create() methods call.
std::shared_ptr< StructureFactorCalculator > StructureFactorCalculator_sptr
std::complex< double > StructureFactor
Helper class which provides the Collimation Length for SANS instruments.