| Bsoft 2.0.5 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
23 Bmodparam* model_param_init(int num)
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
50 int model_param_kill(Bmodparam* mp)
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
79 Bmodparam* model_param_read(Bstring& filename)
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
233 int model_param_write(Bstring& filename, Bmodparam* mp)
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 star->comment = mp->comment;
246
247 // Distance matrix
248 for ( i=nd=0, type1 = mp->type; i<mp->ntype && type1; type1 = type1->next, i++ ) {
249 for ( j=i, k=i*mp->ntype+j, type2 = type1; j<mp->ntype && type2; type2 = type2->next, j++, k++ )
250 if ( mp->dist[k] > 0 ) {
251 item_put_string(block, DISTMAT_COMPTYPE1, *type1);
252 item_put_string(block, DISTMAT_COMPTYPE2, *type2);
253 item_put_float(block, DISTMAT_LLEN, mp->llen[k], "%7.3f");
254 item_put_float(block, DISTMAT_DIST, mp->dist[k], "%7.3f");
255 item_put_float(block, DISTMAT_KL, mp->Kl[k], "%7.3f");
256 item_put_float(block, DISTMAT_KD, mp->Kd[k], "%7.3f");
257 item_put_integer(block, DISTMAT_POTTYPE, mp->pot[k], "%d");
258 nd++;
259 }
260 }
261
262 long loop = item_index(block, DISTMAT_COMPTYPE1);
263 loop_set_identifier(block, loop, 7, DISTMAT_COMPTYPE1, DISTMAT_COMPTYPE2,
264 DISTMAT_LLEN, DISTMAT_DIST, DISTMAT_KL, DISTMAT_KD, DISTMAT_POTTYPE);
265
266 // Angle matrix
267 for ( i=na=0, type1 = mp->type; i<mp->ntype && type1; type1 = type1->next, i++ ) {
268 for ( j=i, type2 = type1; j<mp->ntype && type2; type2 = type2->next, j++ )
269 for ( k=j, l=(i*mp->ntype+j)*mp->ntype+k, type3 = type2; k<mp->ntype && type3; type3 = type3->next, k++, l++ )
270 if ( mp->angle[l] > 0 ) {
271 item_put_string(block, ANGLEMAT_COMPTYPE1, *type1);
272 item_put_string(block, ANGLEMAT_COMPTYPE2, *type2);
273 item_put_string(block, ANGLEMAT_COMPTYPE3, *type3);
274 item_put_float(block, ANGLEMAT_ANGLE, mp->angle[l]*180.0/M_PI, "%7.2f");
275 item_put_float(block, ANGLEMAT_KA, mp->Ka[l], "%7.3f");
276 na++;
277 }
278 }
279
280 loop = item_index(block, ANGLEMAT_COMPTYPE1);
281 loop_set_identifier(block, loop, 5, ANGLEMAT_COMPTYPE1, ANGLEMAT_COMPTYPE2,
282 ANGLEMAT_COMPTYPE3, ANGLEMAT_ANGLE, ANGLEMAT_KA);
283
284 err = write_star(filename.c_str(), star);
285
286 kill_star(star);
287
288 if ( err < 0 ) return err;
289
290 if ( verbose ) {
291 cout << "Number of distance parameters written: " << nd << endl;
292 cout << "Number of angle parameters written: " << na << endl << endl;
293 }
294
295 return nd+na;
296 }
297
303 int model_param_display(Bmodparam* mp)
304 {
305 int i, j, k, l;
306 Bstring* type, *type1;
307
308 cout << "Model parameters:" << endl << endl;
309
310 cout << "Link parameter matrix:" << endl << endl;
311
312 cout << "Type";
313 for ( type = mp->type; type; type = type->next )
314 cout << tab << *type;
315 cout << endl;
316 for ( i=k=0, type = mp->type; i<mp->ntype && type; type = type->next, i++ ) {
317 cout << *type;
318 for ( j=0; j<mp->ntype; j++, k++ ) {
319 cout << tab << mp->llen[k] << "," << mp->Kl[k];
320 }
321 cout << endl;
322 }
323 cout << endl;
324
325 cout << "Distance parameter matrix:" << endl << endl;
326
327 cout << "Type";
328 for ( type = mp->type; type; type = type->next )
329 cout << tab << *type;
330 cout << endl;
331 for ( i=k=0, type = mp->type; i<mp->ntype && type; type = type->next, i++ ) {
332 cout << *type;
333 for ( j=0; j<mp->ntype; j++, k++ ) {
334 cout << tab << mp->dist[k] << "," << mp->Kd[k] << "(" << mp->pot[k] << ")";
335 }
336 cout << endl;
337 }
338 cout << endl;
339
340 cout << "Angle parameter matrix:" << endl << endl;
341
342 for ( i=l=0, type1 = mp->type; i<mp->ntype && type1; type1 = type1->next, i++ ) {
343 cout << "Central component type: " << *type1 << endl << "Type";
344 for ( type = mp->type; type; type = type->next )
345 cout << tab << *type;
346 cout << endl;
347 for ( j=0, type = mp->type; j<mp->ntype && type; type = type->next, j++ ) {
348 cout << *type;
349 for ( k=0; k<mp->ntype; k++, l++ ) {
350 cout << tab << mp->angle[l]*180.0/M_PI << "," << mp->Ka[l];
351 }
352 cout << endl;
353 }
354 cout << endl;
355 }
356 cout << endl;
357
358 return 0;
359 }
360
374 Bmodparam* model_param_generate(Bmodel* model)
375 {
376 int i, j, k, num;
377 double d, a;
378 Bmodel* m;
379 Bcomptype* ct;
380 Bcomponent* comp1;
381 Bcomponent* comp2;
382 Bcomponent* comp3;
383 Blink* link;
384 Bstring* type;
385 Bstring* list = NULL;
386 Vector3<float> v1, v2;
387
388 if ( verbose )
389 cout << "Generating a distance parameter matrix from " << model->id << endl << endl;
390
391 for ( num=0, m = model; m; m = m->next ) {
392 for ( ct = m->type; ct; ct = ct->next ) {
393 for ( type = list; type && *type != ct->id; type = type->next ) ;
394 if ( !type ) {
395 string_add(&list, ct->id);
396 ct->index = num;
397 num++;
398 }
399 }
400 }
401
402 if ( verbose )
403 cout << "Number of component types found: " << num << endl << endl;
404
405 Bmodparam* mp = model_param_init(num);
406
407 mp->type = list;
408
409 // Set up link lengths to the shortest for each link
410 if ( verbose & VERB_DEBUG )
411 cout << "DEBUG model_param_generate: Setting up link parameters" << endl;
412 for ( m = model; m; m = m->next ) {
413 for ( link = m->link; link; link = link->next ) {
414 comp1 = link->comp[0];
415 comp2 = link->comp[1];
416 i = comp1->type->index*num + comp2->type->index;
417 d = comp1->loc.distance(comp2->loc);
418 if ( mp->llen[i] < 0.1 || mp->llen[i] > d ) {
419 mp->llen[i] = d;
420 mp->Kl[i] = 1;
421 i = comp2->type->index*num + comp1->type->index;
422 mp->llen[i] = d;
423 mp->Kl[i] = 1;
424 }
425 }
426 }
427
428 // Set up distances to the shortest for each pair of component types
429 if ( verbose & VERB_DEBUG )
430 cout << "DEBUG model_param_generate: Setting up distance parameters" << endl;
431 for ( m = model; m; m = m->next ) {
432 for ( comp1 = m->comp; comp1->next; comp1 = comp1->next ) {
433 for ( comp2 = comp1->next; comp2; comp2 = comp2->next ) {
434 i = comp1->type->index*num + comp2->type->index;
435 d = comp1->loc.distance(comp2->loc);
436 if ( mp->dist[i] < 0.1 || mp->dist[i] > d ) {
437 mp->dist[i] = d;
438 mp->Kd[i] = 1;
439 mp->pot[i] = 2;
440 i = comp2->type->index*num + comp1->type->index;
441 mp->dist[i] = d;
442 mp->Kd[i] = 1;
443 mp->pot[i] = 2;
444 }
445 }
446 }
447 }
448
449 // Set up angles to the smallest for each triplet of component types
450 if ( verbose & VERB_DEBUG )
451 cout << "DEBUG model_param_generate: Setting up angle parameters" << endl;
452 for ( m = model; m; m = m->next ) {
453 for ( comp1 = m->comp; comp1->next; comp1 = comp1->next ) {
454 for ( j=1; j<MAXLINK && comp1->link[j]; j++ ) {
455 comp2 = comp1->link[j];
456 v1 = comp2->loc - comp1->loc;
457 for ( k=0; k<j && comp1->link[k]; k++ ) {
458 comp3 = comp1->link[k];
459 v2 = comp3->loc - comp1->loc;
460 i = (comp1->type->index*num + comp2->type->index)*num + comp3->type->index;
461 a = v1.angle(v2);
462 if ( mp->angle[i] < 0.001 || mp->angle[i] > a ) {
463 mp->angle[i] = a;
464 mp->Ka[i] = 1;
465 i = (comp1->type->index*num + comp3->type->index)*num + comp2->type->index;
466 mp->angle[i] = a;
467 mp->Ka[i] = 1;
468 }
469 }
470 }
471 }
472 }
473
474 return mp;
475 }
476
491 int model_param_set_type_indices(Bmodel* model, Bmodparam* mp)
492 {
493 int i;
494 Bcomptype* ct;
495 Bstring* cts;
496
497 if ( verbose )
498 cout << "Setting type indices for a distance parameter matrix" << endl << endl;
499
500 for ( ; model; model = model->next ) {
501 for ( ct = model->type; ct; ct = ct->next ) {
502 for ( i=0, cts = mp->type; cts && *cts != ct->id; cts = cts->next, i++ ) ;
503 if ( cts ) ct->index = i;
504 else ct->index = -1;
505 if ( verbose & VERB_DEBUG )
506 cout << "DEBUG model_param_set_type_indices: " << *cts << " " << ct->id << " " << ct->index << endl;
507 }
508 }
509
510 return 0;
511 }
512
ANGLEMAT_COMPTYPE1
#define ANGLEMAT_COMPTYPE1
Definition: rwmodel_param.h:21
Bstar_item::data
Bstring * data
Definition: rwstar.h:43
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
DISTMAT_DIST
#define DISTMAT_DIST
Definition: rwmodel_param.h:16
MAXLINK
#define MAXLINK
Definition: rwmodel.h:14
DISTMAT_LLEN
#define DISTMAT_LLEN
Definition: rwmodel_param.h:15
Bstring::real
double real()
Definition: Bstring.cpp:545
string_add
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
Definition: Bstring.cpp:705
Bcomponent::type
Bcomptype * type
Definition: rwmodel.h:54
Blink
Definition: rwmodel.h:82
Bmodel::id
Bstring id
Definition: rwmodel.h:121
DISTMAT_COMPTYPE2
#define DISTMAT_COMPTYPE2
Definition: rwmodel_param.h:14
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
utilities.h
Header file for general utilities.
VERB_DEBUG
#define VERB_DEBUG
Definition: utilities.h:112
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:491
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
init_star
Bstar * init_star()
Creates a STAR data base.
Definition: rwstar.cpp:111
add_item
char * add_item(char **list, unsigned long size)
Adds an item to a linked list.
Definition: linked_list.cpp:26
Bstar
Definition: rwstar.h:78
kill_star
int kill_star(Bstar *star)
Destroys a STAR data base.
Definition: rwstar.cpp:132
Bmodparam::pot
int * pot
Definition: rwmodel_param.h:78
Blink::comp
Bcomponent * comp[2]
Definition: rwmodel.h:84
Vector3::distance
double distance(const Vector3 &v)
Definition: Vector3.h:227
ANGLEMAT_KA
#define ANGLEMAT_KA
Definition: rwmodel_param.h:25
Bmodparam
Definition: rwmodel_param.h:35
Bmodparam::Kl
float * Kl
Definition: rwmodel_param.h:76
Bcomptype::index
int index
Definition: rwmodel.h:28
M_PI
#define M_PI
Definition: utilities.h:59
linked_list.h
Header file for generalized linked list functions.
Bmodparam::dist
float * dist
Definition: rwmodel_param.h:75
model_kill
int model_kill(Bmodel *model)
Deallocates all memory in the list.
Definition: rwmodel.cpp:1124
Bstar::line_length
int line_length
Definition: rwstar.h:80
Blink::next
Blink * next
Definition: rwmodel.h:83
model_param_init
Bmodparam * model_param_init(int num)
Initializes a model parameter structure and allocates memory.
Definition: rwmodel_param.cpp:23
Bstring::next
Bstring * next
Definition: Bstring.h:31
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
Definition: rwstar.h:55
Bmodel::type
Bcomptype * type
Definition: rwmodel.h:131
Vector3::angle
double angle(Vector3< T2 > &v)
Definition: Vector3.h:257
DISTMAT_KL
#define DISTMAT_KL
Definition: rwmodel_param.h:17
model_param_read
Bmodparam * model_param_read(Bstring &filename)
Reads a model parameter file.
Definition: rwmodel_param.cpp:79
model_param_kill
int model_param_kill(Bmodparam *mp)
Deallocates memory for a model parameter structure.
Definition: rwmodel_param.cpp:50
Bmodparam::llen
float * llen
Definition: rwmodel_param.h:74
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
Bstring::c_str
const char * c_str()
Definition: Bstring.h:70
Bmodparam::Ka
float * Ka
Definition: rwmodel_param.h:80
Bmodel::next
Bmodel * next
Definition: rwmodel.h:120
verbose
int verbose
Bmodparam::ntype
int ntype
Definition: rwmodel_param.h:72
model
Bmodel * model
Definition: bshow.cpp:32
Bmodparam::comment
Bstring comment
Definition: rwmodel_param.h:36
Bstring
Definition: Bstring.h:29
Bstar::comment
Bstring comment
Definition: rwstar.h:81
Bcomponent::link
Bcomponent * link[MAXLINK]
Definition: rwmodel.h:55
Bmodel::link
Blink * link
Definition: rwmodel.h:133
rwstar.h
A header file for STAR format files.
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
rwmodel_param.h
Header to read and write model dynamics parameters in STAR format.
Bcomponent::next
Bcomponent * next
Definition: rwmodel.h:52
ANGLEMAT_COMPTYPE3
#define ANGLEMAT_COMPTYPE3
Definition: rwmodel_param.h:23
Bmodparam::angle
float * angle
Definition: rwmodel_param.h:79
DISTMAT_COMPTYPE1
#define DISTMAT_COMPTYPE1
Definition: rwmodel_param.h:13
DISTMAT_KD
#define DISTMAT_KD
Definition: rwmodel_param.h:18
Bcomptype::id
Bstring id
Definition: rwmodel.h:27
Vector3< float >
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
ANGLEMAT_COMPTYPE2
#define ANGLEMAT_COMPTYPE2
Definition: rwmodel_param.h:22
Bstar::block
Bstar_block * block
Definition: rwstar.h:82
model_param_generate
Bmodparam * model_param_generate(Bmodel *model)
Generates a model parameter file from a model.
Definition: rwmodel_param.cpp:374
Bstring::integer
long integer()
Definition: Bstring.cpp:539
Bmodel
Definition: rwmodel.h:119
model_param_display
int model_param_display(Bmodparam *mp)
Displays a model parameter in the shell.
Definition: rwmodel_param.cpp:303
ANGLEMAT_ANGLE
#define ANGLEMAT_ANGLE
Definition: rwmodel_param.h:24
Bcomptype
Definition: rwmodel.h:25
Bmodel::comp
Bcomponent * comp
Definition: rwmodel.h:132
Bmodparam::Kd
float * Kd
Definition: rwmodel_param.h:77
Bmodparam::guide
Bmodel * guide
Definition: rwmodel_param.h:55
Bcomponent::loc
Vector3< float > loc
Definition: rwmodel.h:58
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
Bmodparam::type
Bstring * type
Definition: rwmodel_param.h:73
tab
ostream & tab(ostream &out)
Definition: utilities.cpp:21
Bstar_item
Definition: rwstar.h:36
DISTMAT_POTTYPE
#define DISTMAT_POTTYPE
Definition: rwmodel_param.h:19
string_kill
int string_kill(Bstring *list)
Kills a string linked list.
Definition: Bstring.cpp:760
Bcomptype::next
Bcomptype * next
Definition: rwmodel.h:26
model_param_write
int model_param_write(Bstring &filename, Bmodparam *mp)
Writes a model parameter file.
Definition: rwmodel_param.cpp:233
Bcomponent
Definition: rwmodel.h:51