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

Comparing trunk/src/UseTheForce/WATER.cpp (file contents):
Revision 161 by gezelter, Wed Oct 27 02:16:34 2004 UTC vs.
Revision 240 by tim, Fri Dec 10 18:41:05 2004 UTC

# Line 12 | Line 12 | using namespace std;
12   #include "UseTheForce/ForceFields.hpp"
13   #include "primitives/SRI.hpp"
14   #include "utils/simError.h"
15 + #include "types/AtomType.hpp"
16   #include "types/DirectionalAtomType.hpp"
17   #include "UseTheForce/DarkSide/lj_interface.h"
18   #include "UseTheForce/DarkSide/charge_interface.h"
# Line 395 | Line 396 | void WATER::readParams( void ){
396    atomStruct atomInfo;
397    directionalStruct directionalInfo;
398    fpos_t *atomPos;
398
399    AtomType* at;
400  
401    atomInfo.last = 1;         // initialize last to have the last set.
# Line 544 | Line 544 | void WATER::readParams( void ){
544    while( currentAtomType != NULL ){
545      if( currentAtomType->name[0] != '\0' ){
546        if (currentAtomType->isDirectional)
547 <        DirectionalAtomType* at = new DirectionalAtomType();
547 >        at = new DirectionalAtomType();        
548        else
549 <        AtomType* at = new AtomType();
550 <
549 >        at = new AtomType();
550 >      
551        if (currentAtomType->isLJ) {
552          at->setLennardJones();
553        }
# Line 557 | Line 557 | void WATER::readParams( void ){
557        }
558  
559        if (currentAtomType->isDirectional) {
560 <        if (currentDirectionalType->isSticky) {
560 >        if (currentDirectionalType->isDipole) {
561            ((DirectionalAtomType*)at)->setDipole();
562          entry_plug->useDipoles = 1;
562          }
563        
564          if (currentDirectionalType->isSticky) {
565            ((DirectionalAtomType*)at)->setSticky();
567          entry_plug->useSticky = 1;
566          }
567        }
568        
# Line 580 | Line 578 | void WATER::readParams( void ){
578  
579    while( currentAtomType != NULL ){    
580  
581 +    currentDirectionalType = headDirectionalType->find(currentAtomType->name);
582 +  
583      if( currentAtomType->isLJ ){
584        isError = 0;
585        newLJtype( &(currentAtomType->ident), &(currentAtomType->sigma),
# Line 660 | Line 660 | void WATER::initializeAtoms( int nAtoms, Atom** the_at
660        painCave.isFatal = 1;
661        simError();
662      }
663    the_atoms[i]->setMass( currentAtomType->mass );
664    the_atoms[i]->setIdent( currentAtomType->ident );
665
666    if( bigSigma < currentAtomType->sigma ) bigSigma = currentAtomType->sigma;
667
668    the_atoms[i]->setHasCharge(currentAtomType->isCharge);
663  
664      if( currentAtomType->isDirectional ){
665        currentDirectionalType =
# Line 678 | Line 672 | void WATER::initializeAtoms( int nAtoms, Atom** the_at
672          simError();
673        }
674  
675 +    the_atoms[i]->setMass( currentAtomType->mass );
676 +    the_atoms[i]->setIdent( currentAtomType->ident );
677 +
678 +    if (currentAtomType->isLJ) entry_plug->useLennardJones = 1;
679 +    if (currentAtomType->isCharge) entry_plug->useCharges = 1;
680 +    if (currentAtomType->isDirectional) {
681 +      if (currentDirectionalType->isDipole) entry_plug->useDipoles = 1;      
682 +      if (currentDirectionalType->isSticky) entry_plug->useSticky = 1;
683 +    }
684 +
685 +    if( bigSigma < currentAtomType->sigma ) bigSigma = currentAtomType->sigma;
686 +
687 +    the_atoms[i]->setHasCharge(currentAtomType->isCharge);
688 +
689 +
690 +
691        // zero out the moments of inertia matrix
692        for( j=0; j<3; j++ )
693          for( k=0; k<3; k++ )

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines