Bsoft  2.1.0
Bernard's software package
rwmodel_param.cpp
Go to the documentation of this file.
1 
9 #include "rwmodel_param.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 
24 {
25  unsigned long i, n2 = num*num, n3 = num*n2;
26  Bmodparam* mp = new Bmodparam;
27  memset(mp, 0, sizeof(Bmodparam));
28 
29  mp->ntype = num;
30 
31  mp->llen = new float[n2];
32  mp->dist = new float[n2];
33  mp->Kl = new float[n2];
34  mp->Kd = new float[n2];
35  mp->pot = new int[n2];
36  mp->angle = new float[n3];
37  mp->Ka = new float[n3];
38 
39  for ( i=0; i<n2; i++ ) mp->llen[i] = mp->dist[i] = mp->Kl[i] = mp->Kd[i] = mp->pot[i] = 0;
40  for ( i=0; i<n3; i++ ) mp->angle[i] = mp->Ka[i] = 0;
41 
42  return mp;
43 }
44 
51 {
52  mp->comment = 0;
53 
54  string_kill(mp->type);
55 
56  delete[] mp->llen;
57  delete[] mp->dist;
58  delete[] mp->Kl;
59  delete[] mp->Kd;
60  delete[] mp->pot;
61  delete[] mp->angle;
62  delete[] mp->Ka;
63 
64  model_kill(mp->guide);
65 
66  delete mp;
67 
68  return 0;
69 }
70 
80 {
81  int err(0), i, j, k, l, nd, na, num(0);
82  Bstar* star = init_star();
83  star->line_length = 200; // Set the output line length
84 
85  err = read_star(filename, star);
86 
87  if ( err != 0 ) {
88  kill_star(star);
89  return NULL;
90  }
91 
92  if ( verbose )
93  cout << "Reading model parameters from " << filename << endl << endl;
94 
95  Bstar_block* block = star->block;
96  Bstar_item* item = NULL;
97  Bstring* dct1 = NULL;
98  Bstring* dct2 = NULL;
99  Bstring* dct3 = NULL;
100  Bstring* dllen = NULL;
101  Bstring* ddist = NULL;
102  Bstring* dkl = NULL;
103  Bstring* dkd = NULL;
104  Bstring* dpot = NULL;
105  Bstring* dang = NULL;
106  Bstring* dka = NULL;
107  Bstring* type = NULL;
108  Bstring* typelist = NULL;
109 
110  // Types from distance matrix
111  if ( ( item = item_find(block, DISTMAT_COMPTYPE1) ) ) dct1 = item->data;
112  if ( ( item = item_find(block, DISTMAT_COMPTYPE2) ) ) dct2 = item->data;
113  for ( ; dct1 && dct2; dct1=dct1->next, dct2=dct2->next ) {
114  for ( i=0, type = typelist; type && *type != *dct1; type = type->next, i++ ) ;
115  if ( !type ) string_add(&typelist, *dct1);
116  for ( i=0, type = typelist; type && *type != *dct2; type = type->next, i++ ) ;
117  if ( !type ) string_add(&typelist, *dct2);
118  }
119 
120  if ( ( item = item_find(block, ANGLEMAT_COMPTYPE1) ) ) dct1 = item->data;
121  if ( ( item = item_find(block, ANGLEMAT_COMPTYPE2) ) ) dct2 = item->data;
122  if ( ( item = item_find(block, ANGLEMAT_COMPTYPE3) ) ) dct3 = item->data;
123 
124  // Types from angle matrix
125  for ( ; dct1 && dct2 && dct3; dct1=dct1->next, dct2=dct2->next, dct3=dct3->next ) {
126  for ( i=0, type = typelist; i<num && type && *type != *dct1; type = type->next, i++ ) ;
127  if ( !type ) string_add(&typelist, *dct1);
128  for ( j=0, type = typelist; j<num && type && *type != *dct2; type = type->next, j++ ) ;
129  if ( !type ) string_add(&typelist, *dct2);
130  for ( k=0, type = typelist; k<num && type && *type != *dct3; type = type->next, k++ ) ;
131  if ( !type ) string_add(&typelist, *dct3);
132  }
133 
134  for ( num=0, type = typelist; type; type = type->next ) num++;
135 
136  Bmodparam* mp = model_param_init(num);
137  mp->comment = star->comment;
138  mp->type = typelist;
139 
140  if ( verbose & VERB_DEBUG )
141  cout << "DEBUG model_param_read: number of component types = " << num << endl;
142 
143  if ( ( item = item_find(block, DISTMAT_COMPTYPE1) ) ) dct1 = item->data;
144  if ( ( item = item_find(block, DISTMAT_COMPTYPE2) ) ) dct2 = item->data;
145  if ( ( item = item_find(block, DISTMAT_LLEN) ) ) dllen = item->data;
146  if ( ( item = item_find(block, DISTMAT_DIST) ) ) ddist = item->data;
147  if ( ( item = item_find(block, DISTMAT_KL) ) ) dkl = item->data;
148  if ( ( item = item_find(block, DISTMAT_KD) ) ) dkd = item->data;
149  if ( ( item = item_find(block, DISTMAT_POTTYPE) ) ) dpot = item->data;
150 
151  // Distance matrix
152  for ( nd=0; dct1 && dct2; dct1=dct1->next, dct2=dct2->next ) {
153  for ( i=0, type = mp->type; i<num && type && *type != *dct1; type = type->next, i++ ) ;
154  for ( j=0, type = mp->type; j<num && type && *type != *dct2; type = type->next, j++ ) ;
155  k = i*num + j;
156  l = j*num + i;
157  if ( dllen ) {
158  mp->llen[k] = mp->llen[l] = dllen->real();
159  dllen = dllen->next;
160  }
161  if ( ddist ) {
162  mp->dist[k] = mp->dist[l] = ddist->real();
163  ddist = ddist->next;
164  }
165  if ( dkl ) {
166  mp->Kl[k] = mp->Kl[l] = dkl->real();
167  dkl = dkl->next;
168  }
169  if ( dkd ) {
170  mp->Kd[k] = mp->Kd[l] = dkd->real();
171  dkd = dkd->next;
172  }
173  if ( dpot ) {
174  mp->pot[k] = mp->pot[l] = dpot->integer();
175  dpot = dpot->next;
176  }
177  if ( verbose & VERB_DEBUG )
178  cout << *dct1 << tab << *dct2 << tab << mp->llen[k] << tab
179  << mp->dist[k] << tab << mp->Kl[k] << tab << mp->Kd[k]
180  << tab << mp->pot[k] << endl;
181  nd++;
182  }
183 
184  dct1 = dct2 = dct3 = NULL;
185 
186  if ( ( item = item_find(block, ANGLEMAT_COMPTYPE1) ) ) dct1 = item->data;
187  if ( ( item = item_find(block, ANGLEMAT_COMPTYPE2) ) ) dct2 = item->data;
188  if ( ( item = item_find(block, ANGLEMAT_COMPTYPE3) ) ) dct3 = item->data;
189  if ( ( item = item_find(block, ANGLEMAT_ANGLE) ) ) dang = item->data;
190  if ( ( item = item_find(block, ANGLEMAT_KA) ) ) dka = item->data;
191 
192  // Angle matrix
193  for ( na=0; dct1 && dct2 && dct3; dct1=dct1->next, dct2=dct2->next, dct3=dct3->next ) {
194  for ( i=0, type = mp->type; i<num && type && *type != *dct1; type = type->next, i++ ) ;
195  for ( j=0, type = mp->type; j<num && type && *type != *dct2; type = type->next, j++ ) ;
196  for ( k=0, type = mp->type; k<num && type && *type != *dct3; type = type->next, k++ ) ;
197  l = (i*num+j)*num + k;
198  k = (i*num+k)*num + j;
199  if ( dang ) {
200  mp->angle[k] = mp->angle[l] = dang->real()*M_PI/180.0;
201  dang = dang->next;
202  }
203  if ( dka ) {
204  mp->Ka[k] = mp->Ka[l] = dka->real();
205  dka = dka->next;
206  }
207  if ( verbose & VERB_DEBUG )
208  cout << *dct1 << tab << *dct2 << tab << *dct3 << tab
209  << mp->angle[k] << tab << mp->Ka[k] << endl;
210  na++;
211  }
212 
213 
214  kill_star(star);
215 
216  if ( verbose ) {
217  cout << "Number of distance parameters read: " << nd << endl;
218  cout << "Number of angle parameters read: " << na << endl << endl;
219  }
220 
221  return mp;
222 }
223 
234 {
235  int i, j, k, l, nd, na, err(0);
236  Bstar* star = init_star();
237  Bstar_block* block = (Bstar_block *) add_item((char **)&star->block, sizeof(Bstar_block));
238  Bstring* type1;
239  Bstring* type2;
240  Bstring* type3;
241 
242  if ( verbose )
243  cout << "Writing model parameters to " << filename << endl << endl;
244 
245  mp->comment += command_line_time();
246  star->comment = mp->comment;
247 
248  // Distance matrix
249  for ( i=nd=0, type1 = mp->type; i<mp->ntype && type1; type1 = type1->next, i++ ) {
250  for ( j=i, k=i*mp->ntype+j, type2 = type1; j<mp->ntype && type2; type2 = type2->next, j++, k++ )
251  if ( mp->dist[k] > 0 ) {
252  item_put_string(block, DISTMAT_COMPTYPE1, *type1);
253  item_put_string(block, DISTMAT_COMPTYPE2, *type2);
254  item_put_float(block, DISTMAT_LLEN, mp->llen[k], "%7.3f");
255  item_put_float(block, DISTMAT_DIST, mp->dist[k], "%7.3f");
256  item_put_float(block, DISTMAT_KL, mp->Kl[k], "%7.3f");
257  item_put_float(block, DISTMAT_KD, mp->Kd[k], "%7.3f");
258  item_put_integer(block, DISTMAT_POTTYPE, mp->pot[k], "%d");
259  nd++;
260  }
261  }
262 
263  long loop = item_index(block, DISTMAT_COMPTYPE1);
266 
267  // Angle matrix
268  for ( i=na=0, type1 = mp->type; i<mp->ntype && type1; type1 = type1->next, i++ ) {
269  for ( j=i, type2 = type1; j<mp->ntype && type2; type2 = type2->next, j++ )
270  for ( k=j, l=(i*mp->ntype+j)*mp->ntype+k, type3 = type2; k<mp->ntype && type3; type3 = type3->next, k++, l++ )
271  if ( mp->angle[l] > 0 ) {
272  item_put_string(block, ANGLEMAT_COMPTYPE1, *type1);
273  item_put_string(block, ANGLEMAT_COMPTYPE2, *type2);
274  item_put_string(block, ANGLEMAT_COMPTYPE3, *type3);
275  item_put_float(block, ANGLEMAT_ANGLE, mp->angle[l]*180.0/M_PI, "%7.2f");
276  item_put_float(block, ANGLEMAT_KA, mp->Ka[l], "%7.3f");
277  na++;
278  }
279  }
280 
281  loop = item_index(block, ANGLEMAT_COMPTYPE1);
284 
285  err = write_star(filename.c_str(), star);
286 
287  kill_star(star);
288 
289  if ( err < 0 ) return err;
290 
291  if ( verbose ) {
292  cout << "Number of distance parameters written: " << nd << endl;
293  cout << "Number of angle parameters written: " << na << endl << endl;
294  }
295 
296  return nd+na;
297 }
298 
305 {
306  int i, j, k, l;
307  Bstring* type, *type1;
308 
309  cout << "Model parameters:" << endl << endl;
310 
311  cout << "Link parameter matrix:" << endl << endl;
312 
313  cout << "Type";
314  for ( type = mp->type; type; type = type->next )
315  cout << tab << *type;
316  cout << endl;
317  for ( i=k=0, type = mp->type; i<mp->ntype && type; type = type->next, i++ ) {
318  cout << *type;
319  for ( j=0; j<mp->ntype; j++, k++ ) {
320  cout << tab << mp->llen[k] << "," << mp->Kl[k];
321  }
322  cout << endl;
323  }
324  cout << endl;
325 
326  cout << "Distance parameter matrix:" << endl << endl;
327 
328  cout << "Type";
329  for ( type = mp->type; type; type = type->next )
330  cout << tab << *type;
331  cout << endl;
332  for ( i=k=0, type = mp->type; i<mp->ntype && type; type = type->next, i++ ) {
333  cout << *type;
334  for ( j=0; j<mp->ntype; j++, k++ ) {
335  cout << tab << mp->dist[k] << "," << mp->Kd[k] << "(" << mp->pot[k] << ")";
336  }
337  cout << endl;
338  }
339  cout << endl;
340 
341  cout << "Angle parameter matrix:" << endl << endl;
342 
343  for ( i=l=0, type1 = mp->type; i<mp->ntype && type1; type1 = type1->next, i++ ) {
344  cout << "Central component type: " << *type1 << endl << "Type";
345  for ( type = mp->type; type; type = type->next )
346  cout << tab << *type;
347  cout << endl;
348  for ( j=0, type = mp->type; j<mp->ntype && type; type = type->next, j++ ) {
349  cout << *type;
350  for ( k=0; k<mp->ntype; k++, l++ ) {
351  cout << tab << mp->angle[l]*180.0/M_PI << "," << mp->Ka[l];
352  }
353  cout << endl;
354  }
355  cout << endl;
356  }
357  cout << endl;
358 
359  return 0;
360 }
361 
376 {
377  int i, j, k, num;
378  double d, a;
379  Bmodel* m;
380  Bcomptype* ct;
381  Bcomponent* comp1;
382  Bcomponent* comp2;
383  Bcomponent* comp3;
384  Blink* link;
385  Bstring* type;
386  Bstring* list = NULL;
387  Vector3<float> v1, v2;
388 
389  if ( verbose )
390  cout << "Generating a distance parameter matrix from " << model->id << endl << endl;
391 
392  for ( num=0, m = model; m; m = m->next ) {
393  for ( ct = m->type; ct; ct = ct->next ) {
394  for ( type = list; type && *type != ct->id; type = type->next ) ;
395  if ( !type ) {
396  string_add(&list, ct->id);
397  ct->index = num;
398  num++;
399  }
400  }
401  }
402 
403  if ( verbose )
404  cout << "Number of component types found: " << num << endl << endl;
405 
406  Bmodparam* mp = model_param_init(num);
407 
408  mp->type = list;
409 
410  // Set up link lengths to the shortest for each link
411  if ( verbose & VERB_DEBUG )
412  cout << "DEBUG model_param_generate: Setting up link parameters" << endl;
413  for ( m = model; m; m = m->next ) {
414  for ( link = m->link; link; link = link->next ) {
415  comp1 = link->comp[0];
416  comp2 = link->comp[1];
417  i = comp1->type->index*num + comp2->type->index;
418  d = comp1->loc.distance(comp2->loc);
419  if ( mp->llen[i] < 0.1 || mp->llen[i] > d ) {
420  mp->llen[i] = d;
421  mp->Kl[i] = 1;
422  i = comp2->type->index*num + comp1->type->index;
423  mp->llen[i] = d;
424  mp->Kl[i] = 1;
425  }
426  }
427  }
428 
429  // Set up distances to the shortest for each pair of component types
430  if ( verbose & VERB_DEBUG )
431  cout << "DEBUG model_param_generate: Setting up distance parameters" << endl;
432  for ( m = model; m; m = m->next ) {
433  for ( comp1 = m->comp; comp1->next; comp1 = comp1->next ) {
434  for ( comp2 = comp1->next; comp2; comp2 = comp2->next ) {
435  i = comp1->type->index*num + comp2->type->index;
436  d = comp1->loc.distance(comp2->loc);
437  if ( mp->dist[i] < 0.1 || mp->dist[i] > d ) {
438  mp->dist[i] = d;
439  mp->Kd[i] = 1;
440  mp->pot[i] = 2;
441  i = comp2->type->index*num + comp1->type->index;
442  mp->dist[i] = d;
443  mp->Kd[i] = 1;
444  mp->pot[i] = 2;
445  }
446  }
447  }
448  }
449 
450  // Set up angles to the smallest for each triplet of component types
451  if ( verbose & VERB_DEBUG )
452  cout << "DEBUG model_param_generate: Setting up angle parameters" << endl;
453  for ( m = model; m; m = m->next ) {
454  for ( comp1 = m->comp; comp1->next; comp1 = comp1->next ) {
455  for ( j=1; j<MAXLINK && comp1->link[j]; j++ ) {
456  comp2 = comp1->link[j];
457  v1 = comp2->loc - comp1->loc;
458  for ( k=0; k<j && comp1->link[k]; k++ ) {
459  comp3 = comp1->link[k];
460  v2 = comp3->loc - comp1->loc;
461  i = (comp1->type->index*num + comp2->type->index)*num + comp3->type->index;
462  a = v1.angle(v2);
463  if ( mp->angle[i] < 0.001 || mp->angle[i] > a ) {
464  mp->angle[i] = a;
465  mp->Ka[i] = 1;
466  i = (comp1->type->index*num + comp3->type->index)*num + comp2->type->index;
467  mp->angle[i] = a;
468  mp->Ka[i] = 1;
469  }
470  }
471  }
472  }
473  }
474 
475  return mp;
476 }
477 
493 {
494  int i;
495  Bcomptype* ct;
496  Bstring* cts;
497 
498  if ( verbose )
499  cout << "Setting type indices for a distance parameter matrix" << endl << endl;
500 
501  for ( ; model; model = model->next ) {
502  for ( ct = model->type; ct; ct = ct->next ) {
503  for ( i=0, cts = mp->type; cts && *cts != ct->id; cts = cts->next, i++ ) ;
504  if ( cts ) ct->index = i;
505  else ct->index = -1;
506  if ( verbose & VERB_DEBUG )
507  cout << "DEBUG model_param_set_type_indices: " << *cts << " " << ct->id << " " << ct->index << endl;
508  }
509  }
510 
511  return 0;
512 }
513 
Bmodparam::type
Bstring * type
Definition: rwmodel_param.h:73
Bstar_item::data
Bstring * data
Definition: rwstar.h:43
Bstar_item
Definition: rwstar.h:36
Bcomponent::next
Bcomponent * next
Definition: rwmodel.h:52
model_param_kill
int model_param_kill(Bmodparam *mp)
Deallocates memory for a model parameter structure.
Definition: rwmodel_param.cpp:50
Bcomponent
Definition: rwmodel.h:51
ANGLEMAT_ANGLE
#define ANGLEMAT_ANGLE
Definition: rwmodel_param.h:24
VERB_DEBUG
#define VERB_DEBUG
Definition: utilities.h:116
string_kill
int string_kill(Bstring *list)
Kills a string linked list.
Definition: Bstring.cpp:768
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
Bcomponent::loc
Vector3< float > loc
Definition: rwmodel.h:58
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
model_param_read
Bmodparam * model_param_read(Bstring &filename)
Reads a model parameter file.
Definition: rwmodel_param.cpp:79
DISTMAT_KL
#define DISTMAT_KL
Definition: rwmodel_param.h:17
Bstring::integer
long integer()
Definition: Bstring.cpp:547
Bcomptype
Definition: rwmodel.h:25
Bmodparam::pot
int * pot
Definition: rwmodel_param.h:78
Vector3< float >
Bstar::comment
Bstring comment
Definition: rwstar.h:81
Bmodel::next
Bmodel * next
Definition: rwmodel.h:120
Bcomptype::index
int index
Definition: rwmodel.h:28
ANGLEMAT_COMPTYPE2
#define ANGLEMAT_COMPTYPE2
Definition: rwmodel_param.h:22
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
Bmodparam::dist
float * dist
Definition: rwmodel_param.h:75
Bmodparam::Kl
float * Kl
Definition: rwmodel_param.h:76
ANGLEMAT_COMPTYPE1
#define ANGLEMAT_COMPTYPE1
Definition: rwmodel_param.h:21
Bmodel::link
Blink * link
Definition: rwmodel.h:133
Bmodparam
Definition: rwmodel_param.h:35
Bstring::c_str
const char * c_str()
Definition: Bstring.h:70
verbose
int verbose
Vector3::distance
double distance(const Vector3 &v)
Definition: Vector3.h:227
item_put_float
int item_put_float(Bstar_block *block, const char *tag, float value, const char *format)
Writes a floating point value into a data item associated with a specific data block and tag in a STA...
Definition: rwstar.cpp:1401
DISTMAT_POTTYPE
#define DISTMAT_POTTYPE
Definition: rwmodel_param.h:19
Bmodel::comp
Bcomponent * comp
Definition: rwmodel.h:132
model_param_display
int model_param_display(Bmodparam *mp)
Displays a model parameter in the shell.
Definition: rwmodel_param.cpp:304
model_param_write
int model_param_write(Bstring &filename, Bmodparam *mp)
Writes a model parameter file.
Definition: rwmodel_param.cpp:233
command_line_time
Bstring command_line_time()
Returns the command line and time in a string.
Definition: utilities.cpp:71
item_put_integer
int item_put_integer(Bstar_block *block, const char *tag, int value, const char *format)
Writes a integer into a data item associated with a specific data block and tag in a STAR data base.
Definition: rwstar.cpp:1368
Bmodel::id
Bstring id
Definition: rwmodel.h:121
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
DISTMAT_COMPTYPE2
#define DISTMAT_COMPTYPE2
Definition: rwmodel_param.h:14
model_param_generate
Bmodparam * model_param_generate(Bmodel *model)
Generates a model parameter file from a model.
Definition: rwmodel_param.cpp:375
model_kill
int model_kill(Bmodel *model)
Deallocates all memory in the list.
Definition: rwmodel.cpp:1127
Bmodparam::Ka
float * Ka
Definition: rwmodel_param.h:80
ANGLEMAT_COMPTYPE3
#define ANGLEMAT_COMPTYPE3
Definition: rwmodel_param.h:23
Bmodel
Definition: rwmodel.h:119
DISTMAT_KD
#define DISTMAT_KD
Definition: rwmodel_param.h:18
M_PI
#define M_PI
Definition: utilities.h:63
utilities.h
Header file for general utilities.
tab
ostream & tab(ostream &out)
Definition: utilities.cpp:22
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
Bcomponent::type
Bcomptype * type
Definition: rwmodel.h:54
Bcomptype::id
Bstring id
Definition: rwmodel.h:27
model
Bmodel * model
Definition: bshow.cpp:34
kill_star
int kill_star(Bstar *star)
Destroys a STAR data base.
Definition: rwstar.cpp:132
DISTMAT_LLEN
#define DISTMAT_LLEN
Definition: rwmodel_param.h:15
Bstring::next
Bstring * next
Definition: Bstring.h:31
DISTMAT_DIST
#define DISTMAT_DIST
Definition: rwmodel_param.h:16
Bstar::line_length
int line_length
Definition: rwstar.h:80
Vector3::angle
double angle(Vector3< T2 > &v)
Definition: Vector3.h:259
Bmodparam::comment
Bstring comment
Definition: rwmodel_param.h:36
Bmodparam::llen
float * llen
Definition: rwmodel_param.h:74
Bmodparam::Kd
float * Kd
Definition: rwmodel_param.h:77
linked_list.h
Header file for generalized linked list functions.
Bmodparam::guide
Bmodel * guide
Definition: rwmodel_param.h:55
Bmodparam::angle
float * angle
Definition: rwmodel_param.h:79
model_param_set_type_indices
int model_param_set_type_indices(Bmodel *model, Bmodparam *mp)
Sets the component type indices from the model parameters.
Definition: rwmodel_param.cpp:492
Bmodparam::ntype
int ntype
Definition: rwmodel_param.h:72
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
rwstar.h
A header file for STAR format files.
item_put_string
int item_put_string(Bstar_block *block, const char *tag, char *string)
Writes a string into a data item associated with a specific data block and tag in a STAR data base.
Definition: rwstar.cpp:1300
Bstar::block
Bstar_block * block
Definition: rwstar.h:82
Bmodel::type
Bcomptype * type
Definition: rwmodel.h:131
Bcomptype::next
Bcomptype * next
Definition: rwmodel.h:26
MAXLINK
#define MAXLINK
Definition: rwmodel.h:14
DISTMAT_COMPTYPE1
#define DISTMAT_COMPTYPE1
Definition: rwmodel_param.h:13
Bcomponent::link
Bcomponent * link[MAXLINK]
Definition: rwmodel.h:55
Bstar_block
Definition: rwstar.h:55
ANGLEMAT_KA
#define ANGLEMAT_KA
Definition: rwmodel_param.h:25
string_add
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
Definition: Bstring.cpp:713
init_star
Bstar * init_star()
Creates a STAR data base.
Definition: rwstar.cpp:111
rwmodel_param.h
Header to read and write model dynamics parameters in STAR format.
model_param_init
Bmodparam * model_param_init(int num)
Initializes a model parameter structure and allocates memory.
Definition: rwmodel_param.cpp:23
Bstar
Definition: rwstar.h:78