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

Comparing trunk/OOPSE-2.0/src/UseTheForce/DUFF.cpp (file contents):
Revision 1492 by tim, Fri Sep 24 16:27:58 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 <
12 < #include "UseTheForce/fortranWrappers.hpp"
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"
15  
16   #ifdef IS_MPI
17   #include "UseTheForce/mpiForceField.h"
# Line 465 | Line 467 | DUFF::DUFF(){
467    currentBendType    = NULL;
468    headTorsionType    = NULL;
469    currentTorsionType = NULL;
468
469  // do the funtion wrapping
470  wrapMeFF( this );
470  
471  
472   #ifdef 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   }
660
661 double DUFF::getAtomTypeMass (char* atomType) {
662
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  }
659  
672  return currentAtomType->mass;
673 }
660  
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 <
773 <
786 <  // call new A_types in fortran
787 <  
788 <  int isError;
789 <  
790 <  // dummy variables
791 <  
792 <  int isGB = 0;
793 <  int isLJ = 1;
794 <  int isEAM =0;
795 <  int isCharge = 0;
796 <  double charge=0.0;
797 <    
771 >
772 >  // dummy variables
773 >      
774    currentAtomType = headAtomType->next;;
775 <  while( currentAtomType != NULL ){
776 <    
777 <    if(currentAtomType->isDipole) entry_plug->useDipoles = 1;
778 <    if(currentAtomType->isSSD) {
779 <      entry_plug->useSticky = 1;
780 <      set_sticky_params( &(currentAtomType->w0), &(currentAtomType->v0),
781 <                         &(currentAtomType->v0p),
782 <                         &(currentAtomType->rl), &(currentAtomType->ru),
783 <                         &(currentAtomType->rlp), &(currentAtomType->rup));
775 >  while( currentAtomType != NULL ){    
776 >
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