 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
31 memset(md, 0,
sizeof(
Bmd));
93 cout <<
"Starting to convert molecular dynamics parameters from the STAR database" << endl;
105 cout << nbond <<
" bond types and " << nangle <<
" angle types found" << endl << endl;
110 for ( data=item->
data; data; data=data->
next )
114 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
118 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
122 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
126 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
130 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
134 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
138 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
142 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
146 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
150 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
154 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
158 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
162 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
166 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
170 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
174 for ( data=item->
data, atom=md->
atom; data && atom; data=data->
next, atom=atom->
next )
180 for ( i=0; i<nbond; i++ ) {
186 for ( data=item->
data, bond=md->
bond; data && bond; data=data->
next, bond=bond->
next )
190 for ( data=item->
data, bond=md->
bond; data && bond; data=data->
next, bond=bond->
next )
194 for ( data=item->
data, bond=md->
bond; data && bond; data=data->
next, bond=bond->
next )
198 for ( data=item->
data, bond=md->
bond; data && bond; data=data->
next, bond=bond->
next )
204 for ( i=0; i<nangle; i++ ) {
210 for ( data=item->
data, angle=md->
angle; data && angle; data=data->
next, angle=angle->
next )
214 for ( data=item->
data, angle=md->
angle; data && angle; data=data->
next, angle=angle->
next )
218 for ( data=item->
data, angle=md->
angle; data && angle; data=data->
next, angle=angle->
next )
222 for ( data=item->
data, angle=md->
angle; data && angle; data=data->
next, angle=angle->
next )
239 int natom, nbond, nangle, loop, err(0);
240 Bstring comment(
"Bsoft molecular dynamics parameter file\n");
250 for ( natom=0, atom=md->
atom; atom; atom=atom->
next, natom++ ) ;
251 for ( nbond=0, bond=md->
bond; bond; bond=bond->
next ) nbond++;
252 for ( nangle=0, angle=md->
angle; angle; angle=angle->
next ) nangle++;
256 block->
tag =
"atom_types";
260 (
char *)&md->
atom->
z - (
char *)md->
atom,
"%4d");
268 (
char *)&md->
atom->
vdw - (
char *)md->
atom,
"%7.3f");
270 (
char *)&md->
atom->
sfa[0] - (
char *)md->
atom,
"%7.4f");
272 (
char *)&md->
atom->
sfa[1] - (
char *)md->
atom,
"%7.4f");
274 (
char *)&md->
atom->
sfa[2] - (
char *)md->
atom,
"%7.4f");
276 (
char *)&md->
atom->
sfa[3] - (
char *)md->
atom,
"%7.4f");
278 (
char *)&md->
atom->
sfa[4] - (
char *)md->
atom,
"%7.4f");
280 (
char *)&md->
atom->
sfb[0] - (
char *)md->
atom,
"%7.4f");
282 (
char *)&md->
atom->
sfb[1] - (
char *)md->
atom,
"%7.4f");
284 (
char *)&md->
atom->
sfb[2] - (
char *)md->
atom,
"%7.4f");
286 (
char *)&md->
atom->
sfb[3] - (
char *)md->
atom,
"%7.4f");
288 (
char *)&md->
atom->
sfb[4] - (
char *)md->
atom,
"%7.4f");
290 (
char *)&md->
atom->
sfc - (
char *)md->
atom,
"%7.4f");
297 block->
tag =
"bond_types";
312 block->
tag =
"angle_types";
353 strncpy(new_bond->
type1, symbol1, 8);
354 strncpy(new_bond->
type2, symbol2, 8);
359 cout <<
"DEBUG bond_type_add: covlength=" << covlength <<
" vdwdist=" << vdwdist << endl;
364 while ( this_bond->
next ) this_bond = this_bond->
next;
365 this_bond->
next = new_bond;
391 strncpy(new_angle->
type1, symbol1, 8);
392 strncpy(new_angle->
type2, symbol2, 8);
393 strncpy(new_angle->
type3, symbol3, 8);
394 new_angle->
angle = a;
397 cout <<
"DEBUG angle_type_add: angle = " << a << endl;
402 while ( this_angle->
next ) this_angle = this_angle->
next;
403 this_angle->
next = new_angle;
int item_put_list(Bstar_block *block, const char *tag, char *list, size_t offset, const char *format)
Writes a list of string or numeric values into a data item associated with a specific data block and ...
int item_index(Bstar_block *block, const char *tag)
Gets the STAR item associated with a tag in a STAR data block.
long kill_list(char *list, unsigned long size)
Frees all the items in a linked list.
char * add_item(char **list, unsigned long size)
Adds an item to a linked list.
Bmd * md_init_with_types()
Initializes a molecular dynamics structure.
int md_kill(Bmd *md)
Deallocates a molecular dynamics structure.
Header to read and write molecular dynamics parameters in STAR format.
int loop_set_identifier(Bstar_block *block, int loop, int n,...)
Assigns a loop identification number to items.
Bmd * md_init()
Initializes a molecular dynamics structure.
Bangletype * angle_type_add(Bangletype **angle, char *symbol1, char *symbol2, char *symbol3, float a)
int write_star(const char *filename, Bstar *star)
Writes a STAR data base to one or more STAR format files.
Bmd * read_md_parameters(Bstring &filename)
Reading molecular dynamics parameters from STAR files.
Header file for general utilities.
Bbondtype * bond_type_add(Bbondtype **bond, char *symbol1, char *symbol2, float covlength, float vdwdist)
int read_star(const char *filename, Bstar *star)
Reads paramaters and data into a STAR data base from a list of files.
int kill_star(Bstar *star)
Destroys a STAR data base.
Header file for generalized linked list functions.
long item_get_number(Bstar *star, const char *tag)
Gets the number of values associated with a tag in a STAR data base.
Bstar_item * item_find(Bstar_block *block, const char *tag)
Gets the STAR item associated with a tag in a STAR data block.
int write_md_parameters(Bstring &filename, Bmd *md)
Writing molecular dynamics parameters to a STAR file.
int item_put_angle_list(Bstar_block *block, const char *tag, char *list, size_t offset, const char *format)
Writes a list of angular values in degrees into a data item associated with a specific data block and...
A header file for STAR format files.
Batomtype * atom_type_add(Batomtype **atype, const char *aname)
Adds an atom type structure to a linked list.
Bstar * init_star()
Creates a STAR data base.
Bstar_block * block_find_with_tag(Bstar *star, const char *tag)
Gets the first block associated with a tag in a STAR data base.