 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
53 for ( i=1, block = star->
block; block; block = block->
next, i++ ) {
71 for ( data=item->
data; data; data=data->
next, i++ ) {
73 if ( !mp->
type ) mp->
type = comptype;
77 for ( data=item->
data, comptype=mp->
type; data && comptype; data=data->
next, comptype=comptype->
next )
81 for ( data=item->
data, comptype=mp->
type; data && comptype; data=data->
next, comptype=comptype->
next )
85 for ( data=item->
data, comptype=mp->
type; data && comptype; data=data->
next, comptype=comptype->
next )
89 for ( data=item->
data, comptype=mp->
type; data && comptype; data=data->
next, comptype=comptype->
next )
93 for ( data=item->
data, comptype=mp->
type; data && comptype; data=data->
next, comptype=comptype->
next )
100 for ( data=item->
data; data; data=data->
next ) {
105 for ( j=0, data=item->
data; data; data=data->
next ) {
113 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
117 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
121 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
125 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
129 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
133 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
137 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
141 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
145 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
149 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
153 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
157 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
161 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
165 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
169 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
173 for ( data=item->
data, comp=mp->
comp; data && comp; data=data->
next, comp=comp->
next )
180 for ( data=item->
data; data; data=data->
next ) {
184 for ( comp=mp->
comp; comp && !link->
comp[0]; comp=comp->
next )
185 if ( comp->
id == *data ) link->
comp[0] = comp;
186 if ( !link->
comp[0] ) cerr <<
"Error: Component " << *data <<
" not found! (1)" << endl;
190 for ( data=item->
data, link=mp->
link; data && link; data=data->
next, link=link->
next ) {
191 for ( comp=mp->
comp; comp && !link->
comp[1]; comp=comp->
next )
192 if ( comp->
id == *data ) link->
comp[1] = comp;
193 if ( !link->
comp[1] ) cerr <<
"Error: Component " << *data <<
" not found! (2)" << endl;
197 for ( data=item->
data, link=mp->
link; data && link; data=data->
next, link=link->
next )
201 for ( data=item->
data, link=mp->
link; data && link; data=data->
next, link=link->
next )
205 for ( data=item->
data, link=mp->
link; data && link; data=data->
next, link=link->
next )
209 for ( data=item->
data, link=mp->
link; data && link; data=data->
next, link=link->
next )
213 for ( data=item->
data, link=mp->
link; data && link; data=data->
next, link=link->
next )
217 for ( data=item->
data, link=mp->
link; data && link; data=data->
next, link=link->
next )
221 for ( data=item->
data, link=mp->
link; data && link; data=data->
next, link=link->
next )
225 for ( data=item->
data, link=mp->
link; data && link; data=data->
next, link=link->
next )
227 for ( link=mp->
link; link; link=link->
next )
268 int n, loop, err = 0;
269 for ( n=0, mp =
model; mp; mp = mp->
next, n++ ) {
284 for ( comptype = mp->
type; comptype; comptype = comptype->
next ) {
285 if ( comptype->
id.
length() < 1 ) comptype->
id =
"?";
287 if ( !item->
data ) item->
data = data;
293 for ( comptype = mp->
type; comptype; comptype = comptype->
next ) {
296 if ( !item->
data ) item->
data = data;
305 (
char *)&mp->
type->
fom - (
char *)mp->
type,
"%7.4f");
312 for ( comp = mp->
comp; comp; comp = comp->
next ) {
315 if ( !item->
data ) item->
data = data;
321 for ( comp = mp->
comp; comp; comp = comp->
next ) {
325 if ( !item->
data ) item->
data = data;
330 (
char *)&mp->
comp->
loc[0] - (
char *)mp->
comp,
"%8.3f");
332 (
char *)&mp->
comp->
loc[1] - (
char *)mp->
comp,
"%8.3f");
334 (
char *)&mp->
comp->
loc[2] - (
char *)mp->
comp,
"%8.3f");
336 (
char *)&mp->
comp->
view[0] - (
char *)mp->
comp,
"%7.4lf");
338 (
char *)&mp->
comp->
view[1] - (
char *)mp->
comp,
"%7.4lf");
340 (
char *)&mp->
comp->
view[2] - (
char *)mp->
comp,
"%7.4lf");
342 (
char *)&mp->
comp->
view[3] - (
char *)mp->
comp,
"%7.2lf");
356 (
char *)&mp->
comp->
fom - (
char *)mp->
comp,
"%8.5f");
363 for ( link = mp->
link; link; link = link->
next ) {
365 if ( !item->
data ) item->
data = data;
371 for ( link = mp->
link; link; link = link->
next ) {
373 if ( !item->
data ) item->
data = data;
390 (
char *)&mp->
link->
fom - (
char *)mp->
link,
"%8.5f");
403 cout <<
"DEBUG write_model_star: " << filename << endl;
409 if ( err < 0 )
return err;
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_change_tag(Bstar *star, const char *tag, const char *newtag)
Replaces one tag with another in the STAR data base.
int item_index(Bstar_block *block, const char *tag)
Gets the STAR item associated with a tag in a STAR data block.
int item_get_integer(Bstar_block *block, const char *tag)
Gets an integer value associated with a tag in a STAR data block.
Header file for reading and writing atomic model files.
Header file for file checking functions.
float item_get_float(Bstar_block *block, const char *tag)
Gets a floating point value associated with a tag in a STAR data block.
char * add_item(char **list, unsigned long size)
Adds an item to a linked list.
Bcomponent * component_add(Bcomponent **comp, Bstring &id)
Adds a component to a linked list.
int loop_set_identifier(Bstar_block *block, int loop, int n,...)
Assigns a loop identification number to items.
Bstar_item * item_find_or_make(Bstar_block *block, const char *tag)
Gets the STAR item associated with a tag in a STAR data block.
double length(vector< T > v)
Library routines used for model link processing.
long models_process(Bmodel *model, long(modfunc)(Bmodel *))
Process a list of models using the specified function.
double distance(const Vector3 &v)
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...
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.
int write_star(const char *filename, Bstar *star)
Writes a STAR data base to one or more STAR format files.
long item_get_number_for_block(Bstar_block *block, const char *tag)
Gets the number of values associated with a tag in a STAR data block.
Header file for general utilities.
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.
Bstring find_file(Bstring filename, Bstring path, int flag=0)
Searches for a file within or without the given path.
Bmodel * read_model_star(Bstring *file_list)
Reads STAR model parameters.
Header file for generalized linked list functions.
Bmodel * model_add(Bmodel **model, Bstring &id)
Adds a model to a linked list.
Bstar_item * item_find(Bstar_block *block, const char *tag)
Gets the STAR item associated with a tag in a STAR data block.
Library routines used for model processing.
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...
Bcomptype * model_add_type_by_id(Bmodel *model, Bstring &id)
Add a type to a model if the identifier does not exist already.
A header file for STAR format files.
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.
int write_model_star(Bstring &filename, Bmodel *model)
Writes STAR model parameters.
long model_setup_links(Bmodel *model)
Set up the link list for each component.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
Bstar * init_star()
Creates a STAR data base.