10 |
|
|
11 |
|
#ifdef IS_MPI |
12 |
|
#include "mpiBASS.h" |
13 |
+ |
#include "mpiSimulation.hpp" |
14 |
|
#include "bassDiag.hpp" |
15 |
|
#endif |
16 |
|
|
93 |
|
if( !strcmp( force_field, "TraPPE" ) ) the_ff = new TraPPEFF(); |
94 |
|
else if( !strcmp( force_field, "DipoleTest" ) ) the_ff = new DipoleTestFF(); |
95 |
|
else if( !strcmp( force_field, "TraPPE_Ex" ) ) the_ff = new TraPPE_ExFF(); |
96 |
+ |
else if( !strcmp( force_field, "LJ" ) ) the_ff = new LJ_FF(); |
97 |
|
else{ |
98 |
|
sprintf( painCave.errMsg, |
99 |
|
"SimSetup Error. Unrecognized force field -> %s\n", |
236 |
|
|
237 |
|
// divide the molecules among processors here. |
238 |
|
|
239 |
< |
mpiSimulation* mpiSim = new mpiSimulation( simnfo ); |
239 |
> |
mpiSim = new mpiSimulation( simnfo ); |
240 |
|
|
241 |
|
mpiSim->divideLabor(); |
242 |
|
|
313 |
|
simnfo->sr_interactions = the_sris; |
314 |
|
simnfo->n_exclude = tot_SRI; |
315 |
|
simnfo->excludes = the_excludes; |
314 |
– |
|
315 |
– |
|
316 |
– |
// initialize the arrays |
317 |
– |
|
318 |
– |
the_ff->setSimInfo( simnfo ); |
319 |
– |
|
320 |
– |
makeAtoms(); |
321 |
– |
|
322 |
– |
if( tot_bonds ){ |
323 |
– |
makeBonds(); |
324 |
– |
} |
325 |
– |
|
326 |
– |
if( tot_bends ){ |
327 |
– |
makeBends(); |
328 |
– |
} |
316 |
|
|
330 |
– |
if( tot_torsions ){ |
331 |
– |
makeTorsions(); |
332 |
– |
} |
317 |
|
|
334 |
– |
|
318 |
|
// get some of the tricky things that may still be in the globals |
319 |
|
|
320 |
|
if( simnfo->n_dipoles ){ |
385 |
|
strcpy( checkPointMsg, "Box size set up" ); |
386 |
|
MPIcheckPoint(); |
387 |
|
#endif // is_mpi |
388 |
+ |
|
389 |
+ |
|
390 |
+ |
// initialize the arrays |
391 |
+ |
|
392 |
+ |
the_ff->setSimInfo( simnfo ); |
393 |
+ |
|
394 |
+ |
makeAtoms(); |
395 |
+ |
|
396 |
+ |
if( tot_bonds ){ |
397 |
+ |
makeBonds(); |
398 |
+ |
} |
399 |
+ |
|
400 |
+ |
if( tot_bends ){ |
401 |
+ |
makeBends(); |
402 |
+ |
} |
403 |
|
|
404 |
+ |
if( tot_torsions ){ |
405 |
+ |
makeTorsions(); |
406 |
+ |
} |
407 |
|
|
408 |
|
|
409 |
+ |
|
410 |
+ |
|
411 |
+ |
|
412 |
+ |
|
413 |
|
if( the_globals->haveInitialConfig() ){ |
414 |
|
|
415 |
|
InitializeFromFile* fileInit; |
563 |
|
if( the_globals->haveTempSet() ) simnfo->setTemp = the_globals->getTempSet(); |
564 |
|
|
565 |
|
|
566 |
< |
// make the longe range forces and the integrator |
566 |
> |
// // make the longe range forces and the integrator |
567 |
|
|
568 |
< |
new AllLong( simnfo ); |
568 |
> |
// new AllLong( simnfo ); |
569 |
|
|
570 |
|
if( !strcmp( force_field, "TraPPE" ) ) new Verlet( *simnfo ); |
571 |
|
if( !strcmp( force_field, "DipoleTest" ) ) new Symplectic( simnfo ); |
572 |
|
if( !strcmp( force_field, "TraPPE_Ex" ) ) new Symplectic( simnfo ); |
573 |
+ |
if( !strcmp( force_field, "LJ" ) ) new Verlet( *simnfo, the_ff ); |
574 |
+ |
|
575 |
|
} |
576 |
|
|
577 |
|
void SimSetup::makeAtoms( void ){ |
590 |
|
for( j=0; j<components_nmol[i]; j++ ){ |
591 |
|
|
592 |
|
#ifdef IS_MPI |
593 |
< |
if( simnfo->mpiSim->getMyMolStart() <= molIndex && |
594 |
< |
molIndex <= simnfo->mpiSim->getMyMolEnd() ){ |
593 |
> |
if( mpiSim->getMyMolStart() <= molIndex && |
594 |
> |
molIndex <= mpiSim->getMyMolEnd() ){ |
595 |
|
#endif // is_mpi |
596 |
|
|
597 |
|
molStart = index; |
657 |
|
the_bonds = new bond_pair[tot_bonds]; |
658 |
|
index = 0; |
659 |
|
offset = 0; |
660 |
< |
molIndex = 0; |
660 |
> |
molIndex = 0;g1 |
661 |
> |
|
662 |
|
for( i=0; i<n_components; i++ ){ |
663 |
|
|
664 |
|
for( j=0; j<components_nmol[i]; j++ ){ |
665 |
|
|
666 |
|
#ifdef IS_MPI |
667 |
< |
if( simnfo->mpiSim->getMyMolStart() <= molIndex && |
668 |
< |
molIndex <= simnfo->mpiSim->getMyMolEnd() ){ |
667 |
> |
if( mpiSim->getMyMolStart() <= molIndex && |
668 |
> |
molIndex <= mpiSim->getMyMolEnd() ){ |
669 |
|
#endif // is_mpi |
670 |
|
|
671 |
|
for( k=0; k<comp_stamps[i]->getNBonds(); k++ ){ |
708 |
|
for( j=0; j<components_nmol[i]; j++ ){ |
709 |
|
|
710 |
|
#ifdef IS_MPI |
711 |
< |
if( simnfo->mpiSim->getMyMolStart() <= molIndex && |
712 |
< |
molIndex <= simnfo->mpiSim->getMyMolEnd() ){ |
711 |
> |
if( mpiSim->getMyMolStart() <= molIndex && |
712 |
> |
molIndex <= mpiSim->getMyMolEnd() ){ |
713 |
|
#endif // is_mpi |
714 |
|
|
715 |
|
for( k=0; k<comp_stamps[i]->getNBends(); k++ ){ |
753 |
|
for( j=0; j<components_nmol[i]; j++ ){ |
754 |
|
|
755 |
|
#ifdef IS_MPI |
756 |
< |
if( simnfo->mpiSim->getMyMolStart() <= molIndex && |
757 |
< |
molIndex <= simnfo->mpiSim->getMyMolEnd() ){ |
756 |
> |
if( mpiSim->getMyMolStart() <= molIndex && |
757 |
> |
molIndex <= mpiSim->getMyMolEnd() ){ |
758 |
|
#endif // is_mpi |
759 |
|
|
760 |
|
for( k=0; k<comp_stamps[i]->getNTorsions(); k++ ){ |