45 #ifndef CLIPPER_DERIVS
46 #define CLIPPER_DERIVS
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]; }
81 template<
class T>
class Grad_frac :
public Vec3<T>
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]; }
101 template<
class T>
class Grad_map :
public Vec3<T>
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]; }
119 template<
class T>
class Curv_orth :
public Mat33<T>
131 template<
class T>
class Curv_frac :
public Mat33<T>
145 template<
class T>
class Curv_map :
public Mat33<T>
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());
const T & dz() const
get d/dz
Definition: derivs.h:73
Curv_frac< T > curv_frac(const Cell &cell) const
orthogonal-fractional derivative conversion
Definition: derivs.h:194
const T & dw() const
get d/dw
Definition: derivs.h:111
const int & nv() const
get nv
Definition: coords.h:486
Grad_orth()
null constructor
Definition: derivs.h:66
const Mat33 & matrix_frac() const
return fractionalisation matrix
Definition: cell.h:161
Curv_map()
null constructor
Definition: derivs.h:148
fractional (cell) curvatures, with respect to fractional u,v,w
Definition: derivs.h:58
const Mat33 & matrix_orth() const
return orthogonalisation matrix
Definition: cell.h:159
Grad_orth(const T &dx, const T &dy, const T &dz)
constructor: from d/dx,d/dy,d/dz
Definition: derivs.h:69
Grad_orth(const Vec3< T > &v)
constructor: copy/convert
Definition: derivs.h:67
Grad_map(const Vec3< T > &v)
constructor: copy/convert
Definition: derivs.h:105
const T & du() const
get d/du
Definition: derivs.h:89
Grad_frac(const Vec3< T > &v)
constructor: copy/convert
Definition: derivs.h:85
generic grid
Definition: coords.h:479
String format() const
return formatted String representation
Definition: derivs.h:163
const T & dv() const
get d/dv
Definition: derivs.h:90
Grad_frac< T > grad_frac(const Grid &g) const
grid-fractional derivative conversion
Definition: derivs.h:189
Cell object.
Definition: cell.h:121
map coordinate curvatures, with respect to grid u,v,w
Definition: derivs.h:59
Curv_map< T > curv_map(const Grid &g) const
fractional-grid derivative conversion
Definition: derivs.h:209
const T & dx() const
get d/dx
Definition: derivs.h:71
const T & dw() const
get d/dw
Definition: derivs.h:91
Curv_orth()
null constructor
Definition: derivs.h:122
const int & nu() const
get nu
Definition: coords.h:485
Curv_frac(const Mat33< T > &m)
constructor: copy/convert
Definition: derivs.h:135
String extension with simple parsing methods.
Definition: clipper_types.h:64
3-vector class
Definition: clipper_types.h:105
Grad_map< T > grad_map(const Grid &g) const
fractional-grid derivative conversion
Definition: derivs.h:180
const T & dv() const
get d/dv
Definition: derivs.h:110
const int & nw() const
get nw
Definition: coords.h:487
String format() const
return formatted String representation
Definition: derivs.h:172
orthogonal (Angstom) curvatures, with respect to orthogonal x,y,z
Definition: derivs.h:57
Grad_frac< T > grad_frac(const Cell &cell) const
orthogonal-fractional derivative conversion
Definition: derivs.h:167
Grad_map(const T &du, const T &dv, const T &dw)
constructor: from d/du,d/dv,d/dw
Definition: derivs.h:107
Curv_frac()
null constructor
Definition: derivs.h:134
orthogonal (Angstom) gradient, with respect to orthogonal x,y,z
Definition: derivs.h:54
Curv_orth< T > curv_orth(const Cell &cell) const
fractional-orthogonal derivative conversion
Definition: derivs.h:202
map coordinate gradient, with respect to grid u,v,w
Definition: derivs.h:56
String format() const
return formatted String representation
Definition: derivs.h:185
Curv_map(const Mat33< T > &m)
constructor: copy/convert
Definition: derivs.h:149
Grad_orth< T > grad_orth(const Cell &cell) const
fractional-orthogonal derivative conversion
Definition: derivs.h:176
Grad_frac()
null constructor
Definition: derivs.h:84
Grad_frac(const T &du, const T &dv, const T &dw)
constructor: from d/du,d/dv,d/dw
Definition: derivs.h:87
Curv_frac< T > curv_frac(const Grid &g) const
grid-fractional derivative conversion
Definition: derivs.h:226
const T & dy() const
get d/dy
Definition: derivs.h:72
const T & du() const
get d/du
Definition: derivs.h:109
Grad_map()
null constructor
Definition: derivs.h:104
fractional (cell) gradient, with respect to fractional u,v,w
Definition: derivs.h:55
Curv_orth(const Mat33< T > &m)
constructor: copy/convert
Definition: derivs.h:123
3x3-matrix class
Definition: clipper_types.h:182