--- trunk/src/lattice/shapedLattice.cpp 2006/03/17 16:11:30 905 +++ trunk/src/lattice/shapedLattice.cpp 2006/03/29 19:17:20 923 @@ -42,7 +42,7 @@ * * Created by Charles F. Vardeman II on 17 Feb 2006. * @author Charles F. Vardeman II - * @version $Id: shapedLattice.cpp,v 1.1 2006-03-17 16:10:19 chuckv Exp $ + * @version $Id: shapedLattice.cpp,v 1.3 2006-03-29 19:17:20 chuckv Exp $ * */ @@ -68,9 +68,6 @@ namespace oopse{ std::vector lc; lc.push_back(latticeConstant_); simpleLattice_->setLatticeConstant(lc); - origin_[0]=0.0; - origin_[1]=0.0; - origin_[2]=0.0; } @@ -78,33 +75,21 @@ namespace oopse{ void shapedLattice::setGridDimension(Vector3d dimension){ dimension_ = dimension; // Find number of unit cells in each direction - beginNx_ = -(int) ceil(dimension_[0]/latticeConstant_) ; - beginNy_ = -(int) ceil(dimension_[1]/latticeConstant_) ; - beginNz_ = -(int) ceil(dimension_[2]/latticeConstant_) ; - endNx_ = (int) ceil(dimension_[0]/latticeConstant_); - endNy_ = (int) ceil(dimension_[1]/latticeConstant_); - endNz_ = (int) ceil(dimension_[2]/latticeConstant_); - + beginNx_ = -(int) ceil(0.5*dimension_[0]/latticeConstant_) ; + beginNy_ = -(int) ceil(0.5*dimension_[1]/latticeConstant_) ; + beginNz_ = -(int) ceil(0.5*dimension_[2]/latticeConstant_) ; + endNx_ = (int) ceil(0.5*dimension_[0]/latticeConstant_); + endNy_ = (int) ceil(0.5*dimension_[1]/latticeConstant_); + endNz_ = (int) ceil(0.5*dimension_[2]/latticeConstant_); } - void shapedLattice::setGridDimension(Vector3d dimension, Vector3d origin){ - dimension_ = dimension; - origin_ = origin; - // Find number of unit cells in each direction - beginNx_ = -(int) ceil(dimension_[0]/latticeConstant_) + (int) floor(origin[0]); - beginNy_ = -(int) ceil(dimension_[1]/latticeConstant_) + (int) floor(origin[1]); - beginNz_ = -(int) ceil(dimension_[2]/latticeConstant_) + (int) floor(origin[2]); - endNx_ = (int) ceil(dimension_[0]/latticeConstant_) + (int) floor(origin[0]); - endNy_ = (int) ceil(dimension_[1]/latticeConstant_) + (int) floor(origin[1]); - endNz_ = (int) ceil(dimension_[2]/latticeConstant_) + (int) floor(origin[2]); - - } - - std::vector shapedLattice::getPoints(){ + std::vector shapedLattice::getPoints(){ std::vector latticePos; + + std::vector pointsOrt = simpleLattice_->getLatticePointsOrt(); int numMolPerCell = simpleLattice_->getNumSitesPerCell(); for(int i = beginNx_; i < endNx_; i++) { for(int j = beginNy_; j < endNy_; j++) { @@ -114,8 +99,12 @@ namespace oopse{ for(int l = 0; l < numMolPerCell; l++) { + if (isInterior(latticePos[l])){ - coords_.push_back(latticePos[l]); + Vector3d myPoint = latticePos[l]; + Vector3d myOrt = pointsOrt[l]; + coords_.push_back(myPoint); + coordsOrt_.push_back(myOrt); } } }