Clipper
|
Atomic shape function object. More...
#include <atomsf.h>
Public Types | |
enum | TYPE { X, Y, Z, Uiso, Occ, U11, U22, U33, U12, U13, U23 } |
Public Member Functions | |
AtomShapeFn () | |
null constructor | |
AtomShapeFn (const Atom &atom) | |
constructor: from atom object | |
AtomShapeFn (const Coord_orth &xyz, const String &element, const ftype u_iso=0.0, const ftype occ=1.0) | |
constructor: from coord, element, isotropic U, occupancy | |
AtomShapeFn (const Coord_orth &xyz, const String &element, const U_aniso_orth &u_aniso, const ftype occ=1.0) | |
constructor: from coord, element, anisotropic U, occupancy | |
void | init (const Atom &atom) |
initialiser: from atom object | |
void | init (const Coord_orth &xyz, const String &element, const ftype u_iso=0.0, const ftype occ=1.0) |
initialiser: from coord, element, isotropic U, occupancy | |
void | init (const Coord_orth &xyz, const String &element, const U_aniso_orth &u_aniso, const ftype occ=1.0) |
initialiser: from coord, element, anisotropic U, occupancy | |
ftype | f (const Coord_reci_orth &rfl) const |
return scattering factor as a function of reflection posn | |
ftype | rho (const Coord_orth &xyz) const |
return electron density as a function of coordinate | |
bool | rho_grad (const Coord_orth &xyz, ftype &rho, std::vector< ftype > &grad) const |
return Agarwal density gradients as a function of coordinate | |
bool | rho_curv (const Coord_orth &xyz, ftype &rho, std::vector< ftype > &grad, Matrix< ftype > &curv) const |
return Agarwal density gradient/curvature as a function of coordinate | |
bool | rho_grad (const Coord_orth &xyz, std::vector< ftype > &grad) const |
ftype | f (const ftype &invresolsq) const |
return (isotropic) scattering factor as a function of resolution | |
ftype | rho (const ftype &rsq) const |
return (isotropic) electron density as a function of radius | |
std::vector< TYPE > & | agarwal_params () |
define parameters for Agarwal gradient/curvature calcs |
Atomic shape function object.
The atomic scattering factor object is instantiated for each atom in turn, giving the atom parameters: position, element, occupancy and the isotropic or anisotropic U-value. (See clipper::Util for conversion from B-factors.). The methods of the class may then be called to return the scattering in reciprocal space or density in real space using either isotropic or anistropic models as required.
If the atom only has an isotropic U, the faster isotropic methods will be used where available.
This implementation uses the coefficients from Waasmaier & Kirfel (1995), Acta Cryst. A51, 416-431. The source data can be found at: ftp://wrzx02.rz.uni-wuerzburg.de/pub/local/Crystallography/sfac.dat
clipper::AtomShapeFn::AtomShapeFn | ( | const Atom & | atom | ) |
constructor: from atom object
If the atom has an anisotropic U (even if the values are isotropic), then it is initialised as anisotropic, otherwise it is isotropic.
atom | The atom object. |
References init().
clipper::AtomShapeFn::AtomShapeFn | ( | const Coord_orth & | xyz, |
const String & | element, | ||
const ftype | u_iso = 0.0 , |
||
const ftype | occ = 1.0 |
||
) |
constructor: from coord, element, isotropic U, occupancy
The atom is initialised as isotropic.
xyz | The atom coordinate. |
element | The atom element. |
u_iso | The isotropic U-value. |
occ | The occupancy. |
References init().
clipper::AtomShapeFn::AtomShapeFn | ( | const Coord_orth & | xyz, |
const String & | element, | ||
const U_aniso_orth & | u_aniso, | ||
const ftype | occ = 1.0 |
||
) |
constructor: from coord, element, anisotropic U, occupancy
The atom is initialised as anisotropic.
xyz | The atom coordinate. |
element | The atom element. |
u_aniso | The anisotropic U-value. |
occ | The occupancy. |
References init().
void clipper::AtomShapeFn::init | ( | const Atom & | atom | ) |
initialiser: from atom object
If the atom has an anisotropic U (even if the values are isotropic), then it is initialised as anisotropic, otherwise it is isotropic.
atom | The atom object. |
References clipper::Atom::coord_orth(), clipper::Atom::element(), clipper::Util::is_nan(), clipper::Mat33sym< T >::is_null(), clipper::Atom::occupancy(), clipper::Atom::u_aniso_orth(), and clipper::Atom::u_iso().
Referenced by AtomShapeFn(), and init().
void clipper::AtomShapeFn::init | ( | const Coord_orth & | xyz, |
const String & | element, | ||
const ftype | u_iso = 0.0 , |
||
const ftype | occ = 1.0 |
||
) |
initialiser: from coord, element, isotropic U, occupancy
The atom is initialised as isotropic.
xyz | The atom coordinate. |
element | The atom element. |
u_iso | The isotropic U-value. |
occ | The occupancy. |
References init().
void clipper::AtomShapeFn::init | ( | const Coord_orth & | xyz, |
const String & | element, | ||
const U_aniso_orth & | u_aniso, | ||
const ftype | occ = 1.0 |
||
) |
initialiser: from coord, element, anisotropic U, occupancy
The atom is initialised as anisotropic.
xyz | The atom coordinate. |
element | The atom element. |
u_aniso | The anisotropic U-value. |
occ | The occupancy. |
References clipper::Mat33sym< T >::det(), init(), clipper::Mat33sym< T >::mat00(), clipper::Mat33sym< T >::mat01(), clipper::Mat33sym< T >::mat02(), clipper::Mat33sym< T >::mat11(), clipper::Mat33sym< T >::mat12(), clipper::Mat33sym< T >::mat22(), clipper::Util::pi(), clipper::Util::twopi(), and clipper::U_aniso_orth::u_iso().
ftype clipper::AtomShapeFn::f | ( | const Coord_reci_orth & | rfl | ) | const |
return scattering factor as a function of reflection posn
Return the scattering factor as a function of position in reciprocal space in electrons.
rfl | Position in reciprocal space. |
References clipper::Coord_reci_orth::invresolsq(), clipper::Mat33sym< T >::quad_form(), and clipper::Util::twopi2().
ftype clipper::AtomShapeFn::rho | ( | const Coord_orth & | xyz | ) | const |
return electron density as a function of coordinate
Return the density as a function of position in real space in electrons.
xyz | Position in real space. |
The | density in electrons. |
References clipper::Coord_orth::lengthsq().
Referenced by clipper::Test_core::operator()().
bool clipper::AtomShapeFn::rho_grad | ( | const Coord_orth & | xyz, |
ftype & | rho, | ||
std::vector< ftype > & | grad | ||
) | const |
return Agarwal density gradients as a function of coordinate
Return the Agarwal gradients of the density with respect to tha atomic parameters as a function of position in real space in electrons. The parameter list is defined by assignment to agarwal_params().
xyz | Position in real space. rho The density in electrons. |
grad | Vector gradient in electrons (pre-size for best performance). |
References clipper::Coord_orth::lengthsq(), clipper::Coord_orth::x(), clipper::Coord_orth::y(), and clipper::Coord_orth::z().
bool clipper::AtomShapeFn::rho_curv | ( | const Coord_orth & | xyz, |
ftype & | rho, | ||
std::vector< ftype > & | grad, | ||
Matrix< ftype > & | curv | ||
) | const |
return Agarwal density gradient/curvature as a function of coordinate
Return the Agarwal gradients of the density with respect to tha atomic parameters as a function of position in real space in electrons. The parameter list is defined by assignment to agarwal_params().
xyz | Position in real space. rho The density in electrons. |
grad | Vector gradient in electrons (pre-size for best performance). |
curv | Matrix curvature in electrons (pre-size for best performance). |
References clipper::Coord_orth::lengthsq(), clipper::Message::message(), clipper::Util::nan(), clipper::Coord_orth::x(), clipper::Coord_orth::y(), and clipper::Coord_orth::z().
Referenced by clipper::Test_core::operator()().
bool clipper::AtomShapeFn::rho_grad | ( | const Coord_orth & | xyz, |
std::vector< ftype > & | grad | ||
) | const |
References clipper::Coord_orth::lengthsq(), clipper::Message::message(), clipper::Coord_orth::x(), clipper::Coord_orth::y(), and clipper::Coord_orth::z().
return (isotropic) scattering factor as a function of resolution
Return the scattering factor as a function of position in reciprocal space in electrons.
invresolsq | Inverse resolution squared in inverse Angstroms squared. |
References clipper::Util::u2b().
return (isotropic) electron density as a function of radius
Return the density as a function of position in real space in electrons.
invresolsq | Radius squared in Angstroms squared. |
The | density in electrons. |