2 |
|
#include <stdlib.h> |
3 |
|
#include <string.h> |
4 |
|
|
5 |
< |
#include <parse_interface.h> |
6 |
< |
#include <BASS_interface.h> |
7 |
< |
#include <simError.h> |
5 |
> |
#include "parse_interface.h" |
6 |
> |
#include "BASS_interface.h" |
7 |
> |
#include "simError.h" |
8 |
|
#ifdef IS_MPI |
9 |
< |
#include <mpiBASS.h> |
9 |
> |
#include "mpiBASS.h" |
10 |
|
#endif |
11 |
|
|
12 |
|
void interface_error( event* the_event ); |
45 |
|
free( the_event ); |
46 |
|
} |
47 |
|
|
48 |
+ |
void init_rigidbody( int rigidbody_index ){ |
49 |
+ |
event* the_event; |
50 |
+ |
|
51 |
+ |
the_event = (event* )malloc( sizeof( event ) ); |
52 |
+ |
|
53 |
+ |
the_event->event_type = RIGIDBODY; |
54 |
+ |
the_event->err_msg = NULL; |
55 |
+ |
the_event->evt.blk_index = rigidbody_index; |
56 |
+ |
|
57 |
+ |
if( !event_handler( the_event ) ) interface_error( the_event ); |
58 |
+ |
#ifdef IS_MPI |
59 |
+ |
throwMPIEvent(the_event); |
60 |
+ |
#endif |
61 |
+ |
|
62 |
+ |
free( the_event ); |
63 |
+ |
} |
64 |
+ |
|
65 |
|
void init_atom( int atom_index ){ |
66 |
|
event* the_event; |
67 |
|
|
155 |
|
void init_members( struct node_tag* the_node, |
156 |
|
struct namespc the_namespc ){ |
157 |
|
event* the_event; |
158 |
+ |
int i; |
159 |
|
|
160 |
|
the_event = (event* )malloc( sizeof( event ) ); |
161 |
|
|
162 |
< |
the_event->event_type = MEMBER; |
162 |
> |
the_event->event_type = MEMBERS; |
163 |
|
the_event->err_msg = NULL; |
146 |
– |
the_event->evt.mbr.a = the_node->the_data.mbr.a; |
147 |
– |
the_event->evt.mbr.b = the_node->the_data.mbr.b; |
148 |
– |
the_event->evt.mbr.c = the_node->the_data.mbr.c; |
149 |
– |
the_event->evt.mbr.d = the_node->the_data.mbr.d; |
164 |
|
|
165 |
+ |
the_event->evt.mbrs.nMembers = the_node->the_data.mbrs.nMembers; |
166 |
+ |
|
167 |
+ |
the_event->evt.mbrs.memberList = (int *) calloc(the_node->the_data.mbrs.nMembers, |
168 |
+ |
sizeof(int)); |
169 |
+ |
|
170 |
+ |
for (i = 0; i < the_node->the_data.mbrs.nMembers; i++) { |
171 |
+ |
the_event->evt.mbrs.memberList[i] = the_node->the_data.mbrs.memberList[i]; |
172 |
+ |
} |
173 |
+ |
|
174 |
|
if( !event_handler( the_event ) ) interface_error( the_event ); |
175 |
|
#ifdef IS_MPI |
176 |
|
throwMPIEvent(the_event); |
177 |
|
#endif |
178 |
|
|
179 |
+ |
free( the_event->evt.mbrs.memberList ); |
180 |
|
free( the_event ); |
181 |
|
} |
182 |
|
|
263 |
|
|
264 |
|
the_event->event_type = ORIENTATION; |
265 |
|
the_event->err_msg = NULL; |
266 |
< |
the_event->evt.ornt.x = the_node->the_data.ort.x; |
267 |
< |
the_event->evt.ornt.y = the_node->the_data.ort.y; |
268 |
< |
the_event->evt.ornt.z = the_node->the_data.ort.z; |
266 |
> |
the_event->evt.ornt.phi = the_node->the_data.ort.phi; |
267 |
> |
the_event->evt.ornt.theta = the_node->the_data.ort.theta; |
268 |
> |
the_event->evt.ornt.psi = the_node->the_data.ort.psi; |
269 |
|
|
270 |
|
if( !event_handler( the_event ) ) interface_error( the_event ); |
271 |
|
#ifdef IS_MPI |