12 |
|
#include "UseTheForce/ForceFields.hpp" |
13 |
|
#include "primitives/SRI.hpp" |
14 |
|
#include "utils/simError.h" |
15 |
< |
#include "UseTheForce/DarkSide/atype_interface.h" |
15 |
> |
#include "types/AtomType.hpp" |
16 |
> |
#include "UseTheForce/DarkSide/lj_interface.h" |
17 |
|
|
17 |
– |
//#include "UseTheForce/fortranWrappers.hpp" |
18 |
|
|
19 |
|
#ifdef IS_MPI |
20 |
|
#include "UseTheForce/mpiForceField.h" |
225 |
|
#endif // is_mpi |
226 |
|
} |
227 |
|
|
228 |
< |
void LJFF::initForceField( int ljMixRule ){ |
228 |
> |
void LJFF::initForceField(){ |
229 |
|
|
230 |
< |
initFortran( ljMixRule, 0 ); |
230 |
> |
initFortran(0); |
231 |
|
} |
232 |
|
|
233 |
|
void LJFF::cleanMe( void ){ |
252 |
|
// if things go well, last will be set to 0 |
253 |
|
|
254 |
|
int identNum; |
255 |
< |
|
255 |
> |
int isError; |
256 |
|
|
257 |
|
bigSigma = 0.0; |
258 |
|
#ifdef IS_MPI |
348 |
|
} |
349 |
|
} |
350 |
|
#endif // is_mpi |
351 |
– |
|
352 |
– |
// call new A_types in fortran |
351 |
|
|
352 |
< |
int isError; |
352 |
> |
currentAtomType = headAtomType; |
353 |
> |
while( currentAtomType != NULL ){ |
354 |
> |
|
355 |
> |
if( currentAtomType->name[0] != '\0' ){ |
356 |
|
|
357 |
< |
// dummy variables |
358 |
< |
int isLJ = 1; |
359 |
< |
int isDipole = 0; |
360 |
< |
int isSSD = 0; |
361 |
< |
int isGB = 0; |
362 |
< |
int isEAM = 0; |
363 |
< |
int isCharge = 0; |
364 |
< |
double charge = 0.0; |
365 |
< |
double dipole = 0.0; |
366 |
< |
|
357 |
> |
AtomType* at = new AtomType(); |
358 |
> |
at->setIdent(currentAtomType->ident); |
359 |
> |
printf ("currentName = %s\n", currentAtomType->name); |
360 |
> |
at->setName(currentAtomType->name); |
361 |
> |
printf("Did setName\n"); |
362 |
> |
at->setLennardJones(); |
363 |
> |
printf("Did setLennardJones\n"); |
364 |
> |
at->complete(); |
365 |
> |
printf("Did complete\n"); |
366 |
> |
|
367 |
> |
} |
368 |
> |
currentAtomType = currentAtomType->next; |
369 |
> |
} |
370 |
> |
|
371 |
|
currentAtomType = headAtomType; |
372 |
|
while( currentAtomType != NULL ){ |
373 |
|
|
374 |
|
if( currentAtomType->name[0] != '\0' ){ |
375 |
|
isError = 0; |
376 |
< |
makeAtype( &(currentAtomType->ident), |
377 |
< |
&isLJ, |
373 |
< |
&isSSD, |
374 |
< |
&isDipole, |
375 |
< |
&isGB, |
376 |
< |
&isEAM, |
377 |
< |
&isCharge, |
378 |
< |
&(currentAtomType->epslon), |
379 |
< |
&(currentAtomType->sigma), |
380 |
< |
&charge, |
381 |
< |
&dipole, |
382 |
< |
&isError ); |
376 |
> |
newLJtype( &(currentAtomType->ident), &(currentAtomType->sigma), |
377 |
> |
&(currentAtomType->epslon), &isError); |
378 |
|
if( isError ){ |
379 |
< |
sprintf( painCave.errMsg, |
380 |
< |
"Error initializing the \"%s\" atom type in fortran\n", |
381 |
< |
currentAtomType->name ); |
382 |
< |
painCave.isFatal = 1; |
383 |
< |
simError(); |
379 |
> |
sprintf( painCave.errMsg, |
380 |
> |
"Error initializing the \"%s\" LJ type in fortran\n", |
381 |
> |
currentAtomType->name ); |
382 |
> |
painCave.isFatal = 1; |
383 |
> |
simError(); |
384 |
|
} |
385 |
|
} |
386 |
+ |
|
387 |
|
currentAtomType = currentAtomType->next; |
388 |
|
} |
389 |
< |
|
390 |
< |
entry_plug->useLJ = 1; |
389 |
> |
|
390 |
> |
entry_plug->useLennardJones = 1; |
391 |
|
|
392 |
|
#ifdef IS_MPI |
393 |
|
sprintf( checkPointMsg, |
397 |
|
|
398 |
|
} |
399 |
|
|
404 |
– |
double LJFF::getAtomTypeMass (char* atomType) { |
405 |
– |
|
406 |
– |
currentAtomType = headAtomType->find( atomType ); |
407 |
– |
if( currentAtomType == NULL ){ |
408 |
– |
sprintf( painCave.errMsg, |
409 |
– |
"AtomType error, %s not found in force file.\n", |
410 |
– |
atomType ); |
411 |
– |
painCave.isFatal = 1; |
412 |
– |
simError(); |
413 |
– |
} |
414 |
– |
|
415 |
– |
return currentAtomType->mass; |
416 |
– |
} |
417 |
– |
|
400 |
|
void LJFF::initializeAtoms( int nAtoms, Atom** the_atoms ){ |
401 |
|
|
402 |
|
int i; |