ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/UseTheForce/DUFF.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/UseTheForce/DUFF.cpp (file contents):
Revision 1617 by chuckv, Wed Oct 20 20:46:20 2004 UTC vs.
Revision 1650 by gezelter, Tue Oct 26 22:24:52 2004 UTC

# Line 8 | Line 8 | using namespace std;
8   #include "UseTheForce/ForceFields.hpp"
9   #include "primitives/SRI.hpp"
10   #include "utils/simError.h"
11 + #include "types/DirectionalAtomType.hpp"
12 + #include "UseTheForce/DarkSide/lj_interface.h"
13 + #include "UseTheForce/DarkSide/dipole_interface.h"
14   #include "UseTheForce/DarkSide/sticky_interface.h"
12 #include "UseTheForce/DarkSide/atype_interface.h"
13
14 //#include "UseTheForce/fortranWrappers.hpp"
15  
16
16   #ifdef IS_MPI
17   #include "UseTheForce/mpiForceField.h"
18   #endif // is_mpi
# Line 653 | Line 652 | void DUFF::initForceField( int ljMixRule ){
652   }
653  
654  
655 < void DUFF::initForceField( int ljMixRule ){
655 > void DUFF::initForceField(){
656    
657 <  initFortran( ljMixRule, entry_plug->useReactionField );
657 >  initFortran( entry_plug->useReactionField );
658   }
659  
661 double DUFF::getAtomTypeMass (char* atomType) {
660  
663  currentAtomType = headAtomType->find( atomType );
664  if( currentAtomType == NULL ){
665    sprintf( painCave.errMsg,
666            "AtomType error, %s not found in force file.\n",
667             atomType );
668    painCave.isFatal = 1;
669    simError();
670  }
671
672  return currentAtomType->mass;
673 }
674
661   void DUFF::readParams( void ){
662  
663 <  int identNum;
663 >  int identNum, isError;
664    
665    atomStruct atomInfo;
666    bondStruct bondInfo;
667    bendStruct bendInfo;
668    torsionStruct torsionInfo;
669 +
670 +  AtomType* at;
671    
672    bigSigma = 0.0;
673  
# Line 780 | Line 768 | void DUFF::readParams( void ){
768    }
769  
770   #endif // is_mpi
771 <
772 <
771 >
772 >  // dummy variables
773 >      
774 >  currentAtomType = headAtomType->next;;
775 >  while( currentAtomType != NULL ){    
776  
777 <  // call new A_types in fortran
778 <  
779 <  int isError;
780 <  
781 <  // dummy variables
782 <  
783 <  int isGB = 0;
784 <  int isLJ = 1;
785 <  int isEAM =0;
786 <  int isCharge = 0;
787 <  double charge=0.0;
788 <    
789 <  currentAtomType = headAtomType->next;;
790 <  while( currentAtomType != NULL ){
791 <    
792 <    if(currentAtomType->isDipole) entry_plug->useDipoles = 1;
793 <    if(currentAtomType->isSSD) {
794 <      entry_plug->useSticky = 1;
795 <      set_sticky_params( &(currentAtomType->w0), &(currentAtomType->v0),
796 <                         &(currentAtomType->v0p),
797 <                         &(currentAtomType->rl), &(currentAtomType->ru),
807 <                         &(currentAtomType->rlp), &(currentAtomType->rup));
777 >    if( currentAtomType->name[0] != '\0' ){
778 >      
779 >      if (currentAtomType->isSSD || currentAtomType->isDipole)
780 >        DirectionalAtomType* at = new DirectionalAtomType();
781 >      else
782 >        AtomType* at = new AtomType();
783 >      
784 >      if (currentAtomType->isSSD) {
785 >        ((DirectionalAtomType*)at)->setSticky();
786 >        entry_plug->useSticky = 1;
787 >      }
788 >      
789 >      if (currentAtomType->isDipole) {
790 >        ((DirectionalAtomType*)at)->setDipole();
791 >        entry_plug->useDipoles = 1;              
792 >      }
793 >      
794 >      at->setIdent(currentAtomType->ident);
795 >      at->setName(currentAtomType->name);    
796 >      at->setLennardJones();
797 >      at->complete();
798      }
799 +    currentAtomType = currentAtomType->next;
800 +  }
801 +  
802 +  currentAtomType = headAtomType->next;;
803 +  while( currentAtomType != NULL ){    
804  
805      if( currentAtomType->name[0] != '\0' ){
806        isError = 0;
807 <      makeAtype( &(currentAtomType->ident),
808 <                 &isLJ,
814 <                 &(currentAtomType->isSSD),
815 <                 &(currentAtomType->isDipole),
816 <                 &isGB,
817 <                 &isEAM,
818 <                 &isCharge,
819 <                 &(currentAtomType->epslon),
820 <                 &(currentAtomType->sigma),
821 <                 &charge,
822 <                 &(currentAtomType->dipole),
823 <                 &isError );
807 >      newLJtype( &(currentAtomType->ident), &(currentAtomType->sigma),
808 >                 &(currentAtomType->epslon), &isError);
809        if( isError ){
810 <        sprintf( painCave.errMsg,
811 <                 "Error initializing the \"%s\" atom type in fortran\n",
812 <                 currentAtomType->name );
813 <        painCave.isFatal = 1;
814 <        simError();
810 >        sprintf( painCave.errMsg,
811 >                 "Error initializing the \"%s\" LJ type in fortran\n",
812 >                 currentAtomType->name );
813 >        painCave.isFatal = 1;
814 >        simError();
815        }
816 +          
817 +      if (currentAtomType->isDipole) {
818 +        newDipoleType(&(currentAtomType->ident), &(currentAtomType->dipole),
819 +                      &isError);
820 +        if( isError ){
821 +          sprintf( painCave.errMsg,
822 +                   "Error initializing the \"%s\" dipole type in fortran\n",
823 +                   currentAtomType->name );
824 +          painCave.isFatal = 1;
825 +          simError();
826 +        }
827 +      }
828 +      
829 +      if(currentAtomType->isSSD) {        
830 +        makeStickyType( &(currentAtomType->w0), &(currentAtomType->v0),
831 +                        &(currentAtomType->v0p),
832 +                        &(currentAtomType->rl), &(currentAtomType->ru),
833 +                        &(currentAtomType->rlp), &(currentAtomType->rup));
834 +      }
835 +      
836      }
837      currentAtomType = currentAtomType->next;
838    }
# Line 1091 | Line 1096 | void DUFF::readParams( void ){
1096  
1097   #endif // is_mpi
1098  
1099 <  entry_plug->useLJ = 1;
1099 >  entry_plug->useLennardJones = 1;
1100   }
1101  
1102  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines