37 template <
typename Type>
38 static std::vector<Type>
Pointwise_Product(
const std::vector<Type> &f1,
const std::vector<Type> &f2)
40 assert(f1.size() == f2.size());
41 std::vector<Type> f(f1.size());
42 for (
int ir = 0; ir != f.size(); ++ir)
43 f[ir] = f1[ir] * f2[ir];
85 lattice_vector.
e11 = R11;
86 lattice_vector.
e12 = R12;
87 lattice_vector.
e13 = R13;
88 lattice_vector.
e21 = R21;
89 lattice_vector.
e22 = R22;
90 lattice_vector.
e23 = R23;
91 lattice_vector.
e31 = R31;
92 lattice_vector.
e32 = R32;
93 lattice_vector.
e33 = R33;
99 cartesian_vec = direct_vec * lattice_vector;
100 cx = cartesian_vec.
x;
101 cy = cartesian_vec.
y;
102 cz = cartesian_vec.
z;
143 lattice_vector.
e11 = R11;
144 lattice_vector.
e12 = R12;
145 lattice_vector.
e13 = R13;
146 lattice_vector.
e21 = R21;
147 lattice_vector.
e22 = R22;
148 lattice_vector.
e23 = R23;
149 lattice_vector.
e31 = R31;
150 lattice_vector.
e32 = R32;
151 lattice_vector.
e33 = R33;
153 inv_lat = lattice_vector.
Inverse();
156 cartesian_vec.
x = cx;
157 cartesian_vec.
y = cy;
158 cartesian_vec.
z = cz;
159 direct_vec = cartesian_vec * inv_lat;
170 proj.
x = std::abs( latvec[0] * (latvec[1] ^ latvec[2]).
normalize() );
171 proj.
y = std::abs( latvec[1] * (latvec[2] ^ latvec[0]).
normalize() );
172 proj.
z = std::abs( latvec[2] * (latvec[0] ^ latvec[1]).
normalize() );
atomic coordinates conversion functions
Definition mathzone.h:22
static void Cartesian_to_Direct(const double &cx, const double &cy, const double &cz, const double &R11, const double &R12, const double &R13, const double &R21, const double &R22, const double &R23, const double &R31, const double &R32, const double &R33, double &dx, double &dy, double &dz)
Change Cartesian coordinate (cx,cy,cz) to direct coordinate (dx,dy,dz), (cx,cy,cz) = (dx,...
Definition mathzone.h:126
static void Direct_to_Cartesian(const double &dx, const double &dy, const double &dz, const double &R11, const double &R12, const double &R13, const double &R21, const double &R22, const double &R23, const double &R31, const double &R32, const double &R33, double &cx, double &cy, double &cz)
change direct coordinate (dx,dy,dz) to Cartesian coordinate (cx,cy,cz), (dx,dy,dz) = (cx,...
Definition mathzone.h:67
static std::vector< Type > Pointwise_Product(const std::vector< Type > &f1, const std::vector< Type > &f2)
Pointwise product of two vectors with same size.
Definition mathzone.h:38
static ModuleBase::Vector3< T > latvec_projection(const std::array< ModuleBase::Vector3< T >, 3 > &latvec)
Definition mathzone.h:167
3x3 matrix and related mathamatical operations
Definition matrix3.h:19
double e13
Definition matrix3.h:26
Matrix3 Inverse(void) const
Inverse a 3x3 matrix.
Definition matrix3.cpp:44
double e31
Definition matrix3.h:26
double e11
element e_ij: i_row, j_column
Definition matrix3.h:26
double e33
Definition matrix3.h:26
double e32
Definition matrix3.h:26
double e21
Definition matrix3.h:26
double e12
Definition matrix3.h:26
double e23
Definition matrix3.h:26
double e22
Definition matrix3.h:26
3 elements vector
Definition vector3.h:22
T x
Definition vector3.h:24
T y
Definition vector3.h:25
T z
Definition vector3.h:26
Definition array_pool.h:6
void normalize(const std::vector< double > &r, std::vector< double > &flz)
Definition psi_initializer_nao.cpp:33