189 |
|
if( currentStamp == NULL ){ |
190 |
|
sprintf( painCave.errMsg, |
191 |
|
"SimSetup error: Component \"%s\" was not found in the " |
192 |
< |
"list of declared molecules\n" |
192 |
> |
"list of declared molecules\n", |
193 |
|
id ); |
194 |
|
painCave.isFatal = 1; |
195 |
|
simError(); |
238 |
|
|
239 |
|
mpiSim = new mpiSimulation( simnfo ); |
240 |
|
|
241 |
< |
mpiSim->divideLabor(); |
241 |
> |
fprintf( stderr, "about to call divideLabour.\n" ); |
242 |
|
|
243 |
+ |
globalIndex = mpiSim->divideLabor(); |
244 |
+ |
|
245 |
+ |
fprintf(stderr, "we're back from divideLabour\n" ); |
246 |
+ |
|
247 |
|
// set up the local variables |
248 |
|
|
249 |
|
int localMol, allMol; |
317 |
|
simnfo->sr_interactions = the_sris; |
318 |
|
simnfo->n_exclude = tot_SRI; |
319 |
|
simnfo->excludes = the_excludes; |
316 |
– |
|
317 |
– |
|
318 |
– |
// initialize the arrays |
320 |
|
|
320 |
– |
the_ff->setSimInfo( simnfo ); |
321 |
|
|
322 |
– |
makeAtoms(); |
323 |
– |
|
324 |
– |
if( tot_bonds ){ |
325 |
– |
makeBonds(); |
326 |
– |
} |
327 |
– |
|
328 |
– |
if( tot_bends ){ |
329 |
– |
makeBends(); |
330 |
– |
} |
331 |
– |
|
332 |
– |
if( tot_torsions ){ |
333 |
– |
makeTorsions(); |
334 |
– |
} |
335 |
– |
|
336 |
– |
|
322 |
|
// get some of the tricky things that may still be in the globals |
323 |
|
|
324 |
|
if( simnfo->n_dipoles ){ |
391 |
|
#endif // is_mpi |
392 |
|
|
393 |
|
|
394 |
+ |
// initialize the arrays |
395 |
|
|
396 |
+ |
the_ff->setSimInfo( simnfo ); |
397 |
+ |
|
398 |
+ |
makeAtoms(); |
399 |
+ |
|
400 |
+ |
if( tot_bonds ){ |
401 |
+ |
makeBonds(); |
402 |
+ |
} |
403 |
+ |
|
404 |
+ |
if( tot_bends ){ |
405 |
+ |
makeBends(); |
406 |
+ |
} |
407 |
+ |
|
408 |
+ |
if( tot_torsions ){ |
409 |
+ |
makeTorsions(); |
410 |
+ |
} |
411 |
+ |
|
412 |
+ |
|
413 |
+ |
|
414 |
+ |
|
415 |
+ |
|
416 |
+ |
|
417 |
|
if( the_globals->haveInitialConfig() ){ |
418 |
|
|
419 |
|
InitializeFromFile* fileInit; |
567 |
|
if( the_globals->haveTempSet() ) simnfo->setTemp = the_globals->getTempSet(); |
568 |
|
|
569 |
|
|
570 |
< |
// make the longe range forces and the integrator |
570 |
> |
// // make the longe range forces and the integrator |
571 |
|
|
572 |
< |
new AllLong( simnfo ); |
572 |
> |
// new AllLong( simnfo ); |
573 |
|
|
574 |
< |
if( !strcmp( force_field, "TraPPE" ) ) new Verlet( *simnfo ); |
574 |
> |
if( !strcmp( force_field, "TraPPE" ) ) new Verlet( *simnfo, the_ff ); |
575 |
|
if( !strcmp( force_field, "DipoleTest" ) ) new Symplectic( simnfo ); |
576 |
|
if( !strcmp( force_field, "TraPPE_Ex" ) ) new Symplectic( simnfo ); |
577 |
+ |
if( !strcmp( force_field, "LJ" ) ) new Verlet( *simnfo, the_ff ); |
578 |
+ |
|
579 |
|
} |
580 |
|
|
581 |
|
void SimSetup::makeAtoms( void ){ |
649 |
|
} |
650 |
|
} |
651 |
|
|
652 |
+ |
#ifdef IS_MPI |
653 |
+ |
for( i=0; i<mpiSim->getMyNlocal(); i++ ) the_atoms[i]->setGlobalIndex( globalIndex[i] ); |
654 |
+ |
|
655 |
+ |
delete[] globalIndex; |
656 |
+ |
|
657 |
+ |
mpiSim->mpiRefresh(); |
658 |
+ |
#endif //IS_MPI |
659 |
+ |
|
660 |
|
the_ff->initializeAtoms(); |
661 |
|
} |
662 |
|
|
669 |
|
the_bonds = new bond_pair[tot_bonds]; |
670 |
|
index = 0; |
671 |
|
offset = 0; |
672 |
< |
molIndex = 0;g1 |
672 |
> |
molIndex = 0; |
673 |
|
|
674 |
|
for( i=0; i<n_components; i++ ){ |
675 |
|
|
696 |
|
|
697 |
|
#ifdef IS_MPI |
698 |
|
} |
699 |
< |
#endif is_mpi |
699 |
> |
#endif //is_mpi |
700 |
|
|
701 |
|
molIndex++; |
702 |
|
} |