Clipper
Public Types | Public Member Functions
clipper::AtomShapeFn Class Reference

Atomic shape function object. More...

#include <atomsf.h>

Inheritance diagram for clipper::AtomShapeFn:
clipper::AtomSF

List of all members.

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

Detailed Description

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


Constructor & Destructor Documentation

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.

Parameters:
atomThe 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.

Parameters:
xyzThe atom coordinate.
elementThe atom element.
u_isoThe isotropic U-value.
occThe 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.

Parameters:
xyzThe atom coordinate.
elementThe atom element.
u_anisoThe anisotropic U-value.
occThe occupancy.

References init().


Member Function Documentation

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.

Parameters:
atomThe 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.

Parameters:
xyzThe atom coordinate.
elementThe atom element.
u_isoThe isotropic U-value.
occThe 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.

Parameters:
xyzThe atom coordinate.
elementThe atom element.
u_anisoThe anisotropic U-value.
occThe 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.

Parameters:
rflPosition in reciprocal space.
Returns:
The scattering factor in electrons.

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.

Parameters:
xyzPosition in real space.
Thedensity 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().

Parameters:
xyzPosition in real space. rho The density in electrons.
gradVector 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().

Parameters:
xyzPosition in real space. rho The density in electrons.
gradVector gradient in electrons (pre-size for best performance).
curvMatrix 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
ftype clipper::AtomShapeFn::f ( const ftype invresolsq) const

return (isotropic) scattering factor as a function of resolution

Return the scattering factor as a function of position in reciprocal space in electrons.

Parameters:
invresolsqInverse resolution squared in inverse Angstroms squared.
Returns:
The scattering factor in electrons.

References clipper::Util::u2b().

ftype clipper::AtomShapeFn::rho ( const ftype rsq) const

return (isotropic) electron density as a function of radius

Return the density as a function of position in real space in electrons.

Parameters:
invresolsqRadius squared in Angstroms squared.
Thedensity in electrons.

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