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

Comparing trunk/OOPSE-4/src/UseTheForce/DUFF.cpp (file contents):
Revision 1628 by gezelter, Thu Oct 21 20:15:31 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 657 | Line 656 | void DUFF::initForceField(){
656    
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 <
784 <
785 <
786 <  // call new A_types in fortran
787 <  
788 <  int isError;
789 <  
771 >
772    // dummy variables
773 <  
792 <  int isGB = 0;
793 <  int isLJ = 1;
794 <  int isEAM =0;
795 <  int isCharge = 0;
796 <  double charge=0.0;
797 <    
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 <      makeStickyType( &(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,
809 <                 &(currentAtomType->isSSD),
810 <                 &(currentAtomType->isDipole),
811 <                 &isGB,
812 <                 &isEAM,
813 <                 &isCharge,
814 <                 &(currentAtomType->epslon),
815 <                 &(currentAtomType->sigma),
816 <                 &charge,
817 <                 &(currentAtomType->dipole),
818 <                 &isError );
819 <      if( isError ){
820 <        sprintf( painCave.errMsg,
821 <                 "Error initializing the \"%s\" atom type in fortran\n",
822 <                 currentAtomType->name );
823 <        painCave.isFatal = 1;
824 <        simError();
807 >      newLJtype( &(currentAtomType->ident), &(currentAtomType->sigma),
808 >                 &(currentAtomType->epslon), &isError);
809 >      if( isError ){
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