 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
29 "Usage: bmd [options] in.pdb out.pdb",
30 "-----------------------------------",
31 "Calculates forces on an atomic structure and adjust coordinates.",
34 "-dynamics 4000 Number of iterations for molecular dynamics.",
37 "-verbose 7 Verbose output.",
39 "-size 10,10,10 Simulation box size (angstrom).",
40 "-bonds intra Generate all or intramolecular bonds only.",
42 "-wrap Wrap around (periodic boundaries).",
43 "-timestep 0.01 Integration time step (default 0.001).",
44 "-velocitylimit 0.01 Limit on the velocity (default 0.1 per time step).",
45 "-friction 0.2 Friction constant (default 1 = no friction).",
46 "-Kbond 150 Bond strength (default 1).",
47 "-Kangle 4 Angle strength (default 1).",
48 "-Kvdw 0.1 Van der Waals strength (default 0).",
49 "-Kelectrostatic 0.4 Electrostatic strength (default 0).",
50 "-cutoff 7.8 Distance cutoff for non-bonded forces (default 5 A).",
53 "-parameters md.star Molecular dynamics parameter file (default md_param.star).",
56 "-output param.star Output parameter file.",
61 int main(
int argc,
char **argv)
70 double timestep(0.001);
71 double velocitylimit(0.1);
79 Bstring paramfile(
"md_param.star");
85 for ( curropt = option; curropt; curropt = curropt->
next ) {
86 if ( curropt->
tag ==
"size" ) {
87 size = curropt->
size();
89 cerr <<
"-size: All three dimensions must be specified" << endl;
91 if ( curropt->
tag ==
"wrap" ) wrap = 1;
92 if ( curropt->
tag ==
"bonds" ) {
96 if ( curropt->
tag ==
"length" )
97 if ( ( bondlength = curropt->
value.
real() ) < 1e-6 )
98 cerr <<
"-length: A bond length must be specified!" << endl;
99 if ( curropt->
tag ==
"dynamics" )
101 cerr <<
"-dynamics: The number of iterations must be specified!" << endl;
102 if ( curropt->
tag ==
"timestep" )
103 if ( ( timestep = curropt->
value.
real() ) < 1e-6 )
104 cerr <<
"-timestep: The time step must be specified!" << endl;
105 if ( curropt->
tag ==
"velocitylimit" )
106 if ( ( velocitylimit = curropt->
value.
real() ) < 1e-6 )
107 cerr <<
"-velocitylimit: The velocity limit must be specified!" << endl;
108 if ( curropt->
tag ==
"friction" )
109 if ( ( Kfriction = curropt->
value.
real() ) < 1e-6 )
110 cerr <<
"-friction: The friction constant must be specified!" << endl;
111 if ( curropt->
tag ==
"Kbond" )
112 if ( ( Kbond = curropt->
value.
real() ) < 1e-6 )
113 cerr <<
"-Kbond: The bond strength must be specified!" << endl;
114 if ( curropt->
tag ==
"Kangle" )
115 if ( ( Kangle = curropt->
value.
real() ) < 1e-6 )
116 cerr <<
"-Kangle: The angle strength must be specified!" << endl;
117 if ( curropt->
tag ==
"Kelectrostatic" )
118 if ( ( Kelec = curropt->
value.
real() ) < 1e-6 )
119 cerr <<
"-Kelectrostatic: The electrostatic strength must be specified!" << endl;
120 if ( curropt->
tag ==
"Kvdw" )
121 if ( ( Kvdw = curropt->
value.
real() ) < 1e-6 )
122 cerr <<
"-Kvdw: The Van der Waals strength must be specified!" << endl;
123 if ( curropt->
tag ==
"cutoff" )
124 if ( ( cutoff = curropt->
value.
real() ) < 1e-6 )
125 cerr <<
"-cutoff: The cutoff distance must be specified!" << endl;
126 if ( curropt->
tag ==
"parameters" )
128 if ( curropt->
tag ==
"output" )
135 Bstring filename(argv[optind++]);
138 cerr <<
"Error: No molecule to work with!" << endl;
142 if ( size[0] > 0 && size[1] > 0 && size[2] > 0 )
143 molgroup->
box = size;
145 molgroup->
box = molgroup->
max - molgroup->
min;
149 cerr <<
"Error: File " << paramfile <<
" not read!" << endl;
164 Bbond* bondlist = NULL;
167 else if ( bondtype == 2 )
187 if ( molgroup->
mol && max_iter ) {
188 md_leapfrog(molgroup, md, max_iter, velocitylimit);
201 if ( optind < argc ) {
A class for a command line input option.
int md_show_bond_types(Bmolgroup *molgroup, Bbondtype *bondtype)
Shows the bond type composition.
int molgroup_kill(Bmolgroup *molgroup)
Destroys a molecule group.
Bbond * md_generate_bond_list_with_valence(Bmolgroup *molgroup, Bmd *md, int valence)
Generates a bond list based on a single valence and the shortest current bond lengths.
int molecule_update_comment(Bmolgroup *molgroup, int n, char **strings)
Puts a set of strings and time in the main comment of a molecule group.
int md_kill(Bmd *md)
Deallocates a molecular dynamics structure.
double md_bond_list_set_parameters(Bbond *bondlist, Bbondtype *bondtype)
Assigns covalent bond lengths to bonds.
int bexit(int value)
Exit function for cleanup and debugging.
Header to read and write molecular dynamics parameters in STAR format.
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Bmolgroup * read_molecule(const char *filename, const char *select, const char *paramfile)
The generalized function for reading molecular files.
Header file for option handlers.
Header for molecular dynamics.
Header file for reading reflection files.
Utilities for timing functions.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
double molgroup_density(Bmolgroup *molgroup)
Calculates the number and mass density of a molecular system.
Bangle * md_generate_angle_list(Bmolgroup *molgroup, Bmd *md)
Generates an angle list.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
int write_molecule(char *filename, Bmolgroup *molgroup)
Writes a molecule group.
int md_show_bonds(Bmolgroup *molgroup)
Shows the bonds and bond lengths.
int md_calculate_radial_deviation(Bmolgroup *molgroup)
Calculates the radial deviations from the center of the box.
Bbond * md_generate_bond_list(Bmolgroup *molgroup, Bmd *md)
Generates a distance-based bond list.
Generalized matrix class.
int main(int argc, char **argv)
Header file for generalized linked list functions.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
double md_leapfrog(Bmolgroup *molgroup, Bmd *md, int max_iter, double velocitylimit)
Molecular dynamics using the leapfrog integrator.
Bbond * md_generate_molecular_bond_list(Bmolgroup *molgroup, Bmd *md)
Generates an intramolecular distance-based bond list.
bool contains(const Bstring &s)
int md_show_bond_stats(Bmolgroup *molgroup)
Shows the number of bonds and the valency per atom.
Bmd * read_md_parameters(Bstring &filename)
Reading molecular dynamics parameters from STAR files.
Header for molecular dynamics.
int write_md_parameters(Bstring &filename, Bmd *md)
Writing molecular dynamics parameters to a STAR file.
Library routines used for atomic coordinates.
double md_calculate_deviations(Bmolgroup *molgroup, int wrap)
Calculates deviations from the reference bond lengths and angles.