1 |
mmeineke |
270 |
#include <cstdlib> |
2 |
chuckv |
290 |
#include <cstring> |
3 |
mmeineke |
270 |
|
4 |
chuckv |
290 |
|
5 |
mmeineke |
270 |
#include "SimInfo.hpp" |
6 |
mmeineke |
285 |
#define __C |
7 |
|
|
#include "fSimulation.h" |
8 |
chuckv |
290 |
#include "simError.h" |
9 |
|
|
|
10 |
mmeineke |
294 |
#include <fortranWrappers.hpp> |
11 |
mmeineke |
270 |
|
12 |
|
|
SimInfo* currentInfo; |
13 |
|
|
|
14 |
|
|
SimInfo::SimInfo(){ |
15 |
|
|
excludes = NULL; |
16 |
|
|
n_constraints = 0; |
17 |
|
|
n_oriented = 0; |
18 |
|
|
n_dipoles = 0; |
19 |
|
|
the_integrator = NULL; |
20 |
|
|
setTemp = 0; |
21 |
|
|
thermalTime = 0.0; |
22 |
|
|
|
23 |
mmeineke |
294 |
wrapMeSimInfo( this ); |
24 |
mmeineke |
270 |
} |
25 |
|
|
|
26 |
|
|
void SimInfo::refreshSim(){ |
27 |
|
|
|
28 |
chuckv |
290 |
simtype fInfo; |
29 |
|
|
int isError; |
30 |
mmeineke |
285 |
|
31 |
chuckv |
290 |
fInfo.box[0] = box_x; |
32 |
|
|
fInfo.box[1] = box_y; |
33 |
|
|
fInfo.box[2] = box_z; |
34 |
|
|
|
35 |
|
|
fInfo.rlist = rList; |
36 |
|
|
fInfo.rcut = rCut; |
37 |
|
|
fInfo.rlistsq = rlist * rlist; |
38 |
|
|
fInfo.rcutsq = rCut * rCut; |
39 |
|
|
fInfo.rcut6 = fInfo.rcutsq * fInfo.rcutsq * fInfo.rcutsq; |
40 |
|
|
fInfo.natoms = n_atoms; |
41 |
|
|
fInfo.usePBC = usePBC; |
42 |
|
|
strcpy( fInfo.ensemble, ensemble ); |
43 |
|
|
strcpy( fInfo.mixingRule, mixingRule ); |
44 |
|
|
|
45 |
|
|
isError = 0; |
46 |
|
|
setFsimulation( &fInfo, &isError ); |
47 |
|
|
|
48 |
|
|
if( isError ){ |
49 |
|
|
|
50 |
|
|
sprintf( painCave.errMsg, |
51 |
|
|
"There was an error setting the simulation information in fortran.\n" ); |
52 |
|
|
painCave.isFatal = 1; |
53 |
|
|
simError(); |
54 |
|
|
} |
55 |
|
|
|
56 |
|
|
#ifdef IS_MPI |
57 |
|
|
sprintf( checkPointMsg, |
58 |
|
|
"succesfully sent the simulation information to fortran.\n"); |
59 |
|
|
MPIcheckPoint(); |
60 |
|
|
#endif // is_mpi |
61 |
mmeineke |
270 |
} |
62 |
|
|
|