Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::Geometry::ReflectionGenerator Class Reference

ReflectionGenerator. More...

#include <ReflectionGenerator.h>

Public Member Functions

const CrystalStructuregetCrystalStructure () const
 Returns the internally stored crystal structure. More...
 
HKLFilter_const_sptr getDRangeFilter (double dMin, double dMax) const
 Returns a DRangeFilter from the supplied d-limits and the internally stored cell. More...
 
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 stored crystal structure. More...
 
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. More...
 
std::vector< Kernel::V3DgetHKLs (double dMin, double dMax) const
 Returns a list of HKLs within the specified d-limits using the default reflection condition filter. More...
 
std::vector< Kernel::V3DgetHKLs (double dMin, double dMax, const HKLFilter_const_sptr &reflectionConditionFilter) const
 Returns a list of HKLs within the specified d-limits using the specified filter. More...
 
HKLFilter_const_sptr getReflectionConditionFilter (ReflectionConditionFilter filter) const
 Returns a reflection condition HKLFilter based on the supplied enum. More...
 
std::vector< Kernel::V3DgetUniqueHKLs (double dMin, double dMax) const
 Returns a list of symetrically independent HKLs within the specified d-limits using the default reflection condition filter. More...
 
std::vector< Kernel::V3DgetUniqueHKLs (double dMin, double dMax, const HKLFilter_const_sptr &reflectionConditionFilter) const
 Returns a list of symetrically independent HKLs within the specified d-limits using the specified reflection condition filter. More...
 
 ReflectionGenerator (CrystalStructure crystalStructure, ReflectionConditionFilter defaultFilter=ReflectionConditionFilter::SpaceGroup)
 Constructor. More...
 

Private Attributes

CrystalStructure m_crystalStructure
 
HKLFilter_const_sptr m_defaultHKLFilter
 
StructureFactorCalculator_sptr m_sfCalculator
 

Detailed Description

ReflectionGenerator.

ReflectionGenerator is a class that provides the means to perform some common tasks involving generation of reflections. While the combination of HKLGenerator and HKLFilter is very flexible, very often a limited set of operations has to be performed repeatedly, involving the crystal structure.

ReflectionGenerator is constructed from a CrystalStructure object, which is then stored internally. Additionally, a default filter for reflection conditions can be set, which is applied for HKL-generation in addition to a DRangeFilter. For more flexibility, a method is provided that accepts an HKLFilter as additional argument, this filter is then added to the DRangeFilter.

This way it's very simple to obtain for example a list of unique reflections for a given crystal structure:

CrystalStructure structure("5.43 5.43 5.43", "F d -3 m", "Si 0 0 0 1.0 0.05"); ReflectionGenerator generator(structure);

Get all unique HKLs between 0.5 and 5.0 Angstrom std::vector<V3D> hkls = generator.getUniqueHKLs(0.5, 5.0);

Additionally there are methods to obtain structure factors and d-values for a given list of HKLs.

The generated reflection lists can be filtered by several criteria to remove reflections that are not allowed. In the default case, the reflection conditions of the space group are used. Alternatively, the reflections can be filtered according to the centering of the lattice or, with some more computational effort, by their structure factors.

The default filter method can be supplied to the constructor in the form of the enum ReflectionConditionFilter. Furthermore, it's possible to provide self-defined filters in overloaded versions of the HKL generation methods. These can also be generated by using a small helper method that creates the filters and populates them with values associated to the stored crystal structure:

ReflectionGenerator generator(
                        CrystalStructure("5.43 5.43 5.43",
                                "F d -3 m", "Si 0 0 0 1.0 0.05"));
auto filter = generator.getReflectionConditionFilter(
                                ReflectionConditionFilter::StructureFactor);

The filter can then be used in connection with HKLGenerator or the HKL- generation methods of ReflectionGenerator.

An example where structure factors are required can be found in a very common crystal structure, the structure of Silicon. Silicon crystallizes in the space group Fd-3m (No. 227) and the asymmetric unit consists of one Si-atom at the position (1/8, 1/8, 1/8) (for origin choice 2, with the inversion at the origin). Looking up this space group in the International Tables for Crystallography A reveals that placing a scatterer at this position introduces a new reflection condition for general reflections hkl:

   h = 2n + 1 (reflections with odd h are allowed)
or h + k + l = 4n

This means that for example the reflection family {2 2 2} is not allowed, even though the F-centering would allow it. Using the structure factor calculation filter solves this problem.

@author Michael Wedel, ESS
@date 30/09/2015

Definition at line 88 of file ReflectionGenerator.h.

Constructor & Destructor Documentation

◆ ReflectionGenerator()

Mantid::Geometry::ReflectionGenerator::ReflectionGenerator ( CrystalStructure  crystalStructure,
ReflectionConditionFilter  defaultFilter = ReflectionConditionFilter::SpaceGroup 
)

Constructor.

Definition at line 30 of file ReflectionGenerator.cpp.

References Mantid::DataObjects::create().

Member Function Documentation

◆ getCrystalStructure()

const CrystalStructure & Mantid::Geometry::ReflectionGenerator::getCrystalStructure ( ) const

Returns the internally stored crystal structure.

Definition at line 36 of file ReflectionGenerator.cpp.

References m_crystalStructure.

◆ getDRangeFilter()

HKLFilter_const_sptr Mantid::Geometry::ReflectionGenerator::getDRangeFilter ( double  dMin,
double  dMax 
) const

Returns a DRangeFilter from the supplied d-limits and the internally stored cell.

Definition at line 40 of file ReflectionGenerator.cpp.

References Mantid::Geometry::CrystalStructure::cell(), and m_crystalStructure.

Referenced by getHKLs(), and getUniqueHKLs().

◆ getDValues()

std::vector< double > Mantid::Geometry::ReflectionGenerator::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 stored crystal structure.

Definition at line 120 of file ReflectionGenerator.cpp.

References Mantid::Geometry::CrystalStructure::cell(), and m_crystalStructure.

◆ getFsSquared()

std::vector< double > Mantid::Geometry::ReflectionGenerator::getFsSquared ( const std::vector< Kernel::V3D > &  hkls) const

Returns a list of squared structure factor amplitudes corresponding to the supplied list of HKLs.

Definition at line 132 of file ReflectionGenerator.cpp.

References m_sfCalculator.

◆ getHKLs() [1/2]

std::vector< V3D > Mantid::Geometry::ReflectionGenerator::getHKLs ( double  dMin,
double  dMax 
) const

Returns a list of HKLs within the specified d-limits using the default reflection condition filter.

Definition at line 62 of file ReflectionGenerator.cpp.

References getHKLs(), and m_defaultHKLFilter.

Referenced by getHKLs().

◆ getHKLs() [2/2]

std::vector< Kernel::V3D > Mantid::Geometry::ReflectionGenerator::getHKLs ( double  dMin,
double  dMax,
const HKLFilter_const_sptr reflectionConditionFilter 
) const

Returns a list of HKLs within the specified d-limits using the specified filter.

If the pointer is null, it's ignored.

Definition at line 68 of file ReflectionGenerator.cpp.

References Mantid::Geometry::HKLGenerator::begin(), Mantid::Geometry::CrystalStructure::cell(), Mantid::Geometry::HKLGenerator::end(), getDRangeFilter(), m_crystalStructure, and Mantid::Geometry::HKLGenerator::size().

◆ getReflectionConditionFilter()

HKLFilter_const_sptr Mantid::Geometry::ReflectionGenerator::getReflectionConditionFilter ( ReflectionConditionFilter  filter) const

◆ getUniqueHKLs() [1/2]

std::vector< V3D > Mantid::Geometry::ReflectionGenerator::getUniqueHKLs ( double  dMin,
double  dMax 
) const

Returns a list of symetrically independent HKLs within the specified d-limits using the default reflection condition filter.

Definition at line 86 of file ReflectionGenerator.cpp.

References getUniqueHKLs(), and m_defaultHKLFilter.

Referenced by getUniqueHKLs().

◆ getUniqueHKLs() [2/2]

std::vector< V3D > Mantid::Geometry::ReflectionGenerator::getUniqueHKLs ( double  dMin,
double  dMax,
const HKLFilter_const_sptr reflectionConditionFilter 
) const

Returns a list of symetrically independent HKLs within the specified d-limits using the specified reflection condition filter.

Definition at line 92 of file ReflectionGenerator.cpp.

References Mantid::Geometry::HKLGenerator::begin(), Mantid::Geometry::CrystalStructure::cell(), Mantid::Geometry::HKLGenerator::end(), getDRangeFilter(), m_crystalStructure, Mantid::Geometry::HKLGenerator::size(), and Mantid::Geometry::CrystalStructure::spaceGroup().

Member Data Documentation

◆ m_crystalStructure

CrystalStructure Mantid::Geometry::ReflectionGenerator::m_crystalStructure
private

◆ m_defaultHKLFilter

HKLFilter_const_sptr Mantid::Geometry::ReflectionGenerator::m_defaultHKLFilter
private

Definition at line 112 of file ReflectionGenerator.h.

Referenced by getHKLs(), and getUniqueHKLs().

◆ m_sfCalculator

StructureFactorCalculator_sptr Mantid::Geometry::ReflectionGenerator::m_sfCalculator
private

Definition at line 111 of file ReflectionGenerator.h.

Referenced by getFsSquared(), and getReflectionConditionFilter().


The documentation for this class was generated from the following files: