Commit f8e3deea by Francois Gygi

additional cell info

git-svn-id: http://qboxcode.org/svn/qb/trunk@1193 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 86844fd2
......@@ -127,6 +127,18 @@ void UnitCell::set(const D3vector& a0, const D3vector& a1, const D3vector& a2)
an2h_[i] = 0.5 * norm(an_[i]);
bn2h_[i] = 0.5 * norm(bn_[i]);
}
for ( int i = 0; i < 3; i++ )
a_norm_[i] = length(a_[i]);
double sp = normalized(a_[1]) * normalized(a_[2]);
double c = max(-1.0,min(1.0,sp));
alpha_ = (180.0/M_PI)*acos(c);
sp = normalized(a_[0]) * normalized(a_[2]);
c = max(-1.0,min(1.0,sp));
beta_ = (180.0/M_PI)*acos(c);
sp = normalized(a_[0]) * normalized(a_[1]);
c = max(-1.0,min(1.0,sp));
gamma_ = (180.0/M_PI)*acos(c);
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -35,6 +35,8 @@ class UnitCell
double an2h_[13];
double bn2h_[13];
double a_norm_[3], alpha_, beta_, gamma_;
// 3x3 matrix forms
double amat_[9];
double bmat_[9];
......@@ -54,6 +56,10 @@ class UnitCell
void set(const D3vector& a0, const D3vector& a1, const D3vector& a2);
double volume(void) const { return volume_; }
double a_norm(int i) const { return a_norm_[i]; }
double alpha(void) const { return alpha_; }
double beta(void) const { return beta_; }
double gamma(void) const { return gamma_; }
const double* amat(void) const { return &amat_[0]; }
const double* bmat(void) const { return &bmat_[0]; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment