| 1 |
< |
#include <cstdlib> |
| 2 |
< |
#include <cstdio> |
| 3 |
< |
#include <cstring> |
| 1 |
> |
#include <stdlib.h> |
| 2 |
> |
#include <stdio.h> |
| 3 |
> |
#include <string.h> |
| 4 |
|
|
| 5 |
|
#include <iostream> |
| 6 |
|
using namespace std; |
| 32 |
|
double mass; |
| 33 |
|
double epslon; |
| 34 |
|
double sigma; |
| 35 |
+ |
double charge; |
| 36 |
|
double dipole; |
| 37 |
|
double w0; |
| 38 |
|
double v0; |
| 42 |
|
double rlp; |
| 43 |
|
double rup; |
| 44 |
|
int isSSD; |
| 45 |
+ |
int isCharge; |
| 46 |
|
int isDipole; |
| 47 |
|
int ident; |
| 48 |
|
int last; // 0 -> default |
| 456 |
|
char* ffPath_env = "FORCE_PARAM_PATH"; |
| 457 |
|
char* ffPath; |
| 458 |
|
char temp[200]; |
| 457 |
– |
char errMsg[1000]; |
| 459 |
|
|
| 460 |
|
headAtomType = NULL; |
| 461 |
|
currentAtomType = NULL; |
| 477 |
|
// Init the atomStruct mpi type |
| 478 |
|
|
| 479 |
|
atomStruct atomProto; // mpiPrototype |
| 480 |
< |
int atomBC[3] = {15,6,4}; // block counts |
| 480 |
> |
int atomBC[3] = {15,12,5}; // block counts |
| 481 |
|
MPI_Aint atomDspls[3]; // displacements |
| 482 |
|
MPI_Datatype atomMbrTypes[3]; // member mpi types |
| 483 |
|
|
| 659 |
|
|
| 660 |
|
void DUFF::readParams( void ){ |
| 661 |
|
|
| 661 |
– |
int i, a, b, c, d; |
| 662 |
|
int identNum; |
| 663 |
– |
char* atomA; |
| 664 |
– |
char* atomB; |
| 665 |
– |
char* atomC; |
| 666 |
– |
char* atomD; |
| 663 |
|
|
| 664 |
|
atomStruct atomInfo; |
| 665 |
|
bondStruct bondInfo; |
| 731 |
|
while( currentAtomType != NULL ){ |
| 732 |
|
currentAtomType->duplicate( atomInfo ); |
| 733 |
|
|
| 738 |
– |
|
| 739 |
– |
|
| 734 |
|
sendFrcStruct( &atomInfo, mpiAtomStructType ); |
| 735 |
|
|
| 736 |
|
sprintf( checkPointMsg, |
| 748 |
|
else{ |
| 749 |
|
|
| 750 |
|
// listen for node 0 to send out the force params |
| 751 |
< |
|
| 751 |
> |
|
| 752 |
|
MPIcheckPoint(); |
| 753 |
|
|
| 754 |
|
headAtomType = new LinkedAtomType; |
| 755 |
< |
recieveFrcStruct( &atomInfo, mpiAtomStructType ); |
| 755 |
> |
receiveFrcStruct( &atomInfo, mpiAtomStructType ); |
| 756 |
|
|
| 757 |
|
while( !atomInfo.last ){ |
| 758 |
|
|
| 765 |
– |
|
| 766 |
– |
|
| 759 |
|
headAtomType->add( atomInfo ); |
| 760 |
|
|
| 761 |
|
MPIcheckPoint(); |
| 762 |
|
|
| 763 |
< |
recieveFrcStruct( &atomInfo, mpiAtomStructType ); |
| 763 |
> |
receiveFrcStruct( &atomInfo, mpiAtomStructType ); |
| 764 |
|
} |
| 765 |
|
} |
| 766 |
|
|
| 777 |
|
int isGB = 0; |
| 778 |
|
int isLJ = 1; |
| 779 |
|
int isEAM =0; |
| 780 |
< |
double GB_dummy = 0.0; |
| 781 |
< |
|
| 782 |
< |
|
| 780 |
> |
int isCharge = 0; |
| 781 |
> |
double charge=0.0; |
| 782 |
> |
|
| 783 |
|
currentAtomType = headAtomType->next;; |
| 784 |
|
while( currentAtomType != NULL ){ |
| 785 |
|
|
| 786 |
< |
if(currentAtomType->isDipole) entry_plug->useDipole = 1; |
| 786 |
> |
if(currentAtomType->isDipole) entry_plug->useDipoles = 1; |
| 787 |
|
if(currentAtomType->isSSD) { |
| 788 |
|
entry_plug->useSticky = 1; |
| 789 |
|
set_sticky_params( &(currentAtomType->w0), &(currentAtomType->v0), |
| 800 |
|
&(currentAtomType->isDipole), |
| 801 |
|
&isGB, |
| 802 |
|
&isEAM, |
| 803 |
+ |
&isCharge, |
| 804 |
|
&(currentAtomType->epslon), |
| 805 |
|
&(currentAtomType->sigma), |
| 806 |
+ |
&charge, |
| 807 |
|
&(currentAtomType->dipole), |
| 808 |
|
&isError ); |
| 809 |
|
if( isError ){ |
| 894 |
|
MPIcheckPoint(); |
| 895 |
|
|
| 896 |
|
headBondType = new LinkedBondType; |
| 897 |
< |
recieveFrcStruct( &bondInfo, mpiBondStructType ); |
| 897 |
> |
receiveFrcStruct( &bondInfo, mpiBondStructType ); |
| 898 |
|
while( !bondInfo.last ){ |
| 899 |
|
|
| 900 |
|
headBondType->add( bondInfo ); |
| 901 |
< |
recieveFrcStruct( &bondInfo, mpiBondStructType ); |
| 901 |
> |
receiveFrcStruct( &bondInfo, mpiBondStructType ); |
| 902 |
|
} |
| 903 |
|
} |
| 904 |
|
|
| 977 |
|
MPIcheckPoint(); |
| 978 |
|
|
| 979 |
|
headBendType = new LinkedBendType; |
| 980 |
< |
recieveFrcStruct( &bendInfo, mpiBendStructType ); |
| 980 |
> |
receiveFrcStruct( &bendInfo, mpiBendStructType ); |
| 981 |
|
while( !bendInfo.last ){ |
| 982 |
|
|
| 983 |
|
headBendType->add( bendInfo ); |
| 984 |
< |
recieveFrcStruct( &bendInfo, mpiBendStructType ); |
| 984 |
> |
receiveFrcStruct( &bendInfo, mpiBendStructType ); |
| 985 |
|
} |
| 986 |
|
} |
| 987 |
|
|
| 1062 |
|
MPIcheckPoint(); |
| 1063 |
|
|
| 1064 |
|
headTorsionType = new LinkedTorsionType; |
| 1065 |
< |
recieveFrcStruct( &torsionInfo, mpiTorsionStructType ); |
| 1065 |
> |
receiveFrcStruct( &torsionInfo, mpiTorsionStructType ); |
| 1066 |
|
while( !torsionInfo.last ){ |
| 1067 |
|
|
| 1068 |
|
headTorsionType->add( torsionInfo ); |
| 1069 |
< |
recieveFrcStruct( &torsionInfo, mpiTorsionStructType ); |
| 1069 |
> |
receiveFrcStruct( &torsionInfo, mpiTorsionStructType ); |
| 1070 |
|
} |
| 1071 |
|
} |
| 1072 |
|
|
| 1304 |
|
} |
| 1305 |
|
|
| 1306 |
|
gBend = new GhostBend( *the_atoms[a], |
| 1307 |
< |
*the_atoms[b], |
| 1314 |
< |
*the_atoms[c] ); |
| 1307 |
> |
*the_atoms[b]); |
| 1308 |
|
|
| 1309 |
|
gBend->setConstants( currentBendType->k1, |
| 1310 |
|
currentBendType->k2, |
| 1633 |
|
else{ |
| 1634 |
|
sprintf( painCave.errMsg, |
| 1635 |
|
"Unknown DUFF bond type \"%s\" at line %d\n", |
| 1636 |
< |
info.type, |
| 1636 |
> |
bondType, |
| 1637 |
|
lineNum ); |
| 1638 |
|
painCave.isFatal = 1; |
| 1639 |
|
simError(); |