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

Instances of this class represent information about a selected conventional cell based on a specified UB for a Niggli reduced cell. More...

#include <ConventionalCell.h>

Public Member Functions

 ConventionalCell (const Kernel::DblMatrix &UB, size_t form_num=0, bool allowPermutations=false)
 Construct a ConventionalCell for the specified UB and form number. More...
 
std::string GetCellType () const
 get the cell type name, as named in the ReducedCell class More...
 
std::string GetCentering () const
 get the centering type name, as named in the ReducedCell class More...
 
std::string GetDescription () const
 get string listing form number, error, cell type and centering More...
 
double GetError () const
 get the error in the scalars for this form More...
 
size_t GetFormNum () const
 get the form number for this conventional cell More...
 
Kernel::DblMatrix GetHKL_Tran () const
 get the transform to change HKL to new conventional cell HKL More...
 
Kernel::DblMatrix GetNewUB () const
 get the transformed orientation matrix for the conventional cell More...
 
Kernel::DblMatrix GetOriginalUB () const
 get the original orientation matrix as passed in to the constructor More...
 
double GetSumOfSides () const
 get the sum of the sides of the conventional unit cell More...
 

Private Member Functions

void init (const Kernel::DblMatrix &UB, const ReducedCell &form_0, ReducedCell &form_i, const bool allowPermutations)
 Initialize the fields of this ConventionalCell object, using a specified matrix and two forms. More...
 
void SetSidesIncreasing (Kernel::DblMatrix &UB)
 Change UB to a new matrix corresponding to a unit cell with the sides in increasing order of magnitude. More...
 
void StandardizeHexagonal (Kernel::DblMatrix &UB)
 Change UB to a new matrix corresponding to a hexagonal unit cell with angles approximately 90, 90, 120. More...
 
void StandardizeTetragonal (Kernel::DblMatrix &UB)
 Change UB to a new matrix corresponding to a unit cell with the first two sides approximately equal in magnitude. More...
 

Private Attributes

Kernel::DblMatrix adjusted_UB
 
std::string cell_type
 
std::string centering
 
size_t form_number
 
Kernel::DblMatrix hkl_tran
 
Kernel::DblMatrix original_UB
 
double scalars_error
 

Detailed Description

Instances of this class represent information about a selected conventional cell based on a specified UB for a Niggli reduced cell.

An instance of the class records the original UB matrix, as well as the new UB for the conventional cell, the maximum error in the scalars, cell type and centering. See "Lattice Symmetry and Identification -- The Fundamental Role of Reduced Cells in Materials Characterization", Alan D. Mighell, Vol. 106, Number 6, Nov-Dec 2001, Journal of Research of the National Institute of Standards and Technology. This class is a direct port of the ISAW class ReducedCellInfo.

Author
Dennis Mikkelson
Date
2012-01-10

Definition at line 33 of file ConventionalCell.h.

Constructor & Destructor Documentation

◆ ConventionalCell()

Mantid::Geometry::ConventionalCell::ConventionalCell ( const Kernel::DblMatrix UB,
size_t  form_num = 0,
bool  allowPermutations = false 
)

Construct a ConventionalCell for the specified UB and form number.

Construct a ConventionalCell for the specified orientation matrix and the specified row of Table 2.

The form number must be between 1 and 44.

Parameters
UBThe orientation matrix corresponding to a Niggli reduced cell.
form_numThe row number from Table 2, that specifies the reduced form number.
allowPermutationsAllow permutations of conventional cells for related UBs with better fit to peaks.

Definition at line 33 of file ConventionalCell.cpp.

References form_number, Mantid::Geometry::IndexingUtils::GetLatticeParameters(), and init().

Member Function Documentation

◆ GetCellType()

std::string Mantid::Geometry::ConventionalCell::GetCellType ( ) const

get the cell type name, as named in the ReducedCell class

Get the cell type for this conventional cell.

Returns
a std::string specifying the cell type.

Definition at line 63 of file ConventionalCell.cpp.

References cell_type.

Referenced by Mantid::Geometry::ScalarUtils::GetCellBestError(), and GetDescription().

◆ GetCentering()

std::string Mantid::Geometry::ConventionalCell::GetCentering ( ) const

get the centering type name, as named in the ReducedCell class

Get centering for this conventional cell.

Returns
a std::string specifying the centering type.

Definition at line 70 of file ConventionalCell.cpp.

References centering.

Referenced by GetDescription().

◆ GetDescription()

std::string Mantid::Geometry::ConventionalCell::GetDescription ( ) const

get string listing form number, error, cell type and centering

Get a formatted string listing the form number, error in scalars, the cell type and the centering.

Returns
a std::string with basic information about this cell.

Definition at line 113 of file ConventionalCell.cpp.

References GetCellType(), GetCentering(), GetError(), and GetFormNum().

Referenced by Mantid::Crystal::SelectCellOfType::exec(), and Mantid::Crystal::SelectCellWithForm::exec().

◆ GetError()

double Mantid::Geometry::ConventionalCell::GetError ( ) const

get the error in the scalars for this form

Get the error in the scalars for this conventional cell.

Returns
The maximum absolute weighted difference between the scalars for this conventional cell and form 0.

Definition at line 56 of file ConventionalCell.cpp.

References scalars_error.

Referenced by Mantid::Geometry::ScalarUtils::AddIfBest(), and GetDescription().

◆ GetFormNum()

size_t Mantid::Geometry::ConventionalCell::GetFormNum ( ) const

get the form number for this conventional cell

Get the form number corresponding to this conventional cell.

Returns
the form number for this conventional cell.

Definition at line 48 of file ConventionalCell.cpp.

References form_number.

Referenced by Mantid::Geometry::ScalarUtils::AddIfBest(), and GetDescription().

◆ GetHKL_Tran()

Kernel::DblMatrix Mantid::Geometry::ConventionalCell::GetHKL_Tran ( ) const

get the transform to change HKL to new conventional cell HKL

Get a copy of the transform that maps the original HKL values to new HKL values corresponding to the conventional cell.

Returns
a 3x3 matrix with the HKL tranformation.

Definition at line 94 of file ConventionalCell.cpp.

References hkl_tran.

Referenced by Mantid::Crystal::SelectCellOfType::exec(), and Mantid::Crystal::SelectCellWithForm::exec().

◆ GetNewUB()

Kernel::DblMatrix Mantid::Geometry::ConventionalCell::GetNewUB ( ) const

get the transformed orientation matrix for the conventional cell

Get a copy of the orientation matrix that indexes the peaks in a way that corresponds to the conventional cell.

Returns
a 3x3 matrix with the new UB matrix.

Definition at line 86 of file ConventionalCell.cpp.

References adjusted_UB.

Referenced by Mantid::Crystal::SelectCellOfType::exec(), and Mantid::Crystal::SelectCellWithForm::exec().

◆ GetOriginalUB()

Kernel::DblMatrix Mantid::Geometry::ConventionalCell::GetOriginalUB ( ) const

get the original orientation matrix as passed in to the constructor

Get a copy of the original UB matrix that was passed in to the constructor for this object.

Returns
a 3x3 matrix with the original UB matrix

Definition at line 78 of file ConventionalCell.cpp.

References original_UB.

◆ GetSumOfSides()

double Mantid::Geometry::ConventionalCell::GetSumOfSides ( ) const

get the sum of the sides of the conventional unit cell

Get the sum of the sides, |a|+|b|+|c| of the conventional cell.

Returns
The sum of the sides of the conventional cell.

Definition at line 101 of file ConventionalCell.cpp.

References adjusted_UB, and Mantid::Geometry::IndexingUtils::GetLatticeParameters().

◆ init()

void Mantid::Geometry::ConventionalCell::init ( const Kernel::DblMatrix UB,
const ReducedCell form_0,
ReducedCell form_i,
const bool  allowPermutations 
)
private

Initialize the fields of this ConventionalCell object, using a specified matrix and two forms.

Parameters
UBThe orientation matrix for the Niggli cell
form_0The reduced cell form built with the lattice parameters for UB and form number zero.
form_iThe reduced cell form built with the lattice parameters for UB and the form number of the desired conventional cell.
allowPermutationsAllow permutations of conventional cells for related UBs with better fit to peaks.

Definition at line 143 of file ConventionalCell.cpp.

References adjusted_UB, cell_type, centering, Mantid::Geometry::ReducedCell::GetCellType(), Mantid::Geometry::ReducedCell::GetCentering(), Mantid::Geometry::ReducedCell::GetTransformation(), Mantid::Geometry::ReducedCell::HEXAGONAL(), hkl_tran, Mantid::Kernel::Matrix< T >::Invert(), original_UB, Mantid::Geometry::ReducedCell::RHOMBOHEDRAL(), scalars_error, StandardizeHexagonal(), StandardizeTetragonal(), Mantid::Geometry::ReducedCell::TETRAGONAL(), and Mantid::Geometry::ReducedCell::WeightedDistance().

Referenced by ConventionalCell().

◆ SetSidesIncreasing()

void Mantid::Geometry::ConventionalCell::SetSidesIncreasing ( Kernel::DblMatrix UB)
private

Change UB to a new matrix corresponding to a unit cell with the sides in increasing order of magnitude.

This is used to arrange the UB matrix for an orthorhombic cell into a standard order.

Parameters
UBon input this should correspond to an orthorhombic cell. On output, it will correspond to an orthorhombic cell with sides in increasing order.

Definition at line 174 of file ConventionalCell.cpp.

References Mantid::Kernel::V3D::compareMagnitude(), Mantid::Kernel::V3D::cross_prod(), Mantid::Geometry::OrientedLattice::GetABC(), Mantid::Geometry::OrientedLattice::GetUB(), and Mantid::Kernel::V3D::scalar_prod().

◆ StandardizeHexagonal()

void Mantid::Geometry::ConventionalCell::StandardizeHexagonal ( Kernel::DblMatrix UB)
private

Change UB to a new matrix corresponding to a hexagonal unit cell with angles approximately 90, 90, 120.

This is used to arrange the UB matrix for a hexagonal or rhombohedral cell into a standard order.

Parameters
UBon input this should correspond to a hexagonal or rhombohedral On output, it will correspond to a hexagonal cell with angles approximately 90, 90, 120.

Definition at line 232 of file ConventionalCell.cpp.

References Mantid::Kernel::V3D::angle(), fabs, Mantid::Geometry::OrientedLattice::GetABC(), and Mantid::Geometry::OrientedLattice::GetUB().

Referenced by init().

◆ StandardizeTetragonal()

void Mantid::Geometry::ConventionalCell::StandardizeTetragonal ( Kernel::DblMatrix UB)
private

Change UB to a new matrix corresponding to a unit cell with the first two sides approximately equal in magnitude.

This is used to arrange the UB matrix for a tetragonal cell into a standard order.

Parameters
UBon input this should correspond to a tetragonal cell. On output, it will correspond to a tetragonal cell with the first two sides, a and b, set to the two sides that are most nearly equal in length.

Definition at line 202 of file ConventionalCell.cpp.

References fabs, Mantid::Geometry::OrientedLattice::GetABC(), Mantid::Geometry::OrientedLattice::GetUB(), and Mantid::Kernel::V3D::norm().

Referenced by init().

Member Data Documentation

◆ adjusted_UB

Kernel::DblMatrix Mantid::Geometry::ConventionalCell::adjusted_UB
private

Definition at line 76 of file ConventionalCell.h.

Referenced by GetNewUB(), GetSumOfSides(), and init().

◆ cell_type

std::string Mantid::Geometry::ConventionalCell::cell_type
private

Definition at line 73 of file ConventionalCell.h.

Referenced by GetCellType(), and init().

◆ centering

std::string Mantid::Geometry::ConventionalCell::centering
private

Definition at line 74 of file ConventionalCell.h.

Referenced by GetCentering(), and init().

◆ form_number

size_t Mantid::Geometry::ConventionalCell::form_number
private

Definition at line 71 of file ConventionalCell.h.

Referenced by ConventionalCell(), and GetFormNum().

◆ hkl_tran

Kernel::DblMatrix Mantid::Geometry::ConventionalCell::hkl_tran
private

Definition at line 77 of file ConventionalCell.h.

Referenced by GetHKL_Tran(), and init().

◆ original_UB

Kernel::DblMatrix Mantid::Geometry::ConventionalCell::original_UB
private

Definition at line 75 of file ConventionalCell.h.

Referenced by GetOriginalUB(), and init().

◆ scalars_error

double Mantid::Geometry::ConventionalCell::scalars_error
private

Definition at line 72 of file ConventionalCell.h.

Referenced by GetError(), and init().


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