# | 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::cleanMe( void ){ | |
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) { | |
# | 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 | < | 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, |
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 | } | |
# | Line 1091 | Line 1109 | void DUFF::readParams( void ){ | |
1109 | ||
1110 | #endif // is_mpi | |
1111 | ||
1112 | < | entry_plug->useLJ = 1; |
1112 | > | entry_plug->useLennardJones = 1; |
1113 | } | |
1114 | ||
1115 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |