|
Mantid
|
IsotropicAtomBraggScatterer calculates the structure factor for a given HKL using the following equation, which gives the structure factor for the j-th atom in the unit cell: More...
#include <IsotropicAtomBraggScatterer.h>
Public Member Functions | |
| StructureFactor | calculateStructureFactor (const Kernel::V3D &hkl) const override |
| Calculates the structure factor. | |
| BraggScatterer_sptr | clone () const override |
| Clones the instance. | |
| const std::string & | getElement () const |
| Returns the string representation of the contained element. | |
| const PhysicalConstants::NeutronAtom & | getNeutronAtom () const |
| Returns the internally stored NeutronAtom that holds element specific data. | |
| double | getOccupancy () const |
| Returns the occupancy. | |
| double | getU () const |
| Returns the isotropic atomic displacement parameter. | |
| IsotropicAtomBraggScatterer () | |
| Constructor which takes an element symbol, fractional coordinates, isotropic atomic displacement parameter and occupancy. | |
| std::string | name () const override |
Public Member Functions inherited from Mantid::Geometry::BraggScattererInCrystalStructure | |
| BraggScattererInCrystalStructure () | |
| Default constructor. | |
| UnitCell | getCell () const |
| Returns the cell which is currently set. | |
| Kernel::V3D | getPosition () const |
| Returns the position of the scatterer. | |
Public Member Functions inherited from Mantid::Geometry::BraggScatterer | |
| BraggScatterer () | |
| Default constructor. | |
| double | calculateFSquared (const Kernel::V3D &hkl) const |
| Returns |F(hkl)|^2. | |
| void | initialize () |
| Initialization method that calls declareProperties() and sets initialized state to true. | |
| bool | isInitialized () |
| Returns whether the instance has been initialized. | |
| bool | isPropertyExposedToComposite (const std::string &propertyName) const |
| Checks whether a property with the given name is exposed to BraggScattererComposite. | |
| bool | isPropertyExposedToComposite (Kernel::Property *property) const |
| Checks if a property is exposed to BraggScattererComposite or throws std::invalid_argument if a null-pointer is supplied. | |
Public Member Functions inherited from Mantid::Kernel::PropertyManager | |
| ::Json::Value | asJson (bool withDefaultValues=false) const override |
| Return the property manager serialized as a json object. | |
| std::string | asString (bool withDefaultValues=false) const override |
| Return the property manager serialized as a string. | |
| void | clear () override final |
| Clears the whole property map. | |
| PropertyManager * | cloneInTimeROI (const Kernel::TimeROI &timeROI) |
| Create a partial copy of this object such that every time series property is cloned according to the input TimeROI. | |
| void | declareOrReplaceProperty (std::unique_ptr< Property > p, const std::string &doc="") override |
| Add or replace a property in the list of managed properties. | |
| void | declareProperty (const std::string &name, const char *value, const std::string &doc, IValidator_sptr validator=std::make_shared< NullValidator >(), const unsigned int direction=Direction::Input) |
| Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string). | |
| void | declareProperty (const std::string &name, const char *value, const unsigned int direction) |
| Add a property of string type to the list of managed properties. | |
| void | declareProperty (const std::string &name, const char *value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc=std::string(), const unsigned int direction=Direction::Input) |
| Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string). | |
| template<typename T > | |
| void | declareProperty (const std::string &name, T value, const std::string &doc, const unsigned int direction=Direction::Input) |
| Add a property to the list of managed properties with no validator. | |
| template<typename T > | |
| void | declareProperty (const std::string &name, T value, const unsigned int direction) |
| Add a property of the template type to the list of managed properties. | |
| template<typename T > | |
| void | declareProperty (const std::string &name, T value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc="", const unsigned int direction=Direction::Input) |
| Add a property of the template type to the list of managed properties. | |
| void | declareProperty (std::unique_ptr< Property > p, const std::string &doc="") override |
| Add a property to the list of managed properties. | |
| virtual void | declareProperty (std::unique_ptr< Property > p, const std::string &doc="")=0 |
| Function to declare properties (i.e. store them) | |
| bool | existsProperty (const std::string &name) const override |
| Checks whether the named property is already in the list of managed property. | |
| void | filterByProperty (Mantid::Kernel::LogFilter *logFilter, const std::vector< std::string > &excludedFromFiltering=std::vector< std::string >()) override |
| Filter the managed properties by the given boolean property mask. | |
| std::vector< std::string > | getDeclaredPropertyNames () const noexcept override |
| Return the list of declared property names. | |
| Property * | getPointerToProperty (const std::string &name) const override |
| Get a property by name. | |
| const std::vector< Property * > & | getProperties () const override |
| Get the list of managed properties. | |
| TypedValue | getProperty (const std::string &name) const override |
| Get the value of a property. | |
| std::string | getPropertyValue (const std::string &name) const override |
| Get the value of a property as a string. | |
| bool | operator!= (const PropertyManager &other) const |
| PropertyManager & | operator+= (const PropertyManager &rhs) |
| Addition operator. | |
| PropertyManager & | operator= (const PropertyManager &) |
| Assignment operator - performs a deep copy. | |
| bool | operator== (const PropertyManager &other) const |
| size_t | propertyCount () const override |
| Count the number of properties under management. | |
| PropertyManager () | |
| Default constructor. | |
| PropertyManager (const PropertyManager &) | |
| copy constructor | |
| void | removeDataOutsideTimeROI (const Kernel::TimeROI &timeROI) |
| For time series properties, remove time values outside of TimeROI regions, each defined as [roi_begin,roi_end]. | |
| void | removeProperty (const std::string &name, const bool delproperty=true) override |
| removes the property from properties map | |
| void | resetProperties () override |
| Reset property values back to initial values (blank or default values) | |
| void | setProperties (const ::Json::Value &jsonValue, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false) override |
| Set the ordered list of properties by a json value collection. | |
| void | setProperties (const ::Json::Value &jsonValue, IPropertyManager *targetPropertyManager, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false) |
| Set the ordered list of properties by a json value collection. | |
| void | setProperties (const std::string &propertiesJson, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false) override |
| Set the ordered list of properties by one string of values, separated by semicolons. | |
| void | setProperties (const std::string &propertiesJson, IPropertyManager *targetPropertyManager, const std::unordered_set< std::string > &ignoreProperties, bool createMissing=false) |
| Set the ordered list of properties by one string of values, separated by semicolons. | |
| void | setPropertiesWithString (const std::string &propertiesString, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >()) override |
| Sets all the declared properties from a string. | |
| void | setPropertyOrdinal (const int &index, const std::string &value) override |
| Set the value of a property by an index N.B. | |
| void | setPropertyValue (const std::string &name, const std::string &value) override |
| Set the value of a property by string N.B. | |
| void | setPropertyValueFromJson (const std::string &name, const Json::Value &value) override |
| Set the value of a property by Json::Value. | |
| std::unique_ptr< Property > | takeProperty (const size_t index) override |
| removes the property from the properties map and returns a pointer to it | |
| bool | validateProperties () const override |
| Validates all the properties in the collection. | |
| virtual | ~PropertyManager () override |
| Virtual destructor. | |
Public Member Functions inherited from Mantid::Kernel::IPropertyManager | |
| void | declareProperty (const std::string &name, const char *value, const std::string &doc, IValidator_sptr validator=std::make_shared< NullValidator >(), const unsigned int direction=Direction::Input) |
| Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string). | |
| void | declareProperty (const std::string &name, const char *value, const unsigned int direction) |
| Add a property of string type to the list of managed properties. | |
| void | declareProperty (const std::string &name, const char *value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc=std::string(), const unsigned int direction=Direction::Input) |
| Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string). | |
| template<typename T > | |
| void | declareProperty (const std::string &name, T value, const std::string &doc, const unsigned int direction=Direction::Input) |
| Add a property to the list of managed properties with no validator. | |
| template<typename T > | |
| void | declareProperty (const std::string &name, T value, const unsigned int direction) |
| Add a property of the template type to the list of managed properties. | |
| template<typename T > | |
| void | declareProperty (const std::string &name, T value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc="", const unsigned int direction=Direction::Input) |
| Add a property of the template type to the list of managed properties. | |
| std::vector< Property * > | getPropertiesInGroup (const std::string &group) const |
| Get the list of managed properties in a given group. | |
| IPropertyManager * | setProperty (const std::string &name, const char *value) |
| Specialised version of setProperty template method to handle const char *. | |
| IPropertyManager * | setProperty (const std::string &name, const std::string &value) |
| Specialised version of setProperty template method to handle std::string. | |
| template<typename T > | |
| IPropertyManager * | setProperty (const std::string &name, const T &value) |
| Templated method to set the value of a PropertyWithValue. | |
| template<typename T > | |
| IPropertyManager * | setProperty (const std::string &name, std::unique_ptr< T > value) |
| Templated method to set the value of a PropertyWithValue from a std::unique_ptr. | |
| void | setPropertyGroup (const std::string &name, const std::string &group) |
| Set the group for a given property. | |
| void | setPropertySettings (const std::string &name, std::unique_ptr< IPropertySettings > settings) |
| void | updatePropertyValues (const IPropertyManager &other) |
| Update values of the existing properties. | |
| virtual | ~IPropertyManager ()=default |
Protected Member Functions | |
| void | afterScattererPropertySet (const std::string &propertyName) override |
| After setting the element as a string, the corresponding. | |
| void | declareScattererProperties () override |
| Declares properties of this scatterer model. | |
| double | getDebyeWallerFactor (const Kernel::V3D &hkl) const |
| Returns the Debye-Waller factor, using an isotropic atomic displacement and the stored unit cell. | |
| double | getScatteringLength () const |
| Returns the scattering length of the stored element. | |
| void | setElement (const std::string &element) |
| Tries to obtain element specific data for the given symbol using PhysicalConstants::getAtom. | |
Protected Member Functions inherited from Mantid::Geometry::BraggScattererInCrystalStructure | |
| void | afterPropertySet (const std::string &propertyName) override |
| Additional property processing. | |
| void | declareProperties () override |
| Declares basic properties, should not be overridden by subclasses, use declareScattererProperties instead. | |
| Kernel::V3D | getPositionFromString (const std::string &positionString) const |
| virtual void | setCell (const UnitCell &cell) |
| Assigns a unit cell, which may be required for certain calculations. | |
| virtual void | setPosition (const Kernel::V3D &position) |
| Sets the position of the scatterer to the supplied coordinates - vector is wrapped to [0, 1). | |
Protected Member Functions inherited from Mantid::Geometry::BraggScatterer | |
| void | exposePropertyToComposite (const std::string &propertyName) |
| Exposes the property with the supplied name to BraggScattererComposite. | |
| const std::string & | getPropagatingGroupName () const |
| Returns the group name that is used to mark properties that are propagated. | |
| void | unexposePropertyFromComposite (const std::string &propertyName) |
| Removes exposure to composite for specified property. | |
Protected Member Functions inherited from Mantid::Kernel::PropertyManager | |
| Property * | getPointerToPropertyOrdinal (const int &index) const override |
| Get a property by an index. | |
| Property * | getPointerToPropertyOrNull (const std::string &name) const |
| Get a property by name. | |
Protected Member Functions inherited from Mantid::Kernel::IPropertyManager | |
| template<typename T > | |
| T | getValue (const std::string &name) const |
| Templated method to get the value of a property. | |
| template<> | |
| MANTID_KERNEL_DLL PropertyManager_sptr | getValue (const std::string &name) const |
| template<> | |
| MANTID_KERNEL_DLL PropertyManager_const_sptr | getValue (const std::string &name) const |
Protected Attributes | |
| PhysicalConstants::NeutronAtom | m_atom |
| std::string | m_label |
Protected Attributes inherited from Mantid::Geometry::BraggScattererInCrystalStructure | |
| UnitCell | m_cell |
| Kernel::V3D | m_position |
Additional Inherited Members | |
Static Public Member Functions inherited from Mantid::Kernel::PropertyManager | |
| static std::string | getInvalidValuesFilterLogName (const std::string &logName) |
| Gets the correct log name for the matching invalid values log for a given log name. | |
| static std::string | getLogNameFromInvalidValuesFilter (const std::string &logName) |
| static bool | isAnInvalidValuesFilterLog (const std::string &logName) |
| Determine if the log's name has a substring indicating it should not be filtered. | |
Static Public Attributes inherited from Mantid::Kernel::PropertyManager | |
| static const std::string | INVALID_VALUES_SUFFIX = "_invalid_values" |
IsotropicAtomBraggScatterer calculates the structure factor for a given HKL using the following equation, which gives the structure factor for the j-th atom in the unit cell:
\[ F(hkl)_j = b_j \cdot o_j \cdot DWF_j(hkl) \cdot \exp\left[2\pi i \cdot \left(h\cdot x_j + k\cdot y_j + l\cdot z_j\right)\right] \]
Since there are many terms in that equation, further explanation is required. The j-th atom in a unit cell occupies a certain position, here denoted by the fractional coordinates (x, y, z). With this information, an important calculation can be already carried out, calculation of the so called "phase". This term is easier seen when the complex part is written using trigonometric functions:
\begin{eqnarray*} \phi &=& 2\pi\left(h\cdot x_j + k\cdot y_j + l\cdot z_j\right) \\ \exp i\phi &=& \cos\phi + i\sin\phi \end{eqnarray*}
The magnitude of the complex number is determined first of all by the scattering length, \(b_j\) (which is element specific and tabulated, in Mantid this is in PhysicalConstants::NeutronAtom). It is multiplied by the occupancy \(o_j\), which is a number on the interval [0, 1], where 0 is a bit meaningless, since it means "no atoms on this position" and 1 represents a fully occupied position in the crystal lattice. This number can be used to model statistically distributed defects.
\(DWF_j\) denotes the Debye-Waller-factor, which models the diminishing scattering power of atoms that are displaced from their position (either due to temperature or other effects). It is defined like this:
\[ DWF_j(hkl) = \exp\left[-2\pi^2\cdot U \cdot 1/d_{hkl}^2\right] \]
Here, \(U\) is given in \(\mathrm{\AA{}^2}\) (for a discussion of terms regarding atomic displacement parameters, please see [1]), it is often of the order 0.05. \(d_{hkl}\) is alculated using the unit cell. The model used in this class is isotropic (hence the class name), which may be insufficient depending on the crystal structure, but as a first approximation it is often enough.
This class is designed to handle atoms in the asymmetric unit of the cell, creation of symmetrically equivalent atoms in the entire unit cell has to be handled elsewhere.
One example where this is done can be found in CrystalStructure.
[1] http://ww1.iucr.org/comm/cnom/adp/finrep/finrep.html
Definition at line 78 of file IsotropicAtomBraggScatterer.h.
| Mantid::Geometry::IsotropicAtomBraggScatterer::IsotropicAtomBraggScatterer | ( | ) |
Constructor which takes an element symbol, fractional coordinates, isotropic atomic displacement parameter and occupancy.
Definition at line 27 of file IsotropicAtomBraggScatterer.cpp.
|
overrideprotectedvirtual |
After setting the element as a string, the corresponding.
Reimplemented from Mantid::Geometry::BraggScattererInCrystalStructure.
Definition at line 101 of file IsotropicAtomBraggScatterer.cpp.
References Mantid::Kernel::PropertyManager::getPropertyValue(), and setElement().
|
overridevirtual |
Calculates the structure factor.
This method calculates the structure factor. For details, please refer to the class documentation in the header file.
| hkl | :: HKL for which the structure factor should be calculated |
Implements Mantid::Geometry::BraggScatterer.
Definition at line 62 of file IsotropicAtomBraggScatterer.cpp.
References getDebyeWallerFactor(), getOccupancy(), getScatteringLength(), Mantid::Geometry::BraggScattererInCrystalStructure::m_position, and Mantid::Kernel::V3D::scalar_prod().
|
overridevirtual |
Clones the instance.
Implements Mantid::Geometry::BraggScatterer.
Definition at line 30 of file IsotropicAtomBraggScatterer.cpp.
References Mantid::Kernel::PropertyManager::asString(), and clone().
Referenced by clone().
|
overrideprotectedvirtual |
Declares properties of this scatterer model.
In addition to the properties of BraggScatterer, this class implements three more properties, as described in the general class documentation, with some restrictions on allowed values:
Reimplemented from Mantid::Geometry::BraggScattererInCrystalStructure.
Definition at line 82 of file IsotropicAtomBraggScatterer.cpp.
References Mantid::Kernel::PropertyManager::declareProperty(), and setElement().
|
protected |
Returns the Debye-Waller factor, using an isotropic atomic displacement and the stored unit cell.
Definition at line 109 of file IsotropicAtomBraggScatterer.cpp.
References Mantid::Geometry::UnitCell::getB(), Mantid::Geometry::BraggScattererInCrystalStructure::getCell(), getU(), and Mantid::Kernel::V3D::norm2().
Referenced by calculateStructureFactor().
|
inline |
Returns the string representation of the contained element.
Definition at line 86 of file IsotropicAtomBraggScatterer.h.
|
inline |
Returns the internally stored NeutronAtom that holds element specific data.
Definition at line 88 of file IsotropicAtomBraggScatterer.h.
| double Mantid::Geometry::IsotropicAtomBraggScatterer::getOccupancy | ( | ) | const |
Returns the occupancy.
Definition at line 48 of file IsotropicAtomBraggScatterer.cpp.
References Mantid::Kernel::PropertyManager::getProperty().
Referenced by calculateStructureFactor().
|
protected |
Returns the scattering length of the stored element.
Definition at line 116 of file IsotropicAtomBraggScatterer.cpp.
References Mantid::PhysicalConstants::NeutronAtom::coh_scatt_length_real, and m_atom.
Referenced by calculateStructureFactor().
| double Mantid::Geometry::IsotropicAtomBraggScatterer::getU | ( | ) | const |
Returns the isotropic atomic displacement parameter.
Definition at line 51 of file IsotropicAtomBraggScatterer.cpp.
References Mantid::Kernel::PropertyManager::getProperty().
Referenced by getDebyeWallerFactor().
|
inlineoverridevirtual |
Implements Mantid::Geometry::BraggScatterer.
Definition at line 82 of file IsotropicAtomBraggScatterer.h.
|
protected |
Tries to obtain element specific data for the given symbol using PhysicalConstants::getAtom.
Definition at line 40 of file IsotropicAtomBraggScatterer.cpp.
References Mantid::PhysicalConstants::getAtom(), m_atom, m_label, and Mantid::PhysicalConstants::Atom::neutron.
Referenced by afterScattererPropertySet(), and declareScattererProperties().
|
protected |
Definition at line 104 of file IsotropicAtomBraggScatterer.h.
Referenced by getScatteringLength(), and setElement().
|
protected |
Definition at line 105 of file IsotropicAtomBraggScatterer.h.
Referenced by setElement().