#include <GlobalMasterTcl.h>
Public Member Functions | |
GlobalMasterTcl () | |
~GlobalMasterTcl () | |
Protected Member Functions | |
virtual void | calculate () |
Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.
Definition at line 18 of file GlobalMasterTcl.h.
GlobalMasterTcl::GlobalMasterTcl | ( | ) |
Definition at line 523 of file GlobalMasterTcl.C.
References DebugM, ReductionMgr::Object(), REDUCTIONS_BASIC, GlobalMaster::requestedGroups(), and ReductionMgr::willSubmit().
00523 { 00524 DebugM(3,"Constructing GlobalMasterTcl\n"); 00525 #ifdef NAMD_TCL 00526 interp = 0; 00527 #endif 00528 reduction = ReductionMgr::Object()->willSubmit(REDUCTIONS_BASIC); 00529 initialize(); 00530 DebugM(2,"Done constructing ("<<requestedGroups().size()<<" initial groups)\n"); 00531 }
GlobalMasterTcl::~GlobalMasterTcl | ( | ) |
Definition at line 533 of file GlobalMasterTcl.C.
References DebugM.
00533 { 00534 DebugM(3,"Destructing GlobalMasterTcl\n"); 00535 #ifdef NAMD_TCL 00536 /* 00537 if ( interp ) Tcl_DeleteInterp(interp); 00538 */ 00539 #endif 00540 delete reduction; 00541 }
void GlobalMasterTcl::calculate | ( | ) | [protected, virtual] |
Reimplemented from GlobalMaster.
Definition at line 620 of file GlobalMasterTcl.C.
References DebugM, GlobalMaster::getGroupMassBegin(), GlobalMaster::getGroupMassEnd(), GlobalMaster::modifyAppliedForces(), GlobalMaster::modifyForcedAtoms(), GlobalMaster::modifyGroupForces(), NAMD_die(), ResizeArray< Elem >::resize(), ResizeArray< Elem >::setall(), and SubmitReduction::submit().
00620 { 00621 DebugM(4,"Calculating forces on master\n"); 00622 00623 /* clear out the requested forces first! */ 00624 modifyAppliedForces().resize(0); 00625 modifyForcedAtoms().resize(0); 00626 modifyGroupForces().resize(getGroupMassEnd() - getGroupMassBegin()); 00627 modifyGroupForces().setall(Vector(0,0,0)); 00628 00629 #ifdef NAMD_TCL 00630 // Call interpreter to calculate forces 00631 00632 char cmd[129]; int code; 00633 strcpy(cmd,"calcforces"); code = Tcl_Eval(interp,cmd); 00634 const char *result = Tcl_GetStringResult(interp); 00635 if (*result != 0) CkPrintf("TCL: %s\n",result); 00636 if (code != TCL_OK) { 00637 const char *errorInfo = Tcl_GetVar(interp,"errorInfo",0); 00638 NAMD_die(errorInfo ? errorInfo : "Unknown Tcl error"); 00639 } 00640 #endif 00641 00642 reduction->submit(); 00643 00644 }