6 |
|
#include "parse_me.h" |
7 |
|
#include "LRI.hpp" |
8 |
|
#include "Integrator.hpp" |
9 |
+ |
#include "simError.h" |
10 |
+ |
|
11 |
|
#ifdef IS_MPI |
12 |
|
#include "mpiBASS.h" |
13 |
|
#include "bassDiag.hpp" |
16 |
|
SimSetup::SimSetup(){ |
17 |
|
stamps = new MakeStamps(); |
18 |
|
globals = new Globals(); |
19 |
+ |
|
20 |
+ |
#ifdef IS_MPI |
21 |
+ |
strcpy( checkPointMsg, "SimSetup creation successful" ); |
22 |
+ |
MPIcheckPoint(); |
23 |
+ |
#endif // IS_MPI |
24 |
|
} |
25 |
|
|
26 |
|
SimSetup::~SimSetup(){ |
30 |
|
|
31 |
|
void SimSetup::parseFile( char* fileName ){ |
32 |
|
|
26 |
– |
inFileName = fileName; |
27 |
– |
set_interface_stamps( stamps, globals ); |
33 |
|
#ifdef IS_MPI |
34 |
< |
mpiEventInit(); |
34 |
> |
if( worldRank == 0 ){ |
35 |
> |
#endif // is_mpi |
36 |
> |
|
37 |
> |
inFileName = fileName; |
38 |
> |
set_interface_stamps( stamps, globals ); |
39 |
> |
|
40 |
> |
#ifdef IS_MPI |
41 |
> |
mpiEventInit(); |
42 |
|
#endif |
43 |
< |
yacc_BASS( fileName ); |
43 |
> |
|
44 |
> |
yacc_BASS( fileName ); |
45 |
> |
|
46 |
|
#ifdef IS_MPI |
47 |
< |
throwMPIEvent(NULL); |
47 |
> |
throwMPIEvent(NULL); |
48 |
> |
} |
49 |
> |
else receiveParse(); |
50 |
|
#endif |
51 |
|
|
52 |
|
} |
56 |
|
|
57 |
|
set_interface_stamps( stamps, globals ); |
58 |
|
mpiEventInit(); |
59 |
+ |
MPIcheckPoint(); |
60 |
|
mpiEventLoop(); |
61 |
|
|
62 |
|
} |
68 |
|
delete dumpMe; |
69 |
|
} |
70 |
|
#endif |
71 |
+ |
|
72 |
|
void SimSetup::createSim( void ){ |
73 |
|
|
74 |
|
MakeStamps *the_stamps; |
93 |
|
else if( !strcmp( force_field, "DipoleTest" ) ) the_ff = new DipoleTestFF(); |
94 |
|
else if( !strcmp( force_field, "TraPPE_Ex" ) ) the_ff = new TraPPE_ExFF(); |
95 |
|
else{ |
96 |
< |
std::cerr<< "SimSetup Error. Unrecognized force field -> " |
97 |
< |
<< force_field << "\n"; |
98 |
< |
exit(8); |
96 |
> |
sprintf( painCave.errMsg, |
97 |
> |
"SimSetup Error. Unrecognized force field -> %s\n", |
98 |
> |
force_field ); |
99 |
> |
painCave.isFatal = 1; |
100 |
> |
simError(); |
101 |
|
} |
102 |
|
|
103 |
+ |
#ifdef IS_MPI |
104 |
+ |
strcpy( checkPointMsg, "ForceField creation successful" ); |
105 |
+ |
MPIcheckPoint(); |
106 |
+ |
#endif // is_mpi |
107 |
+ |
|
108 |
|
// get the components and calculate the tot_nMol and indvidual n_mol |
109 |
|
the_components = the_globals->getComponents(); |
110 |
|
components_nmol = new int[n_components]; |
180 |
|
// create the atom and short range interaction arrays |
181 |
|
|
182 |
|
the_atoms = new Atom*[tot_atoms]; |
183 |
+ |
Atom::createArrays(tot_atoms); |
184 |
|
the_molecules = new Molecule[tot_nmol]; |
185 |
|
|
186 |
|
|
417 |
|
current_atom = comp_stamps[i]->getAtom( k ); |
418 |
|
if( current_atom->haveOrientation() ){ |
419 |
|
|
420 |
< |
dAtom = new DirectionalAtom; |
420 |
> |
dAtom = new DirectionalAtom(index); |
421 |
|
simnfo->n_oriented++; |
422 |
|
the_atoms[index] = dAtom; |
423 |
|
|
437 |
|
dAtom->setSUz( uz ); |
438 |
|
} |
439 |
|
else{ |
440 |
< |
the_atoms[index] = new GeneralAtom; |
440 |
> |
the_atoms[index] = new GeneralAtom(index); |
441 |
|
} |
442 |
|
the_atoms[index]->setType( current_atom->getType() ); |
443 |
|
the_atoms[index]->setIndex( index ); |