1 |
gezelter |
1334 |
#ifndef __SIMSETUP_H__ |
2 |
|
|
#define __SIMSETUP_H__ |
3 |
tim |
1417 |
#include <string> |
4 |
gezelter |
1334 |
#include "MakeStamps.hpp" |
5 |
|
|
#include "Globals.hpp" |
6 |
|
|
#include "ForceFields.hpp" |
7 |
|
|
#include "SimInfo.hpp" |
8 |
|
|
#include "ReadWrite.hpp" |
9 |
|
|
#include "AllIntegrator.hpp" |
10 |
|
|
|
11 |
tim |
1417 |
using namespace std; |
12 |
gezelter |
1334 |
// this routine is defined in BASS_interface.cpp |
13 |
|
|
extern void set_interface_stamps( MakeStamps* ms, Globals* g ); |
14 |
|
|
|
15 |
tim |
1417 |
string getPrefix(const string& str ){ |
16 |
gezelter |
1418 |
string prefix; |
17 |
|
|
string suffix; |
18 |
tim |
1417 |
int pos; |
19 |
|
|
|
20 |
gezelter |
1418 |
pos = str.rfind("."); |
21 |
|
|
|
22 |
|
|
if (pos >= 0) { |
23 |
|
|
prefix = str.substr(0, pos); |
24 |
|
|
suffix = str.substr(pos, str.size()); |
25 |
|
|
|
26 |
|
|
// leave .bass there in case we've reverted to old habits |
27 |
|
|
if (!strcasecmp(suffix.c_str()), ".md") || !strcasecmp(suffix.c_str(), ".bass")) |
28 |
|
|
return prefix; |
29 |
|
|
else |
30 |
|
|
return str; |
31 |
|
|
|
32 |
|
|
} else |
33 |
|
|
return str; |
34 |
tim |
1417 |
}; |
35 |
|
|
|
36 |
gezelter |
1334 |
class SimSetup{ |
37 |
|
|
|
38 |
|
|
public: |
39 |
|
|
SimSetup(); |
40 |
|
|
~SimSetup(); |
41 |
|
|
|
42 |
|
|
void setSimInfo( SimInfo* the_info ) { info = the_info; } |
43 |
|
|
void setSimInfo( SimInfo* the_info, int theNinfo ); |
44 |
|
|
void suspendInit( void ) { initSuspend = true; } |
45 |
|
|
void parseFile( char* fileName ); |
46 |
|
|
void createSim( void ); |
47 |
|
|
|
48 |
|
|
|
49 |
|
|
private: |
50 |
|
|
|
51 |
|
|
#ifdef IS_MPI |
52 |
|
|
void receiveParse(void); |
53 |
|
|
#endif |
54 |
|
|
|
55 |
|
|
void gatherInfo( void ); |
56 |
|
|
void sysObjectsCreation( void ); |
57 |
|
|
void finalInfoCheck( void ); |
58 |
|
|
void initSystemCoords( void ); |
59 |
|
|
void makeOutNames(void); |
60 |
|
|
void makeIntegrator(void); |
61 |
|
|
void initFortran(void); |
62 |
|
|
void makeMinimizer(void); |
63 |
|
|
|
64 |
|
|
void createFF( void ); |
65 |
|
|
void compList( void ); |
66 |
|
|
void calcSysValues( void ); |
67 |
|
|
void makeSysArrays( void ); |
68 |
|
|
|
69 |
|
|
#ifdef IS_MPI |
70 |
|
|
void mpiMolDivide( void ); |
71 |
|
|
|
72 |
|
|
int* mol2proc; |
73 |
|
|
int* molCompType; |
74 |
|
|
|
75 |
|
|
#endif //is_mpi |
76 |
|
|
|
77 |
gezelter |
1418 |
void initFromMetaDataFile( void ); |
78 |
gezelter |
1334 |
void makeMolecules( void ); |
79 |
|
|
void makeElement( double x, double y, double z ); |
80 |
|
|
|
81 |
|
|
int ensembleCase; |
82 |
|
|
int ffCase; |
83 |
|
|
|
84 |
|
|
MakeStamps* stamps; |
85 |
|
|
Globals* globals; |
86 |
|
|
char* inFileName; |
87 |
|
|
|
88 |
|
|
SimInfo* info; |
89 |
|
|
int isInfoArray; |
90 |
|
|
int nInfo; |
91 |
|
|
|
92 |
|
|
bool initSuspend; |
93 |
|
|
|
94 |
|
|
int n_components; |
95 |
|
|
int globalAtomCounter; |
96 |
|
|
int globalMolCounter; |
97 |
|
|
|
98 |
|
|
char force_field[100]; |
99 |
|
|
char forcefield_variant[100]; |
100 |
|
|
char ensemble[100]; |
101 |
|
|
Component** the_components; |
102 |
|
|
|
103 |
|
|
int* components_nmol; |
104 |
|
|
MoleculeStamp** comp_stamps; //the stamps matching the components |
105 |
|
|
int tot_nmol; |
106 |
|
|
int tot_atoms; |
107 |
|
|
int tot_groups; |
108 |
|
|
int tot_rigid; |
109 |
|
|
int tot_bonds; |
110 |
|
|
int tot_bends; |
111 |
|
|
int tot_torsions; |
112 |
|
|
int tot_SRI; |
113 |
|
|
|
114 |
|
|
ForceFields* the_ff; |
115 |
|
|
|
116 |
|
|
// needed by makeElement |
117 |
|
|
|
118 |
|
|
int current_mol; |
119 |
|
|
int current_comp_mol; |
120 |
|
|
int current_comp; |
121 |
|
|
int current_atom_ndx; |
122 |
|
|
short int has_forcefield_variant; |
123 |
|
|
|
124 |
|
|
vector<int> globalAtomIndex; |
125 |
|
|
vector<int> globalGroupIndex; |
126 |
|
|
void setupZConstraint(SimInfo& theInfo); //setup parameters for zconstraint method |
127 |
|
|
|
128 |
|
|
}; |
129 |
|
|
#endif |