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 1628 by gezelter, Thu Oct 21 20:15:31 2004 UTC vs.
Revision 1634 by gezelter, Fri Oct 22 21:21:02 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"
15  
14 //#include "UseTheForce/fortranWrappers.hpp"
15
16
16   #ifdef IS_MPI
17   #include "UseTheForce/mpiForceField.h"
18   #endif // is_mpi
# Line 674 | Line 673 | void DUFF::readParams( void ){
673  
674   void DUFF::readParams( void ){
675  
676 <  int identNum;
676 >  int identNum, isError;
677    
678    atomStruct atomInfo;
679    bondStruct bondInfo;
680    bendStruct bendInfo;
681    torsionStruct torsionInfo;
682 +
683 +  AtomType* at;
684    
685    bigSigma = 0.0;
686  
# Line 780 | Line 781 | void DUFF::readParams( void ){
781    }
782  
783   #endif // is_mpi
784 <
784 <
785 <
786 <  // call new A_types in fortran
787 <  
788 <  int isError;
789 <  
784 >
785    // dummy variables
786 <  
792 <  int isGB = 0;
793 <  int isLJ = 1;
794 <  int isEAM =0;
795 <  int isCharge = 0;
796 <  double charge=0.0;
797 <    
786 >      
787    currentAtomType = headAtomType->next;;
788 <  while( currentAtomType != NULL ){
789 <    
790 <    if(currentAtomType->isDipole) entry_plug->useDipoles = 1;
791 <    if(currentAtomType->isSSD) {
792 <      entry_plug->useSticky = 1;
793 <      makeStickyType( &(currentAtomType->w0), &(currentAtomType->v0),
794 <                      &(currentAtomType->v0p),
795 <                      &(currentAtomType->rl), &(currentAtomType->ru),
796 <                      &(currentAtomType->rlp), &(currentAtomType->rup));
788 >  while( currentAtomType != NULL ){    
789 >
790 >    if( currentAtomType->name[0] != '\0' ){
791 >      
792 >      if (currentAtomType->isSSD || currentAtomType->isDipole)
793 >        DirectionalAtomType* at = new DirectionalAtomType();
794 >      else
795 >        AtomType* at = new AtomType();
796 >      
797 >      if (currentAtomType->isSSD) {
798 >        ((DirectionalAtomType*)at)->setSticky();
799 >        entry_plug->useSticky = 1;
800 >      }
801 >      
802 >      if (currentAtomType->isDipole) {
803 >        ((DirectionalAtomType*)at)->setDipole();
804 >        entry_plug->useDipoles = 1;              
805 >      }
806 >      
807 >      at->setIdent(currentAtomType->ident);
808 >      at->setName(currentAtomType->name);    
809 >      at->setLennardJones();
810 >      at->complete();
811      }
812 +    currentAtomType = currentAtomType->next;
813 +  }
814 +  
815 +  currentAtomType = headAtomType->next;;
816 +  while( currentAtomType != NULL ){    
817  
818      if( currentAtomType->name[0] != '\0' ){
819        isError = 0;
820 <      makeAtype( &(currentAtomType->ident),
821 <                 &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 );
820 >      newLJtype( &(currentAtomType->ident), &(currentAtomType->sigma),
821 >                 &(currentAtomType->epslon), &isError);
822        if( isError ){
823 <        sprintf( painCave.errMsg,
824 <                 "Error initializing the \"%s\" atom type in fortran\n",
825 <                 currentAtomType->name );
826 <        painCave.isFatal = 1;
827 <        simError();
823 >        sprintf( painCave.errMsg,
824 >                 "Error initializing the \"%s\" LJ type in fortran\n",
825 >                 currentAtomType->name );
826 >        painCave.isFatal = 1;
827 >        simError();
828        }
829 +          
830 +      if (currentAtomType->isDipole) {
831 +        newDipoleType(&(currentAtomType->ident), &(currentAtomType->dipole),
832 +                      &isError);
833 +        if( isError ){
834 +          sprintf( painCave.errMsg,
835 +                   "Error initializing the \"%s\" dipole type in fortran\n",
836 +                   currentAtomType->name );
837 +          painCave.isFatal = 1;
838 +          simError();
839 +        }
840 +      }
841 +      
842 +      if(currentAtomType->isSSD) {        
843 +        makeStickyType( &(currentAtomType->w0), &(currentAtomType->v0),
844 +                        &(currentAtomType->v0p),
845 +                        &(currentAtomType->rl), &(currentAtomType->ru),
846 +                        &(currentAtomType->rlp), &(currentAtomType->rup));
847 +      }
848 +      
849      }
850      currentAtomType = currentAtomType->next;
851    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines