217 |
|
|
218 |
|
ffPath = getenv( ffPath_env ); |
219 |
|
if( ffPath == NULL ) { |
220 |
< |
sprintf( painCave.errMsg, |
221 |
< |
"Error opening the force field parameter file: %s\n" |
222 |
< |
"Have you tried setting the FORCE_PARAM_PATH environment " |
223 |
< |
"vairable?\n", |
224 |
< |
fileName ); |
225 |
< |
painCave.isFatal = 1; |
226 |
< |
simError(); |
220 |
> |
STR_DEFINE(ffPath, FRC_PATH ); |
221 |
|
} |
222 |
|
|
223 |
|
|
1003 |
|
// if things go well, last will be set to 0 |
1004 |
|
|
1005 |
|
QuadraticBend* qBend; |
1006 |
+ |
GhostBend* gBend; |
1007 |
|
SRI **the_sris; |
1008 |
|
Atom** the_atoms; |
1009 |
|
int nBends; |
1104 |
|
|
1105 |
|
atomA = the_atoms[a]->getType(); |
1106 |
|
atomB = the_atoms[b]->getType(); |
1107 |
< |
atomC = the_atoms[c]->getType(); |
1107 |
> |
|
1108 |
> |
if( the_bends[i].isGhost ) atomC = "GHOST"; |
1109 |
> |
else atomC = the_atoms[c]->getType(); |
1110 |
> |
|
1111 |
|
currentBendType = headBendType->find( atomA, atomB, atomC ); |
1112 |
|
if( currentBendType == NULL ){ |
1113 |
|
sprintf( painCave.errMsg, "BendType error, %s - %s - %s not found" |
1120 |
|
if( !strcmp( currentBendType->type, "quadratic" ) ){ |
1121 |
|
|
1122 |
|
index = i + entry_plug->n_bonds; |
1123 |
< |
qBend = new QuadraticBend( *the_atoms[a], |
1124 |
< |
*the_atoms[b], |
1125 |
< |
*the_atoms[c] ); |
1126 |
< |
qBend->setConstants( currentBendType->k1, |
1127 |
< |
currentBendType->k2, |
1128 |
< |
currentBendType->k3, |
1129 |
< |
currentBendType->t0 ); |
1130 |
< |
the_sris[index] = qBend; |
1123 |
> |
|
1124 |
> |
if( the_bends[i].isGhost){ |
1125 |
> |
|
1126 |
> |
if( the_bends[i].ghost == b ){ |
1127 |
> |
// do nothing |
1128 |
> |
} |
1129 |
> |
else if( the_bends[i].ghost == a ){ |
1130 |
> |
c = a; |
1131 |
> |
a = b; |
1132 |
> |
b = a; |
1133 |
> |
} |
1134 |
> |
else{ |
1135 |
> |
sprintf( painCave.errMsg, |
1136 |
> |
"BendType error, %s - %s - %s,\n" |
1137 |
> |
" --> central atom is not " |
1138 |
> |
"correctly identified with the " |
1139 |
> |
"\"ghostVectorSource = \" tag.\n", |
1140 |
> |
atomA, atomB, atomC ); |
1141 |
> |
painCave.isFatal = 1; |
1142 |
> |
simError(); |
1143 |
> |
} |
1144 |
> |
|
1145 |
> |
gBend = new GhostBend( *the_atoms[a], |
1146 |
> |
*the_atoms[b] ); |
1147 |
> |
gBend->setConstants( currentBendType->k1, |
1148 |
> |
currentBendType->k2, |
1149 |
> |
currentBendType->k3, |
1150 |
> |
currentBendType->t0 ); |
1151 |
> |
the_sris[index] = gBend; |
1152 |
> |
} |
1153 |
> |
else{ |
1154 |
> |
qBend = new QuadraticBend( *the_atoms[a], |
1155 |
> |
*the_atoms[b], |
1156 |
> |
*the_atoms[c] ); |
1157 |
> |
qBend->setConstants( currentBendType->k1, |
1158 |
> |
currentBendType->k2, |
1159 |
> |
currentBendType->k3, |
1160 |
> |
currentBendType->t0 ); |
1161 |
> |
the_sris[index] = qBend; |
1162 |
> |
} |
1163 |
|
} |
1164 |
|
} |
1165 |
|
|