16using namespace Kernel;
31 : m_crystalStructure(
std::move(crystalStructure)),
33 m_defaultHKLFilter(getReflectionConditionFilter(defaultFilter)) {}
54 return std::make_shared<const HKLFilterStructureFactor>(
m_sfCalculator);
73 if (reflectionConditionFilter) {
74 filter = filter & reflectionConditionFilter;
77 std::vector<V3D> hkls;
78 hkls.reserve(generator.
size());
80 std::remove_copy_if(generator.
begin(), generator.
end(), std::back_inserter(hkls), (~filter)->fn());
97 if (reflectionConditionFilter) {
98 filter = filter & reflectionConditionFilter;
101 std::vector<V3D> hkls;
102 hkls.reserve(generator.
size());
106 for (
auto hkl = generator.
begin(); hkl != generator.
end(); ++hkl) {
107 if (filter->isAllowed(*hkl)) {
108 hkls.emplace_back(pg->getReflectionFamily(*hkl));
112 std::sort(hkls.begin(), hkls.end());
113 hkls.erase(std::unique(hkls.begin(), hkls.end()), hkls.end());
121 std::vector<double> dValues;
122 dValues.reserve(hkls.size());
124 std::transform(hkls.begin(), hkls.end(), std::back_inserter(dValues),
Three components are required to describe a crystal structure:
UnitCell cell() const
Returns the unit cell of the structure.
ReflectionCondition_sptr centering() const
SpaceGroup_const_sptr spaceGroup() const
Returns the space group of the crystal structure.
const const_iterator & end() const
Returns an iterator which "points at" one element past the end.
const const_iterator & begin() const
Returns an iterator to the beginning of the sequence.
size_t size() const
Returns the number of HKLs to be generated.
Small helper functor to calculate d-Values from a unit cell.
double operator()(const V3D &hkl)
LatticeSpacingCalculator(const UnitCell &cell)
ReflectionGenerator(CrystalStructure crystalStructure, ReflectionConditionFilter defaultFilter=ReflectionConditionFilter::SpaceGroup)
Constructor.
std::vector< Kernel::V3D > getHKLs(double dMin, double dMax) const
Returns a list of HKLs within the specified d-limits using the default reflection condition filter.
HKLFilter_const_sptr getReflectionConditionFilter(ReflectionConditionFilter filter) const
Returns a reflection condition HKLFilter based on the supplied enum.
CrystalStructure m_crystalStructure
std::vector< double > getFsSquared(const std::vector< Kernel::V3D > &hkls) const
Returns a list of squared structure factor amplitudes corresponding to the supplied list of HKLs.
std::vector< Kernel::V3D > getUniqueHKLs(double dMin, double dMax) const
Returns a list of symetrically independent HKLs within the specified d-limits using the default refle...
std::vector< double > getDValues(const std::vector< Kernel::V3D > &hkls) const
Returns a list of d-values that correspond to the supplied hkl list, using the unit cell of the store...
StructureFactorCalculator_sptr m_sfCalculator
HKLFilter_const_sptr getDRangeFilter(double dMin, double dMax) const
Returns a DRangeFilter from the supplied d-limits and the internally stored cell.
const CrystalStructure & getCrystalStructure() const
Returns the internally stored crystal structure.
HKLFilter_const_sptr m_defaultHKLFilter
StructureFactorCalculatorSummation.
Class to implement unit cell of crystals.
double d(double h, double k, double l) const
Return d-spacing ( ) for a given h,k,l coordinate.
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< const HKLFilter > HKLFilter_const_sptr
ReflectionConditionFilter
std::shared_ptr< PointGroup > PointGroup_sptr
Shared pointer to a PointGroup.