00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef CLIPPER_ATOMSF
00047 #define CLIPPER_ATOMSF
00048
00049
00050 #include "coords.h"
00051
00052
00053 namespace clipper
00054 {
00055
00057
00072 class AtomShapeFn
00073 {
00074 public:
00075 enum TYPE { X, Y, Z, Uiso, Occ, U11, U22, U33, U12, U13, U23 };
00077 AtomShapeFn() {}
00079 AtomShapeFn( const Atom& atom );
00081 AtomShapeFn( const Coord_orth& xyz, const String& element, const ftype u_iso = 0.0, const ftype occ = 1.0 );
00083 AtomShapeFn( const Coord_orth& xyz, const String& element, const U_aniso_orth& u_aniso, const ftype occ = 1.0 );
00085 void init( const Atom& atom );
00087 void init( const Coord_orth& xyz, const String& element, const ftype u_iso = 0.0, const ftype occ = 1.0 );
00089 void init( const Coord_orth& xyz, const String& element, const U_aniso_orth& u_aniso, const ftype occ = 1.0 );
00090
00092 ftype f( const Coord_reci_orth& rfl ) const;
00094 ftype rho( const Coord_orth& xyz ) const;
00095
00097 bool rho_grad( const Coord_orth& xyz, ftype& rho, std::vector<ftype>& grad ) const;
00099 bool rho_curv( const Coord_orth& xyz, ftype& rho, std::vector<ftype>& grad, Matrix<ftype>& curv ) const;
00100
00102 bool rho_grad( const Coord_orth& xyz, std::vector<ftype>& grad ) const;
00103
00105 ftype f( const ftype& invresolsq ) const;
00107 ftype rho( const ftype& rsq ) const;
00108
00110 std::vector<TYPE>& agarwal_params() { return params; }
00111 private:
00113 void init( const String& element, const ftype& u_iso );
00114
00115 Coord_orth coord_;
00116 U_aniso_orth u_aniso_;
00117 ftype u_iso_, occ_;
00118 ftype a[6], b[6];
00119 ftype aw[6], bw[6];
00120 std::vector<Mat33sym<> > uaninv;
00121 bool is_iso;
00122 std::vector<TYPE> params;
00123 };
00124
00125
00127
00130 class AtomSF : private AtomShapeFn
00131 {
00132 public:
00133 AtomSF( const String& type, const ftype u_iso = 0.0, const ftype occ = 1.0 );
00134 AtomSF( const String& type, const U_aniso_orth& u_aniso, const ftype occ = 1.0 );
00135 void init( const String& type, const ftype u_iso = 0.0, const ftype occ = 1.0 );
00136 void init( const String& type, const U_aniso_orth& u_aniso, const ftype occ = 1.0 );
00137 ftype f_iso( const ftype& s ) const;
00138 ftype f_aniso( const Coord_reci_orth& rfl ) const;
00139 ftype rho_iso( const ftype& d2 ) const;
00140 ftype rho_aniso( const Coord_orth& uvw ) const;
00141 };
00142
00143
00144 }
00145
00146 #endif