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

Comparing trunk/src/applications/staticProps/TetrahedralityParam.cpp (file contents):
Revision 1524 by kstocke1, Fri Nov 19 20:48:18 2010 UTC vs.
Revision 1782 by gezelter, Wed Aug 22 02:28:28 2012 UTC

# Line 36 | Line 36
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).          
39 < * [4]  Vardeman & Gezelter, in progress (2009).                        
40 < *
39 > * [4] Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 > * [4] , Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). *
41   *  Created by J. Daniel Gezelter on 09/26/06.
42   *  @author  J. Daniel Gezelter
43   *  @version $Id: BondOrderParameter.cpp 1442 2010-05-10 17:28:26Z gezelter $
# Line 94 | Line 94 | namespace OpenMD {
94      StuntDouble* sd2;
95      StuntDouble* sdi;
96      StuntDouble* sdj;
97    StuntDouble* sdk;
97      RigidBody* rb;
98      int myIndex;
99      SimInfo::MoleculeIterator mi;
# Line 103 | Line 102 | namespace OpenMD {
102      Vector3d vec;
103      Vector3d ri, rj, rk, rik, rkj, dposition, tposition;
104      RealType r;
106    RealType dist;
105      RealType cospsi;
106      RealType Qk;
107      std::vector<std::pair<RealType,StuntDouble*> > myNeighbors;
# Line 180 | Line 178 | namespace OpenMD {
178          
179          // Use only the 4 closest neighbors to do the rest of the work:
180          
181 <        int nbors =  myNeighbors.size();
184 <        // > 4 ? 4 : myNeighbors.size();
181 >        int nbors =  myNeighbors.size()> 4 ? 4 : myNeighbors.size();
182          int nang = int (0.5 * (nbors * (nbors - 1)));
183  
184          rk = sd->getPos();
185 <
185 >        std::cerr<<nbors<<endl;
186          for (int i = 0; i < nbors-1; i++) {      
187  
188            sdi = myNeighbors[i].second;
# Line 211 | Line 208 | namespace OpenMD {
208  
209              // Calculates scaled Qk for each molecule using calculated angles from 4 or fewer nearest neighbors.
210              Qk = Qk - (pow(cospsi + 1.0 / 3.0, 2) * 2.25 / nang);
211 <          
211 >            //std::cerr<<Qk<<"\t"<<nang<<endl;
212            }
213          }
214 <
214 >        //std::cerr<<nang<<endl;
215          if (nang > 0) {
216            collectHistogram(Qk);
217  
218          // Saves positions of StuntDoubles & neighbors with distorted coordination (low Qk value)
219          if ((Qk < 0.55) && (Qk > 0.45)) {
220 <
220 >          //std::cerr<<Distorted_.size()<<endl;
221            Distorted_.push_back(sd);
222 <
222 >          //std::cerr<<Distorted_.size()<<endl;
223            dposition = sd->getPos();
224            //std::cerr << "distorted position \t" << dposition << "\n";
225          }
226  
227          // Saves positions of StuntDoubles & neighbors with tetrahedral coordination (high Qk value)
228 <        if (Qk > 0.95) {
228 >        if (Qk > 0.05) {
229  
230            Tetrahedral_.push_back(sd);
231  
232            tposition = sd->getPos();
233            //std::cerr << "tetrahedral position \t" << tposition << "\n";
234          }
235 +
236 +        //std::cerr<<Tetrahedral_.size()<<endl;
237  
238 +
239          }
240  
241        }
# Line 263 | Line 263 | namespace OpenMD {
263      for (int i = 0; i < nBins_; ++i) {
264        nSelected = nSelected + Q_histogram_[i]*deltaQ_;
265      }
266 <
266 >    
267      std::ofstream osq((getOutputFileName() + "Q").c_str());
268  
269      if (osq.is_open()) {
# Line 303 | Line 303 | namespace OpenMD {
303        osd << "1000000.00000000;    34.52893134     0.00000000     0.00000000;     0.00000000    34.52893134     0.00000000;     0.00000000     0.00000000    34.52893134" << "\n";
304        
305        for (iter = Distorted_.begin(); iter != Distorted_.end(); ++iter) {
306
306          Vector3d position;
308
307          position = (*iter)->getPos();
310
308          osd << "O  " << "\t";
309 <
313 <          for (int z=0; z<position.size(); z++) {
314 <
309 >          for (unsigned int z = 0; z < position.size(); z++) {
310              osd << position[z] << "  " << "\t";
311            }
317
312            osd << "\n";
319
313        }
321
314        osd.close();
315      }
316  
# Line 339 | Line 331 | namespace OpenMD {
331  
332          ost << "O  " << "\t";
333  
334 <          for (int z=0; z<position.size(); z++) {
334 >          for (unsigned int z = 0; z < position.size(); z++) {
335  
336              ost << position[z] << "  " << "\t";
337            }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines