SimulationParams.h
Go to the documentation of this file.
1 //
2 // This file is part of the FFEA simulation package
3 //
4 // Copyright (c) by the Theory and Development FFEA teams,
5 // as they appear in the README.md file.
6 //
7 // FFEA is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // FFEA is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with FFEA. If not, see <http://www.gnu.org/licenses/>.
19 //
20 // To help us fund FFEA development, we humbly ask that you cite
21 // the research papers on the package.
22 //
23 
24 #ifndef PARAMS_H_INCLUDED
25 #define PARAMS_H_INCLUDED
26 
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string>
30 #include <time.h>
31 #include <vector>
32 #include <map>
33 #include <iostream>
34 #include <boost/algorithm/string.hpp>
35 #include <boost/filesystem.hpp>
36 #include <boost/lexical_cast.hpp>
37 
38 #include "FFEA_return_codes.h"
39 #include "FFEA_user_info.h"
40 #include "mat_vec_types.h"
41 #include "dimensions.h"
42 #include "FFEA_input_reader.h"
43 
44 #define WALL_TYPE_PBC 0
45 #define WALL_TYPE_HARD 1
46 #define WALL_TYPE_STOP 2
47 
48 #define UNSET 0
49 #define SET 1
50 #define DEFAULT 2
51 
56 using namespace std;
57 namespace b_fs = boost::filesystem;
58 
67  vector<string> types;
68  string folder;
69  int inputData;
72 };
73 
74 
76 public:
78  long long num_steps;
79  int check;
80  int num_blobs;
81  int num_rods;
84  int *num_states;
87  int rng_seed;
88 
90 
93 
94  int es_update;
95  int es_N_x;
96  int es_N_y;
97  int es_N_z;
99  int restrict_motion[3];
102 
104 
107 
108  int restart;
109 
112  string ssint_type;
113  int calc_es;
120  int force_pbc;
122  int wall_x_1;
123  int wall_x_2;
124  int wall_y_1;
125  int wall_y_2;
126  int wall_z_1;
127  int wall_z_2;
128 
130 
132 
137 
139  b_fs::path FFEA_script_path, FFEA_script_basename;
148  string ctforces_fname;
149  string springs_fname;
151 
153 
154  ~SimulationParams();
155 
156  int validate(int sim_mode);
157 
163  int parse_param_assignment(char *str);
164 
168  int extract_params(vector<string> script_vector);
169 
171  int assign(string lvalue, string rvalue);
172 
174  int get_max_num_states();
175 
179 
181  void write_to_file(FILE *fout, PreComp_params &pc_params);
182 
183 private:
190 
195  int checkFileName(string oFile);
196 
197  string RemoveFileExtension(const string& FileName);
198 };
199 #endif
long long num_steps
Number of time steps to run simulation for.
Definition: SimulationParams.h:78
int force_pbc
Whether or not to apply pbc to surface insteractions.
Definition: SimulationParams.h:120
string FFEA_script_filename
Definition: SimulationParams.h:138
string kinetics_out_fname
Definition: SimulationParams.h:141
int calc_ssint
Whether or not to simulate surface-surface interactions between surfaces.
Definition: SimulationParams.h:110
string ssint_in_fname
Definition: SimulationParams.h:144
int wall_y_1
Definition: SimulationParams.h:124
int conformation_array_size
Definition: SimulationParams.h:86
int icheckpoint_fname_set
Definition: SimulationParams.h:186
scalar dist_to_m
Definition: SimulationParams.h:70
int measurement_out_fname_set
Definition: SimulationParams.h:185
geoscalar steric_dr
used to calculate the numerical derivative.
Definition: SimulationParams.h:136
scalar epsilon2
The tolerance threshold for CG solver (squared)
Definition: SimulationParams.h:92
string trajectory_beads_fname
Output optional file.
Definition: SimulationParams.h:150
int calc_preComp
Whether or not use preComputed potentials and forces.
Definition: SimulationParams.h:117
int trajectory_out_fname_set
Definition: SimulationParams.h:184
int bsite_in_fname_set
Definition: SimulationParams.h:189
string icheckpoint_fname
Input Checkpoint file name.
Definition: SimulationParams.h:146
string springs_fname
Input file containing the springs details.
Definition: SimulationParams.h:149
scalar stokes_visc
Definition: SimulationParams.h:131
int num_interfaces
Number of rod-blob or rod-rod interfaces.
Definition: SimulationParams.h:82
int restart
Whether or not to restart the simulation from the last available time step.
Definition: SimulationParams.h:108
int calc_springs
Whether or not to include the springs interactions defined in the springs block.
Definition: SimulationParams.h:118
STL namespace.
string ctforces_fname
Input file containing constant forces onto a list of nodes.
Definition: SimulationParams.h:148
int sticky_wall_xz
Definition: SimulationParams.h:129
scalar es_h
Number of active dimensions after restricted_motion is applied.
Definition: SimulationParams.h:101
int wall_y_2
Definition: SimulationParams.h:125
Definition: SimulationParams.h:66
int move_into_box
If box is set, do we move the world to it&#39;s center at the start of a simulation? Default is yes! ...
Definition: SimulationParams.h:98
int state_array_size
Definition: SimulationParams.h:85
int inputData
1 means read .force and .pot files, while 2 means read .pot and calculate the forces ...
Definition: SimulationParams.h:69
double geoscalar
Definition: mat_vec_types.h:37
scalar dielec_ext
Exterior dielectric constant.
Definition: SimulationParams.h:106
int check
Every how many steps should the program &#39;check&#39; the system i.e calculate energies, print snapshots etc.
Definition: SimulationParams.h:79
int max_iterations_cg
Max number of iterations when using conjugate gradient solver.
Definition: SimulationParams.h:91
scalar dt
time step
Definition: SimulationParams.h:77
int es_N_x
X dimension of the 3D lookup grid (in number of cells)
Definition: SimulationParams.h:95
int calc_es
Whether or not to simulate electrostatic interactions between proteins.
Definition: SimulationParams.h:113
string detailed_meas_out_fname
Definition: SimulationParams.h:143
int wall_z_1
Definition: SimulationParams.h:126
scalar steric_factor
Proportionality factor to the Steric repulsion.
Definition: SimulationParams.h:134
int wall_z_2
Definition: SimulationParams.h:127
int es_update
Every how many steps should the electrostatic potential be recalculated.
Definition: SimulationParams.h:94
int wall_x_1
Definition: SimulationParams.h:122
int kinetics_out_fname_set
Definition: SimulationParams.h:177
scalar kappa
Inverse Debye Screening length.
Definition: SimulationParams.h:103
int num_rods
Number of rods in the system.
Definition: SimulationParams.h:81
int calc_stokes
Whether or not to include local action of the external fluid.
Definition: SimulationParams.h:115
string bsite_in_fname
Definition: SimulationParams.h:145
vector< string > types
types of beads present
Definition: SimulationParams.h:67
int ocheckpoint_fname_set
Definition: SimulationParams.h:187
scalar kT
boltzmann&#39;s const times temperature
Definition: SimulationParams.h:89
int wall_x_2
Definition: SimulationParams.h:123
int calc_steric
Calculate steric interactions?
Definition: SimulationParams.h:133
int rng_seed
Seed for random number generator.
Definition: SimulationParams.h:87
int calc_ctforces
Whether or not to include constant forces onto nodes defined in the ctforces block.
Definition: SimulationParams.h:119
Definition: SimulationParams.h:75
scalar ssint_cutoff
Cutoff distance for the surface-surface interactions.
Definition: SimulationParams.h:135
string ocheckpoint_fname
Output Checkpoint file name.
Definition: SimulationParams.h:147
scalar E_to_J
Definition: SimulationParams.h:71
int ssint_in_fname_set
Definition: SimulationParams.h:188
int inc_self_ssint
Whether or not to include surface-surface interactions derived from faces in the same blob...
Definition: SimulationParams.h:111
string folder
folder containing the tables. It can be either absolute or relative to the folder containing the ffea...
Definition: SimulationParams.h:68
int es_N_y
Y dimension of the 3D lookup grid (in number of cells)
Definition: SimulationParams.h:96
int * num_states
Number of states for each blob.
Definition: SimulationParams.h:84
int calc_kinetics
Whether or not to calculate kinetic switching between different equilibrium states and binding sites...
Definition: SimulationParams.h:116
int es_N_z
Z dimension of the 3D lookup grid (in number of cells)
Definition: SimulationParams.h:97
string ssint_type
Current possible values: "lennard-jones" (default) or "steric".
Definition: SimulationParams.h:112
string measurement_out_fname
Definition: SimulationParams.h:142
int trajbeads_fname_set
Definition: SimulationParams.h:178
b_fs::path FFEA_script_path
Definition: SimulationParams.h:139
int num_blobs
Number of blobs in the system.
Definition: SimulationParams.h:80
int * num_conformations
Number of conformations for each blob.
Definition: SimulationParams.h:83
double scalar
Definition: mat_vec_types.h:36
int calc_noise
Whether or noise to simulate thermal noise for the system. Kind of the entire point of this simulatio...
Definition: SimulationParams.h:114
string trajectory_out_fname
Definition: SimulationParams.h:140
int num_dimensions
Definition: SimulationParams.h:100
int kinetics_update
How often to check for a state change. If rates are ~ >> dt then this can clearly be quite high...
Definition: SimulationParams.h:121
scalar epsilon_0
Permittivity of free space.
Definition: SimulationParams.h:105