# | Line 42 | Line 42 | |
---|---|---|
42 | * | |
43 | * Created by Charles F. Vardeman II on 17 Feb 2006. | |
44 | * @author Charles F. Vardeman II | |
45 | < | * @version $Id: shapedLattice.cpp,v 1.1 2006-03-17 16:10:19 chuckv Exp $ |
45 | > | * @version $Id: shapedLattice.cpp,v 1.2 2006-03-27 16:03:50 chuckv Exp $ |
46 | * | |
47 | */ | |
48 | ||
# | Line 68 | Line 68 | namespace oopse{ | |
68 | std::vector<double> lc; | |
69 | lc.push_back(latticeConstant_); | |
70 | simpleLattice_->setLatticeConstant(lc); | |
71 | – | origin_[0]=0.0; |
72 | – | origin_[1]=0.0; |
73 | – | origin_[2]=0.0; |
71 | } | |
72 | ||
73 | ||
# | Line 78 | Line 75 | namespace oopse{ | |
75 | void shapedLattice::setGridDimension(Vector3d dimension){ | |
76 | dimension_ = dimension; | |
77 | // Find number of unit cells in each direction | |
78 | < | beginNx_ = -(int) ceil(dimension_[0]/latticeConstant_) ; |
79 | < | beginNy_ = -(int) ceil(dimension_[1]/latticeConstant_) ; |
80 | < | beginNz_ = -(int) ceil(dimension_[2]/latticeConstant_) ; |
81 | < | endNx_ = (int) ceil(dimension_[0]/latticeConstant_); |
82 | < | endNy_ = (int) ceil(dimension_[1]/latticeConstant_); |
83 | < | endNz_ = (int) ceil(dimension_[2]/latticeConstant_); |
87 | < | |
78 | > | beginNx_ = -(int) ceil(0.5*dimension_[0]/latticeConstant_) ; |
79 | > | beginNy_ = -(int) ceil(0.5*dimension_[1]/latticeConstant_) ; |
80 | > | beginNz_ = -(int) ceil(0.5*dimension_[2]/latticeConstant_) ; |
81 | > | endNx_ = (int) ceil(0.5*dimension_[0]/latticeConstant_); |
82 | > | endNy_ = (int) ceil(0.5*dimension_[1]/latticeConstant_); |
83 | > | endNz_ = (int) ceil(0.5*dimension_[2]/latticeConstant_); |
84 | } | |
85 | ||
86 | ||
87 | ||
88 | < | void shapedLattice::setGridDimension(Vector3d dimension, Vector3d origin){ |
93 | < | dimension_ = dimension; |
94 | < | origin_ = origin; |
95 | < | // Find number of unit cells in each direction |
96 | < | beginNx_ = -(int) ceil(dimension_[0]/latticeConstant_) + (int) floor(origin[0]); |
97 | < | beginNy_ = -(int) ceil(dimension_[1]/latticeConstant_) + (int) floor(origin[1]); |
98 | < | beginNz_ = -(int) ceil(dimension_[2]/latticeConstant_) + (int) floor(origin[2]); |
99 | < | endNx_ = (int) ceil(dimension_[0]/latticeConstant_) + (int) floor(origin[0]); |
100 | < | endNy_ = (int) ceil(dimension_[1]/latticeConstant_) + (int) floor(origin[1]); |
101 | < | endNz_ = (int) ceil(dimension_[2]/latticeConstant_) + (int) floor(origin[2]); |
102 | < | |
103 | < | } |
104 | < | |
105 | < | std::vector<Vector3d> shapedLattice::getPoints(){ |
88 | > | std::vector<Vector3d> shapedLattice::getPoints(){ |
89 | std::vector<Vector3d> latticePos; | |
90 | ||
91 | int numMolPerCell = simpleLattice_->getNumSitesPerCell(); | |
# | Line 114 | Line 97 | namespace oopse{ | |
97 | ||
98 | for(int l = 0; l < numMolPerCell; l++) { | |
99 | ||
100 | + | |
101 | if (isInterior(latticePos[l])){ | |
102 | < | coords_.push_back(latticePos[l]); |
102 | > | Vector3d myPoint = latticePos[l]; |
103 | > | coords_.push_back(myPoint); |
104 | } | |
105 | } | |
106 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |