51#include "utils/CaseConversion.hpp"
57 bool pairCompare(
const pair<RealType, int>& l,
const pair<RealType, int>& r) {
58 return l.first < r.first;
62 lattice_(lattice), L_(cells), M_(planes) {
71 if (lattice ==
"BCC") {
72 Basis.push_back(
Vector3d(0.0, 0.0, 0.0));
73 Basis.push_back(
Vector3d(0.5, 0.5, 0.5));
74 }
else if (lattice ==
"SC") {
75 Basis.push_back(
Vector3d(0.0, 0.0, 0.0));
78 Basis.push_back(
Vector3d(0.0, 0.0, 0.0));
79 Basis.push_back(
Vector3d(0.5, 0.5, 0.0));
80 Basis.push_back(
Vector3d(0.5, 0.0, 0.5));
81 Basis.push_back(
Vector3d(0.0, 0.5, 0.5));
91 vector<Vector3d> rawPoints;
92 vector<pair<RealType, int>> dists;
95 for (
int i = -L_; i <= L_; i++) {
96 for (
int j = -L_; j <= L_; j++) {
97 for (
int k = -L_; k <= L_; k++) {
98 for (vector<Vector3d>::iterator l = Basis.begin(); l != Basis.end();
101 if (inCluster(point)) {
102 rawPoints.push_back(point);
114 sort(dists.begin(), dists.end(), pairCompare);
116 for (vector<pair<RealType, int>>::iterator i = dists.begin();
117 i != dists.end(); ++i) {
118 Points.push_back(rawPoints[(*i).second] - c);
124 bool Cuboctahedron::inCluster111(
Vector3d r) {
126 RealType rad = 0.5 * RealType(L_);
128 if ((c.
x() < rad) && (c.
y() < rad) && (c.
z() < rad) &&
129 (c.
x() + c.
y() + c.
z() < RealType(M_)))
135 bool Cuboctahedron::inCluster(Vector3d r) {
return inCluster111(r); }
Cuboctahedron cluster structure generator.
Cuboctahedron(std::string lattice, int cells, int planes)
Default constructor.
virtual vector< Vector3d > getPoints()
Get the generated points in the cluster.
Real & z()
Returns reference of the third element of Vector3.
Real & x()
Returns reference of the first element of Vector3.
Real & y()
Returns reference of the second element of Vector3.
Real lengthSquare()
Returns the squared length of this vector.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.