Bsoft  2.1.0
Bernard's software package
rwmd.cpp
Go to the documentation of this file.
1 
9 #include "rwmd.h"
10 #include "rwstar.h"
11 #include "mol_tags.h"
12 #include "linked_list.h"
13 #include "utilities.h"
14 
15 // Declaration of global variables
16 extern int verbose; // Level of output to the screen
17 
29 {
30  Bmd* md = new Bmd;
31  memset(md, 0, sizeof(Bmd));
32 
33  md->cutoff = 5;
34  md->sepdist = 4;
35  md->VdWcoeff1 = 1.0/12.0;
36  md->VdWcoeff2 = 1.0/6.0;
37 
38  return md;
39 }
40 
52 {
53  Bmd* md = md_init();
54 
55  char type[8] = "A";
56 
57  add_item((char **) &md->atom, sizeof(Batomtype));
58  strncpy(md->atom->name, type, 8);
59  md->atom->el[0] = type[0];
60 
61  add_item((char **) &md->bond, sizeof(Bbondtype));
62  strncpy(md->bond->type1, type, 8);
63  strncpy(md->bond->type2, type, 8);
64  md->bond->covlength = 1;
65 
66  add_item((char **) &md->angle, sizeof(Bangletype));
67  strncpy(md->angle->type1, type, 8);
68  strncpy(md->angle->type2, type, 8);
69  strncpy(md->angle->type3, type, 8);
70  md->angle->angle = M_PI*120.0/180.0;
71 
72  return md;
73 }
74 
81 {
82  int i;
83  Bstar* star = init_star();
84  star->line_length = 160; // Set the output line length
85 
86  if ( read_star(filename.c_str(), star) != 0 ) return NULL;
87 
88  Bstar_block* block = star->block;
89  Bstar_item* item = NULL;
90  Bstring* data;
91 
92  if ( verbose & VERB_FULL )
93  cout << "Starting to convert molecular dynamics parameters from the STAR database" << endl;
94 
95  Bmd* md = md_init();
96  Batomtype* atom = NULL;
97  Bbondtype* bond = NULL;
98  Bangletype* angle = NULL;
99 
100  int natom = item_get_number(star, ATOM_TYPE_SYMBOL);
101  int nbond = item_get_number(star, BOND_TYPE_SYMBOL1);
102  int nangle = item_get_number(star, ANGLE_TYPE_SYMBOL1);
103 
104  if ( verbose & VERB_FULL )
105  cout << nbond << " bond types and " << nangle << " angle types found" << endl << endl;
106 
107  if ( natom ) {
108  item = item_find(block, ATOM_TYPE_SYMBOL);
109  if ( item )
110  for ( data=item->data; data; data=data->next )
111  atom = atom_type_add(&md->atom, data->c_str());
112  item = item_find(block, ATOM_TYPE_NUMBER);
113  if ( item )
114  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
115  atom->z = data->integer();
116  item = item_find(block, ATOM_TYPE_MASS);
117  if ( item )
118  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
119  atom->mass = data->real();
120  item = item_find(block, ATOM_TYPE_OXIDATION);
121  if ( item )
122  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
123  atom->oxid = data->real();
124  item = item_find(block, ATOM_TYPE_RADIUS_BOND);
125  if ( item )
126  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
127  atom->bond = data->real();
128  item = item_find(block, ATOM_TYPE_RADIUS_VDW);
129  if ( item )
130  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
131  atom->vdw = data->real();
132  item = item_find(block, ATOM_TYPE_SCAT_A1);
133  if ( item )
134  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
135  atom->sfa[0] = data->real();
136  item = item_find(block, ATOM_TYPE_SCAT_A2);
137  if ( item )
138  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
139  atom->sfa[1] = data->real();
140  item = item_find(block, ATOM_TYPE_SCAT_A3);
141  if ( item )
142  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
143  atom->sfa[2] = data->real();
144  item = item_find(block, ATOM_TYPE_SCAT_A4);
145  if ( item )
146  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
147  atom->sfa[3] = data->real();
148  item = item_find(block, ATOM_TYPE_SCAT_A5);
149  if ( item )
150  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
151  atom->sfa[4] = data->real();
152  item = item_find(block, ATOM_TYPE_SCAT_B1);
153  if ( item )
154  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
155  atom->sfb[0] = data->real();
156  item = item_find(block, ATOM_TYPE_SCAT_B2);
157  if ( item )
158  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
159  atom->sfb[1] = data->real();
160  item = item_find(block, ATOM_TYPE_SCAT_B3);
161  if ( item )
162  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
163  atom->sfb[2] = data->real();
164  item = item_find(block, ATOM_TYPE_SCAT_B4);
165  if ( item )
166  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
167  atom->sfb[3] = data->real();
168  item = item_find(block, ATOM_TYPE_SCAT_B5);
169  if ( item )
170  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
171  atom->sfb[4] = data->real();
172  item = item_find(block, ATOM_TYPE_SCAT_C);
173  if ( item )
174  for ( data=item->data, atom=md->atom; data && atom; data=data->next, atom=atom->next )
175  atom->sfc = data->real();
176  }
177 
178  if ( nbond ) {
179  block = block_find_with_tag(star, BOND_TYPE_SYMBOL1);
180  for ( i=0; i<nbond; i++ ) {
181  if ( bond ) bond = (Bbondtype *) add_item((char **) &bond, sizeof(Bbondtype));
182  else bond = (Bbondtype *) add_item((char **) &md->bond, sizeof(Bbondtype));
183  }
184  item = item_find(block, BOND_TYPE_SYMBOL1);
185  if ( item )
186  for ( data=item->data, bond=md->bond; data && bond; data=data->next, bond=bond->next )
187  strncpy(bond->type1, data->c_str(), 8);
188  item = item_find(block, BOND_TYPE_SYMBOL2);
189  if ( item )
190  for ( data=item->data, bond=md->bond; data && bond; data=data->next, bond=bond->next )
191  strncpy(bond->type2, data->c_str(), 8);
192  item = item_find(block, BOND_TYPE_LENGTH);
193  if ( item )
194  for ( data=item->data, bond=md->bond; data && bond; data=data->next, bond=bond->next )
195  bond->covlength = data->real();
196  item = item_find(block, BOND_TYPE_VDWDIST);
197  if ( item )
198  for ( data=item->data, bond=md->bond; data && bond; data=data->next, bond=bond->next )
199  bond->vdwdist = data->real();
200  }
201 
202  if ( nangle ) {
204  for ( i=0; i<nangle; i++ ) {
205  if ( angle ) angle = (Bangletype *) add_item((char **) &angle, sizeof(Bangletype));
206  else angle = (Bangletype *) add_item((char **) &md->angle, sizeof(Bangletype));
207  }
208  item = item_find(block, ANGLE_TYPE_SYMBOL1);
209  if ( item )
210  for ( data=item->data, angle=md->angle; data && angle; data=data->next, angle=angle->next )
211  strncpy(angle->type1, data->c_str(), 8);
212  item = item_find(block, ANGLE_TYPE_SYMBOL2);
213  if ( item )
214  for ( data=item->data, angle=md->angle; data && angle; data=data->next, angle=angle->next )
215  strncpy(angle->type2, data->c_str(), 8);
216  item = item_find(block, ANGLE_TYPE_SYMBOL3);
217  if ( item )
218  for ( data=item->data, angle=md->angle; data && angle; data=data->next, angle=angle->next )
219  strncpy(angle->type3, data->c_str(), 8);
220  item = item_find(block, ANGLE_TYPE_ANGLE);
221  if ( item )
222  for ( data=item->data, angle=md->angle; data && angle; data=data->next, angle=angle->next )
223  angle->angle = data->real()*M_PI/180.0;
224  }
225 
226  kill_star(star);
227 
228  return md;
229 }
230 
237 int write_md_parameters(Bstring& filename, Bmd* md)
238 {
239  int natom, nbond, nangle, loop, err(0);
240  Bstring comment("Bsoft molecular dynamics parameter file\n");
241  Bstar* star = init_star();
242  Bstar_block* block = NULL;
243  star->line_length = 160; // Set the output line length
244  star->comment += comment;
245 
246  Batomtype* atom;
247  Bbondtype* bond;
248  Bangletype* angle;
249 
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++;
253 
254  if ( natom ) {
255  block = (Bstar_block *) add_item((char **)&star->block, sizeof(Bstar_block));
256  block->tag = "atom_types";
257  item_put_list(block, ATOM_TYPE_SYMBOL, (char *) md->atom,
258  (char *)&md->atom->name - (char *)md->atom, "%s");
259  item_put_list(block, ATOM_TYPE_NUMBER, (char *) md->atom,
260  (char *)&md->atom->z - (char *)md->atom, "%4d");
261  item_put_list(block, ATOM_TYPE_MASS, (char *) md->atom,
262  (char *)&md->atom->mass - (char *)md->atom, "%7.3f");
263  item_put_list(block, ATOM_TYPE_OXIDATION, (char *) md->atom,
264  (char *)&md->atom->oxid - (char *)md->atom, "%7.3f");
265  item_put_list(block, ATOM_TYPE_RADIUS_BOND, (char *) md->atom,
266  (char *)&md->atom->bond - (char *)md->atom, "%7.3f");
267  item_put_list(block, ATOM_TYPE_RADIUS_VDW, (char *) md->atom,
268  (char *)&md->atom->vdw - (char *)md->atom, "%7.3f");
269  item_put_list(block, ATOM_TYPE_SCAT_A1, (char *) md->atom,
270  (char *)&md->atom->sfa[0] - (char *)md->atom, "%7.4f");
271  item_put_list(block, ATOM_TYPE_SCAT_A2, (char *) md->atom,
272  (char *)&md->atom->sfa[1] - (char *)md->atom, "%7.4f");
273  item_put_list(block, ATOM_TYPE_SCAT_A3, (char *) md->atom,
274  (char *)&md->atom->sfa[2] - (char *)md->atom, "%7.4f");
275  item_put_list(block, ATOM_TYPE_SCAT_A4, (char *) md->atom,
276  (char *)&md->atom->sfa[3] - (char *)md->atom, "%7.4f");
277  item_put_list(block, ATOM_TYPE_SCAT_A5, (char *) md->atom,
278  (char *)&md->atom->sfa[4] - (char *)md->atom, "%7.4f");
279  item_put_list(block, ATOM_TYPE_SCAT_B1, (char *) md->atom,
280  (char *)&md->atom->sfb[0] - (char *)md->atom, "%7.4f");
281  item_put_list(block, ATOM_TYPE_SCAT_B2, (char *) md->atom,
282  (char *)&md->atom->sfb[1] - (char *)md->atom, "%7.4f");
283  item_put_list(block, ATOM_TYPE_SCAT_B3, (char *) md->atom,
284  (char *)&md->atom->sfb[2] - (char *)md->atom, "%7.4f");
285  item_put_list(block, ATOM_TYPE_SCAT_B4, (char *) md->atom,
286  (char *)&md->atom->sfb[3] - (char *)md->atom, "%7.4f");
287  item_put_list(block, ATOM_TYPE_SCAT_B5, (char *) md->atom,
288  (char *)&md->atom->sfb[4] - (char *)md->atom, "%7.4f");
289  item_put_list(block, ATOM_TYPE_SCAT_C, (char *) md->atom,
290  (char *)&md->atom->sfc - (char *)md->atom, "%7.4f");
291  loop = item_index(block, ATOM_TYPE_SYMBOL);
292  loop_set_identifier(block, loop, 1, "atom_type");
293  }
294 
295  if ( nbond ) {
296  block = (Bstar_block *) add_item((char **)&star->block, sizeof(Bstar_block));
297  block->tag = "bond_types";
298  item_put_list(block, BOND_TYPE_SYMBOL1, (char *) md->bond,
299  (char *)&md->bond->type1 - (char *)md->bond, "%s");
300  item_put_list(block, BOND_TYPE_SYMBOL2, (char *) md->bond,
301  (char *)&md->bond->type2 - (char *)md->bond, "%s");
302  item_put_list(block, BOND_TYPE_LENGTH, (char *) md->bond,
303  (char *)&md->bond->covlength - (char *)md->bond, "%7.3f");
304  item_put_list(block, BOND_TYPE_VDWDIST, (char *) md->bond,
305  (char *)&md->bond->vdwdist - (char *)md->bond, "%7.3f");
306  loop = item_index(block, BOND_TYPE_SYMBOL1);
307  loop_set_identifier(block, loop, 1, "bond_type");
308  }
309 
310  if ( nangle ) {
311  block = (Bstar_block *) add_item((char **)&star->block, sizeof(Bstar_block));
312  block->tag = "angle_types";
313  item_put_list(block, ANGLE_TYPE_SYMBOL1, (char *) md->angle,
314  (char *)&md->angle->type1 - (char *)md->angle, "%s");
315  item_put_list(block, ANGLE_TYPE_SYMBOL2, (char *) md->angle,
316  (char *)&md->angle->type2 - (char *)md->angle, "%s");
317  item_put_list(block, ANGLE_TYPE_SYMBOL3, (char *) md->angle,
318  (char *)&md->angle->type3 - (char *)md->angle, "%s");
319  item_put_angle_list(block, ANGLE_TYPE_ANGLE, (char *) md->angle,
320  (char *)&md->angle->angle - (char *)md->angle, "%7.2f");
321  loop = item_index(block, ANGLE_TYPE_SYMBOL1);
322  loop_set_identifier(block, loop, 1, "angle_type");
323  }
324 
325  err = write_star(filename.c_str(), star);
326 
327  kill_star(star);
328 
329  return err;
330 }
331 
332 /*
333 @brief Adds a bond type to a linked list.
334 @param **bond pointer to any bond type in the list.
335 @param *symbol1 atom1 of bond.
336 @param *symbol2 atom2 of bond.
337 @param covlength reference covalent bond length.
338 @param vdwdist reference Van der Waals distance.
339 @return Bbondtype* new bond type.
340 
341  The function allocates memory for a new bond type structure.
342  If the content of the pointer is null, the new structure is
343  the first in the list. Otherwise, the end of the list is found
344  and the new structure added to it.
345 
346 **/
347 Bbondtype* bond_type_add(Bbondtype** bond, char* symbol1, char* symbol2, float covlength, float vdwdist)
348 {
349  Bbondtype* this_bond = *bond;
350  Bbondtype* new_bond = new Bbondtype;
351  memset(new_bond, 0, sizeof(Bbondtype));
352 
353  strncpy(new_bond->type1, symbol1, 8);
354  strncpy(new_bond->type2, symbol2, 8);
355  new_bond->covlength = covlength;
356  new_bond->vdwdist = vdwdist;
357 
358  if ( verbose & VERB_DEBUG )
359  cout << "DEBUG bond_type_add: covlength=" << covlength << " vdwdist=" << vdwdist << endl;
360 
361  if ( !this_bond )
362  *bond = new_bond;
363  else {
364  while ( this_bond->next ) this_bond = this_bond->next;
365  this_bond->next = new_bond;
366  }
367 
368  return new_bond;
369 }
370 
371 /*
372 @brief Adds an angle type to a linked list.
373 @param **angle pointer to any angle type in the list.
374 @param *symbol1 atom1 of angle.
375 @param *symbol2 atom2 of angle (central atom).
376 @param *symbol3 atom3 of angle.
377 @param float a reference angle.
378 @return Bangletype* new angle type.
379 
380  The function allocates memory for a new angle type structure.
381  If the content of the pointer is null, the new structure is
382  the first in the list. Otherwise, the end of the list is found
383  and the new structure added to it.
384 **/
385 Bangletype* angle_type_add(Bangletype** angle, char* symbol1, char* symbol2, char* symbol3, float a)
386 {
387  Bangletype* this_angle = *angle;
388  Bangletype* new_angle = new Bangletype;
389  memset(new_angle, 0, sizeof(Bangletype));
390 
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;
395 
396  if ( verbose & VERB_DEBUG )
397  cout << "DEBUG angle_type_add: angle = " << a << endl;
398 
399  if ( !this_angle )
400  *angle = new_angle;
401  else {
402  while ( this_angle->next ) this_angle = this_angle->next;
403  this_angle->next = new_angle;
404  }
405 
406  return new_angle;
407 }
408 
417 int md_kill(Bmd* md)
418 {
419  if ( !md ) return 0;
420 
421  kill_list((char *) md->bond, sizeof(Bbondtype));
422 
423  kill_list((char *) md->angle, sizeof(Bangletype));
424 
425  delete md;
426 
427  return 0;
428 }
Bstar_item::data
Bstring * data
Definition: rwstar.h:43
Bstar_item
Definition: rwstar.h:36
Batomtype::vdw
float vdw
Definition: rwatomprop.h:27
ATOM_TYPE_RADIUS_BOND
#define ATOM_TYPE_RADIUS_BOND
Definition: mol_tags.h:26
ANGLE_TYPE_ANGLE
#define ANGLE_TYPE_ANGLE
Definition: mol_tags.h:54
item_put_list
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 ...
Definition: rwstar.cpp:1436
verbose
int verbose
Batomtype::name
char name[8]
Definition: rwatomprop.h:23
Bbondtype::vdwdist
float vdwdist
Definition: rwmd.h:26
VERB_DEBUG
#define VERB_DEBUG
Definition: utilities.h:116
ATOM_TYPE_SCAT_A2
#define ATOM_TYPE_SCAT_A2
Definition: mol_tags.h:29
Batomtype::el
char el[4]
Definition: rwatomprop.h:22
item_index
int item_index(Bstar_block *block, const char *tag)
Gets the STAR item associated with a tag in a STAR data block.
Definition: rwstar.cpp:1029
Bangletype::next
Bangletype * next
Definition: rwmd.h:39
kill_list
long kill_list(char *list, unsigned long size)
Frees all the items in a linked list.
Definition: linked_list.cpp:214
Bstring
Definition: Bstring.h:29
add_item
char * add_item(char **list, unsigned long size)
Adds an item to a linked list.
Definition: linked_list.cpp:26
md_init_with_types
Bmd * md_init_with_types()
Initializes a molecular dynamics structure.
Definition: rwmd.cpp:51
md_kill
int md_kill(Bmd *md)
Deallocates a molecular dynamics structure.
Definition: rwmd.cpp:417
ATOM_TYPE_SCAT_B4
#define ATOM_TYPE_SCAT_B4
Definition: mol_tags.h:36
Bstring::integer
long integer()
Definition: Bstring.cpp:547
Batomtype::mass
float mass
Definition: rwatomprop.h:24
Bstar::comment
Bstring comment
Definition: rwstar.h:81
rwmd.h
Header to read and write molecular dynamics parameters in STAR format.
ATOM_TYPE_SCAT_B1
#define ATOM_TYPE_SCAT_B1
Definition: mol_tags.h:33
Batomtype
Definition: rwatomprop.h:19
loop_set_identifier
int loop_set_identifier(Bstar_block *block, int loop, int n,...)
Assigns a loop identification number to items.
Definition: rwstar.cpp:1803
Bstring::real
double real()
Definition: Bstring.cpp:553
Bmd
Definition: rwmd.h:56
Bangletype::type1
char type1[8]
Definition: rwmd.h:40
Bstring::c_str
const char * c_str()
Definition: Bstring.h:70
ANGLE_TYPE_SYMBOL2
#define ANGLE_TYPE_SYMBOL2
Definition: mol_tags.h:52
Bangletype::type2
char type2[8]
Definition: rwmd.h:41
Batomtype::sfa
float sfa[5]
Definition: rwatomprop.h:29
Bstar_block::tag
Bstring tag
Definition: rwstar.h:58
md_init
Bmd * md_init()
Initializes a molecular dynamics structure.
Definition: rwmd.cpp:28
Bbondtype::type1
char type1[8]
Definition: rwmd.h:23
Bbondtype::covlength
float covlength
Definition: rwmd.h:25
Bbondtype::type2
char type2[8]
Definition: rwmd.h:24
angle_type_add
Bangletype * angle_type_add(Bangletype **angle, char *symbol1, char *symbol2, char *symbol3, float a)
Definition: rwmd.cpp:385
write_star
int write_star(const char *filename, Bstar *star)
Writes a STAR data base to one or more STAR format files.
Definition: rwstar.cpp:666
mol_tags.h
All STAR file format tags for molecules and molecular parameters.
Bmd::angle
Bangletype * angle
Definition: rwmd.h:85
read_md_parameters
Bmd * read_md_parameters(Bstring &filename)
Reading molecular dynamics parameters from STAR files.
Definition: rwmd.cpp:80
ATOM_TYPE_RADIUS_VDW
#define ATOM_TYPE_RADIUS_VDW
Definition: mol_tags.h:27
ATOM_TYPE_SCAT_A3
#define ATOM_TYPE_SCAT_A3
Definition: mol_tags.h:30
Bangletype::angle
float angle
Definition: rwmd.h:43
Bbondtype::next
Bbondtype * next
Definition: rwmd.h:22
Batomtype::z
int z
Definition: rwatomprop.h:21
ATOM_TYPE_SCAT_B5
#define ATOM_TYPE_SCAT_B5
Definition: mol_tags.h:37
ANGLE_TYPE_SYMBOL3
#define ANGLE_TYPE_SYMBOL3
Definition: mol_tags.h:53
M_PI
#define M_PI
Definition: utilities.h:63
Bangletype::type3
char type3[8]
Definition: rwmd.h:42
utilities.h
Header file for general utilities.
Bmd::atom
Batomtype * atom
Definition: rwmd.h:83
Batomtype::next
Batomtype * next
Definition: rwatomprop.h:20
ATOM_TYPE_SCAT_C
#define ATOM_TYPE_SCAT_C
Definition: mol_tags.h:38
bond_type_add
Bbondtype * bond_type_add(Bbondtype **bond, char *symbol1, char *symbol2, float covlength, float vdwdist)
Definition: rwmd.cpp:347
Batomtype::sfb
float sfb[5]
Definition: rwatomprop.h:30
read_star
int read_star(const char *filename, Bstar *star)
Reads paramaters and data into a STAR data base from a list of files.
Definition: rwstar.cpp:224
ATOM_TYPE_SCAT_B3
#define ATOM_TYPE_SCAT_B3
Definition: mol_tags.h:35
ANGLE_TYPE_SYMBOL1
#define ANGLE_TYPE_SYMBOL1
Definition: mol_tags.h:51
kill_star
int kill_star(Bstar *star)
Destroys a STAR data base.
Definition: rwstar.cpp:132
Bstring::next
Bstring * next
Definition: Bstring.h:31
Batomtype::sfc
float sfc
Definition: rwatomprop.h:31
Bstar::line_length
int line_length
Definition: rwstar.h:80
Bmd::bond
Bbondtype * bond
Definition: rwmd.h:84
Batomtype::oxid
float oxid
Definition: rwatomprop.h:25
linked_list.h
Header file for generalized linked list functions.
BOND_TYPE_SYMBOL2
#define BOND_TYPE_SYMBOL2
Definition: mol_tags.h:46
Bangletype
Definition: rwmd.h:38
VERB_FULL
#define VERB_FULL
Definition: utilities.h:113
item_get_number
long item_get_number(Bstar *star, const char *tag)
Gets the number of values associated with a tag in a STAR data base.
Definition: rwstar.cpp:1134
item_find
Bstar_item * item_find(Bstar_block *block, const char *tag)
Gets the STAR item associated with a tag in a STAR data block.
Definition: rwstar.cpp:1083
ATOM_TYPE_SYMBOL
#define ATOM_TYPE_SYMBOL
Definition: mol_tags.h:22
write_md_parameters
int write_md_parameters(Bstring &filename, Bmd *md)
Writing molecular dynamics parameters to a STAR file.
Definition: rwmd.cpp:237
item_put_angle_list
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...
Definition: rwstar.cpp:1528
Bmd::VdWcoeff1
double VdWcoeff1
Definition: rwmd.h:66
ATOM_TYPE_SCAT_A4
#define ATOM_TYPE_SCAT_A4
Definition: mol_tags.h:31
rwstar.h
A header file for STAR format files.
ATOM_TYPE_SCAT_A1
#define ATOM_TYPE_SCAT_A1
Definition: mol_tags.h:28
ATOM_TYPE_SCAT_B2
#define ATOM_TYPE_SCAT_B2
Definition: mol_tags.h:34
BOND_TYPE_LENGTH
#define BOND_TYPE_LENGTH
Definition: mol_tags.h:47
BOND_TYPE_SYMBOL1
#define BOND_TYPE_SYMBOL1
Definition: mol_tags.h:45
Bstar::block
Bstar_block * block
Definition: rwstar.h:82
ATOM_TYPE_SCAT_A5
#define ATOM_TYPE_SCAT_A5
Definition: mol_tags.h:32
atom_type_add
Batomtype * atom_type_add(Batomtype **atype, const char *aname)
Adds an atom type structure to a linked list.
Definition: rwatomprop.cpp:144
Bmd::sepdist
double sepdist
Definition: rwmd.h:68
ATOM_TYPE_OXIDATION
#define ATOM_TYPE_OXIDATION
Definition: mol_tags.h:24
Bbondtype
Definition: rwmd.h:21
Bstar_block
Definition: rwstar.h:55
Bmd::VdWcoeff2
double VdWcoeff2
Definition: rwmd.h:67
Bmd::cutoff
double cutoff
Definition: rwmd.h:69
ATOM_TYPE_MASS
#define ATOM_TYPE_MASS
Definition: mol_tags.h:25
init_star
Bstar * init_star()
Creates a STAR data base.
Definition: rwstar.cpp:111
Batomtype::bond
float bond
Definition: rwatomprop.h:26
ATOM_TYPE_NUMBER
#define ATOM_TYPE_NUMBER
Definition: mol_tags.h:23
Bstar
Definition: rwstar.h:78
BOND_TYPE_VDWDIST
#define BOND_TYPE_VDWDIST
Definition: mol_tags.h:48
block_find_with_tag
Bstar_block * block_find_with_tag(Bstar *star, const char *tag)
Gets the first block associated with a tag in a STAR data base.
Definition: rwstar.cpp:1050