| 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 | 
| 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 |  |  | 
| 660 |  | double DUFF::getAtomTypeMass (char* atomType) { | 
| 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 |  |  | 
| 781 |  | } | 
| 782 |  |  | 
| 783 |  | #endif // is_mpi | 
| 784 | < |  | 
| 785 | < |  | 
| 786 | < |  | 
| 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 | < |  | 
| 784 | > |  | 
| 785 | > | // dummy variables | 
| 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 | < | set_sticky_params( &(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, | 
| 822 | < | &(currentAtomType->isSSD), | 
| 823 | < | &(currentAtomType->isDipole), | 
| 824 | < | &isGB, | 
| 825 | < | &isEAM, | 
| 826 | < | &isCharge, | 
| 827 | < | &(currentAtomType->epslon), | 
| 820 | < | &(currentAtomType->sigma), | 
| 821 | < | &charge, | 
| 822 | < | &(currentAtomType->dipole), | 
| 823 | < | &isError ); | 
| 824 | < | if( isError ){ | 
| 825 | < | sprintf( painCave.errMsg, | 
| 826 | < | "Error initializing the \"%s\" atom type in fortran\n", | 
| 827 | < | currentAtomType->name ); | 
| 828 | < | painCave.isFatal = 1; | 
| 829 | < | simError(); | 
| 820 | > | newLJtype( &(currentAtomType->ident), &(currentAtomType->sigma), | 
| 821 | > | &(currentAtomType->epslon), &isError); | 
| 822 | > | if( isError ){ | 
| 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 |  | } |