ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/nanoparticleBuilder/shapedLatticeRod.cpp
(Generate patch)

Comparing trunk/src/applications/nanoparticleBuilder/shapedLatticeRod.cpp (file contents):
Revision 1878 by gezelter, Fri Aug 31 21:16:10 2012 UTC vs.
Revision 1879 by gezelter, Sun Jun 16 15:15:42 2013 UTC

# Line 35 | Line 35
35   *                                                                      
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 < * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
38 > * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).          
39   * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 < * [4]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). *
40 > * [4]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41 > */
42 >
43 > /*
44   *  Created by Kelsey M. Stocker on 2/9/12.
45   *  @author  Kelsey M. Stocker
46   *  @version $Id: shapedLatticeRod.cpp 1665 2011-11-22 20:38:56Z gezelter $
# Line 53 | Line 56 | namespace OpenMD {
56    
57    shapedLatticeRod::shapedLatticeRod(RealType latticeConstant,
58                                       std::string latticeType,
59 <                                     RealType radius, RealType length) : shapedLattice(latticeConstant, latticeType){
59 >                                     RealType radius,
60 >                                     RealType length) : shapedLattice(latticeConstant, latticeType){
61      
62      rodRadius_= radius;
63      rodLength_= length;
60
64      Vector3d dimension;
65      dimension[0] = 3.0*radius;
66      dimension[1] = 3.0*radius;
# Line 72 | Line 75 | namespace OpenMD {
75      setOrigin(origin);
76    }
77  
75
78    /**
79 <   * Determines whether a point lies within a spherically-capped nanorod at origin (0,0,0)
79 >   * Determines whether a point lies within a spherically-capped
80 >   * nanorod at origin (0,0,0)
81     *
82     */
80
83    bool shapedLatticeRod::isInterior(Vector3d point){
84  
85 <    RealType x, y, z, distance, delta_z;
85 >    RealType x, y, z, distance;
86  
87      distance = 0;
88      
89      x = point[0];
90      y = point[1];
91      z = point[2];
90    //  std::cerr << "Testing xyz = " << point << " \n";
92      
93      if ( abs(z) >= rodLength_/2.0 ) {
94 <      delta_z = abs(z) - rodLength_/2.0;
94 >      RealType delta_z = abs(z) - rodLength_/2.0;
95        distance = sqrt((x*x) + (y*y) + (delta_z*delta_z));
95      //    std::cerr << "abs_end " ;
96      } else {
97        distance = sqrt((x*x) + (y*y));
98      //   std::cerr << "middle ";
98      }
99      
100      bool isIT=false;
101      if ( distance <= rodRadius_ ) {
103      //   cerr << "accepted!\n";
102        isIT=true;
105    } else {
106      //     cerr << "rejected!\n";
103      }
104      return isIT;
105    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines