5 |
|
#include "MakeStamps.hpp" |
6 |
|
#include "MoleculeStamp.hpp" |
7 |
|
#include "RigidBodyStamp.hpp" |
8 |
+ |
#include "CutoffGroupStamp.hpp" |
9 |
|
#include "simError.h" |
10 |
|
#ifdef IS_MPI |
11 |
|
#include "mpiBASS.h" |
217 |
|
int MakeStamps::newRigidBody( event* the_event ){ |
218 |
|
|
219 |
|
current_rigidbody = new RigidBodyStamp; |
220 |
+ |
|
221 |
+ |
printf("makeStamps rb index = %d\n", the_event->evt.blk_index); |
222 |
|
|
223 |
|
the_event->err_msg = current_mol->addRigidBody( current_rigidbody, |
224 |
|
the_event->evt.blk_index ); |
269 |
|
|
270 |
|
if( the_event->evt.mbrs.nMembers > 0 ){ |
271 |
|
|
272 |
< |
for (i = 0; i < the_event->evt.mbrs.nMembers; i++) { |
273 |
< |
current_rigidbody->addMember( the_event->evt.mbrs.memberList[i]); |
272 |
> |
for (i = 0; i < the_event->evt.mbrs.nMembers; i++) { |
273 |
> |
current_rigidbody->addMember(the_event->evt.mbrs.memberList[i]); |
274 |
|
} |
275 |
|
|
276 |
|
return 1; |
286 |
|
int MakeStamps::rigidBodyEnd( event* the_event ){ |
287 |
|
|
288 |
|
the_event->err_msg = current_rigidbody->checkMe(); |
289 |
+ |
if( the_event->err_msg != NULL ) return 0; |
290 |
+ |
|
291 |
+ |
return 1; |
292 |
+ |
} |
293 |
+ |
|
294 |
+ |
int MakeStamps::newCutoffGroup( event* the_event ){ |
295 |
+ |
|
296 |
+ |
current_cutoffgroup = new CutoffGroupStamp; |
297 |
+ |
|
298 |
+ |
the_event->err_msg = current_mol->addCutoffGroup( current_cutoffgroup, |
299 |
+ |
the_event->evt.blk_index ); |
300 |
+ |
if( the_event->err_msg != NULL ) return 0; |
301 |
+ |
return 1; |
302 |
+ |
} |
303 |
+ |
|
304 |
+ |
int MakeStamps::cutoffGroupAssign( event* the_event ){ |
305 |
+ |
|
306 |
+ |
switch( the_event->evt.asmt.asmt_type ){ |
307 |
+ |
|
308 |
+ |
case STRING: |
309 |
+ |
the_event->err_msg = |
310 |
+ |
current_cutoffgroup->assignString( the_event->evt.asmt.lhs, |
311 |
+ |
the_event->evt.asmt.rhs.sval ); |
312 |
+ |
if( the_event->err_msg != NULL ) return 0; |
313 |
+ |
return 1; |
314 |
+ |
break; |
315 |
+ |
|
316 |
+ |
case DOUBLE: |
317 |
+ |
the_event->err_msg = |
318 |
+ |
current_cutoffgroup->assignDouble( the_event->evt.asmt.lhs, |
319 |
+ |
the_event->evt.asmt.rhs.dval ); |
320 |
+ |
if( the_event->err_msg != NULL ) return 0; |
321 |
+ |
return 1; |
322 |
+ |
break; |
323 |
+ |
|
324 |
+ |
case INT: |
325 |
+ |
the_event->err_msg = |
326 |
+ |
current_cutoffgroup->assignInt( the_event->evt.asmt.lhs, |
327 |
+ |
the_event->evt.asmt.rhs.ival ); |
328 |
+ |
if( the_event->err_msg != NULL ) return 0; |
329 |
+ |
return 1; |
330 |
+ |
break; |
331 |
+ |
|
332 |
+ |
default: |
333 |
+ |
the_event->err_msg = strdup( "MakeStamp error. Invalid CutoffGroup" |
334 |
+ |
" assignment type" ); |
335 |
+ |
return 0; |
336 |
+ |
break; |
337 |
+ |
} |
338 |
+ |
return 0; |
339 |
+ |
} |
340 |
+ |
|
341 |
+ |
int MakeStamps::cutoffGroupMembers( event* the_event ){ |
342 |
+ |
|
343 |
+ |
int i; |
344 |
+ |
|
345 |
+ |
if( the_event->evt.mbrs.nMembers > 0 ){ |
346 |
+ |
|
347 |
+ |
for (i = 0; i < the_event->evt.mbrs.nMembers; i++) { |
348 |
+ |
current_cutoffgroup->addMember(the_event->evt.mbrs.memberList[i]); |
349 |
+ |
} |
350 |
+ |
|
351 |
+ |
return 1; |
352 |
+ |
|
353 |
+ |
} else { |
354 |
+ |
the_event->err_msg = strdup( "MakeStamp error. No members in memberList " |
355 |
+ |
" for this CutoffGroup."); |
356 |
+ |
return 0; |
357 |
+ |
|
358 |
+ |
} |
359 |
+ |
} |
360 |
+ |
|
361 |
+ |
int MakeStamps::cutoffGroupEnd( event* the_event ){ |
362 |
+ |
|
363 |
+ |
the_event->err_msg = current_cutoffgroup->checkMe(); |
364 |
|
if( the_event->err_msg != NULL ) return 0; |
365 |
|
|
366 |
|
return 1; |