| 5 | 
  | 
#include <iostream> | 
| 6 | 
  | 
using namespace std; | 
| 7 | 
  | 
 | 
| 8 | 
< | 
#include "ForceFields.hpp" | 
| 9 | 
< | 
#include "SRI.hpp" | 
| 10 | 
< | 
#include "simError.h" | 
| 11 | 
< | 
 | 
| 12 | 
< | 
#include "fortranWrappers.hpp" | 
| 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" | 
| 15 | 
  | 
 | 
| 16 | 
  | 
#ifdef IS_MPI | 
| 17 | 
< | 
#include "mpiForceField.h" | 
| 17 | 
> | 
#include "UseTheForce/mpiForceField.h" | 
| 18 | 
  | 
#endif // is_mpi | 
| 19 | 
  | 
 | 
| 20 | 
  | 
 | 
| 468 | 
  | 
  headTorsionType    = NULL;  | 
| 469 | 
  | 
  currentTorsionType = NULL; | 
| 470 | 
  | 
 | 
| 469 | 
– | 
  // do the funtion wrapping | 
| 470 | 
– | 
  wrapMeFF( this ); | 
| 471 | 
  | 
 | 
| 472 | 
– | 
 | 
| 472 | 
  | 
#ifdef IS_MPI | 
| 473 | 
  | 
  int i; | 
| 474 | 
  | 
   | 
| 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 | 
< | 
 | 
| 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, | 
| 822 | 
< | 
                 &(currentAtomType->isSSD), | 
| 823 | 
< | 
                 &(currentAtomType->isDipole), | 
| 824 | 
< | 
                 &isGB, | 
| 825 | 
< | 
                 &isEAM, | 
| 826 | 
< | 
                 &isCharge, | 
| 827 | 
< | 
                 &(currentAtomType->epslon), | 
| 828 | 
< | 
                 &(currentAtomType->sigma), | 
| 829 | 
< | 
                 &charge, | 
| 830 | 
< | 
                 &(currentAtomType->dipole), | 
| 831 | 
< | 
                 &isError ); | 
| 832 | 
< | 
      if( isError ){ | 
| 833 | 
< | 
        sprintf( painCave.errMsg, | 
| 834 | 
< | 
                 "Error initializing the \"%s\" atom type in fortran\n", | 
| 835 | 
< | 
                 currentAtomType->name ); | 
| 836 | 
< | 
        painCave.isFatal = 1; | 
| 837 | 
< | 
        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 | 
  | 
  } | 
| 1109 | 
  | 
 | 
| 1110 | 
  | 
#endif // is_mpi | 
| 1111 | 
  | 
 | 
| 1112 | 
< | 
  entry_plug->useLJ = 1; | 
| 1112 | 
> | 
  entry_plug->useLennardJones = 1; | 
| 1113 | 
  | 
} | 
| 1114 | 
  | 
 | 
| 1115 | 
  | 
 |