45 #ifndef CLIPPER_DERIVS
46 #define CLIPPER_DERIVS
69 Grad_orth(
const T& dx,
const T& dy,
const T& dz ) :
70 Vec3<T>( dx, dy, dz ) {}
71 const T& dx()
const {
return (*
this)[0]; }
72 const T& dy()
const {
return (*
this)[1]; }
73 const T& dz()
const {
return (*
this)[2]; }
74 Grad_frac<T>
grad_frac(
const Cell& cell )
const;
81 template<
class T>
class Grad_frac :
public Vec3<T>
85 explicit Grad_frac(
const Vec3<T>& v ) :
87 Grad_frac(
const T& du,
const T& dv,
const T& dw ) :
88 Vec3<T>( du, dv, dw ) {}
89 const T& du()
const {
return (*
this)[0]; }
90 const T& dv()
const {
return (*
this)[1]; }
91 const T& dw()
const {
return (*
this)[2]; }
92 Grad_orth<T>
grad_orth(
const Cell& cell )
const;
95 Grad_map<T>
grad_map(
const Grid& g )
const;
101 template<
class T>
class Grad_map :
public Vec3<T>
105 explicit Grad_map(
const Vec3<T>& v ) :
107 Grad_map(
const T& du,
const T& dv,
const T& dw ) :
108 Vec3<T>( du, dv, dw ) {}
109 const T& du()
const {
return (*
this)[0]; }
110 const T& dv()
const {
return (*
this)[1]; }
111 const T& dw()
const {
return (*
this)[2]; }
112 Grad_frac<T>
grad_frac(
const Grid& g )
const;
119 template<
class T>
class Curv_orth :
public Mat33<T>
123 explicit Curv_orth(
const Mat33<T>& m ) :
125 Curv_frac<T>
curv_frac(
const Cell& cell )
const;
131 template<
class T>
class Curv_frac :
public Mat33<T>
135 explicit Curv_frac(
const Mat33<T>& m ) :
137 Curv_orth<T>
curv_orth(
const Cell& cell )
const;
140 Curv_map<T>
curv_map(
const Grid& g )
const;
145 template<
class T>
class Curv_map :
public Mat33<T>
149 explicit Curv_map(
const Mat33<T>& m ) :
151 Curv_frac<T>
curv_frac(
const Grid& g )
const;
181 {
return Grad_map<T>( du()/g.nu(), dv()/g.nv(), dw()/g.nw() ); }
190 {
return Grad_frac<T>( du()*g.nu(), dv()*g.nv(), dw()*g.nw() ); }
212 c(0,0) = (*this)(0,0) / T(g.nu()*g.nu());
213 c(0,1) = (*this)(0,1) / T(g.nu()*g.nv());
214 c(0,2) = (*this)(0,2) / T(g.nu()*g.nw());
215 c(1,0) = (*this)(1,0) / T(g.nv()*g.nu());
216 c(1,1) = (*this)(1,1) / T(g.nv()*g.nv());
217 c(1,2) = (*this)(1,2) / T(g.nv()*g.nw());
218 c(2,0) = (*this)(2,0) / T(g.nw()*g.nu());
219 c(2,1) = (*this)(2,1) / T(g.nw()*g.nv());
220 c(2,2) = (*this)(2,2) / T(g.nw()*g.nw());
229 c(0,0) = (*this)(0,0) * T(g.nu()*g.nu());
230 c(0,1) = (*this)(0,1) * T(g.nu()*g.nv());
231 c(0,2) = (*this)(0,2) * T(g.nu()*g.nw());
232 c(1,0) = (*this)(1,0) * T(g.nv()*g.nu());
233 c(1,1) = (*this)(1,1) * T(g.nv()*g.nv());
234 c(1,2) = (*this)(1,2) * T(g.nv()*g.nw());
235 c(2,0) = (*this)(2,0) * T(g.nw()*g.nu());
236 c(2,1) = (*this)(2,1) * T(g.nw()*g.nv());
237 c(2,2) = (*this)(2,2) * T(g.nw()*g.nw());
Grad_frac< T > grad_frac(const Cell &cell) const
orthogonal-fractional derivative conversion
Definition: derivs.h:167
3x3-matrix class
Definition: clipper_types.h:182
Curv_frac< T > curv_frac(const Cell &cell) const
orthogonal-fractional derivative conversion
Definition: derivs.h:194
map coordinate curvatures, with respect to grid u,v,w
Definition: derivs.h:59
orthogonal (Angstom) gradient, with respect to orthogonal x,y,z
Definition: derivs.h:54
Cell object.
Definition: cell.h:121
String format() const
return formatted String representation
Definition: derivs.h:163
Grad_frac< T > grad_frac(const Grid &g) const
grid-fractional derivative conversion
Definition: derivs.h:189
Curv_frac< T > curv_frac(const Grid &g) const
grid-fractional derivative conversion
Definition: derivs.h:226
map coordinate gradient, with respect to grid u,v,w
Definition: derivs.h:56
generic grid
Definition: coords.h:479
Grad_orth< T > grad_orth(const Cell &cell) const
fractional-orthogonal derivative conversion
Definition: derivs.h:176
const Mat33 & matrix_orth() const
return orthogonalisation matrix
Definition: cell.h:159
fractional (cell) gradient, with respect to fractional u,v,w
Definition: derivs.h:55
Curv_map< T > curv_map(const Grid &g) const
fractional-grid derivative conversion
Definition: derivs.h:209
Curv_orth< T > curv_orth(const Cell &cell) const
fractional-orthogonal derivative conversion
Definition: derivs.h:202
Grad_map< T > grad_map(const Grid &g) const
fractional-grid derivative conversion
Definition: derivs.h:180
String format() const
return formatted String representation
Definition: derivs.h:185
String extension with simple parsing methods.
Definition: clipper_types.h:64
3-vector class
Definition: clipper_types.h:105
String format() const
return formatted String representation
Definition: derivs.h:172
Mat33< T > transpose() const
transpose
Definition: clipper_types.h:488
const Mat33 & matrix_frac() const
return fractionalisation matrix
Definition: cell.h:161
fractional (cell) curvatures, with respect to fractional u,v,w
Definition: derivs.h:58
orthogonal (Angstom) curvatures, with respect to orthogonal x,y,z
Definition: derivs.h:57