GlobalMasterTcl Class Reference

#include <GlobalMasterTcl.h>

Inheritance diagram for GlobalMasterTcl:

GlobalMaster List of all members.

Public Member Functions

 GlobalMasterTcl ()
 ~GlobalMasterTcl ()

Protected Member Functions

virtual void calculate ()

Detailed Description

Definition at line 19 of file GlobalMasterTcl.h.


Constructor & Destructor Documentation

GlobalMasterTcl::GlobalMasterTcl (  ) 

Definition at line 522 of file GlobalMasterTcl.C.

References DebugM, ReductionMgr::Object(), REDUCTIONS_BASIC, GlobalMaster::requestedGroups(), and ReductionMgr::willSubmit().

00522                                  {
00523   DebugM(3,"Constructing GlobalMasterTcl\n");
00524 #ifdef NAMD_TCL
00525   interp = 0;
00526 #endif
00527   reduction = ReductionMgr::Object()->willSubmit(REDUCTIONS_BASIC);
00528   initialize();
00529   DebugM(2,"Done constructing ("<<requestedGroups().size()<<" initial groups)\n");
00530 }

GlobalMasterTcl::~GlobalMasterTcl (  ) 

Definition at line 532 of file GlobalMasterTcl.C.

References DebugM.

00532                                   {
00533   DebugM(3,"Destructing GlobalMasterTcl\n");
00534 #ifdef NAMD_TCL
00535 /*
00536   if ( interp ) Tcl_DeleteInterp(interp);
00537 */
00538 #endif
00539   delete reduction;
00540 }


Member Function Documentation

void GlobalMasterTcl::calculate (  )  [protected, virtual]

Reimplemented from GlobalMaster.

Definition at line 619 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().

00619                                 {
00620   DebugM(4,"Calculating forces on master\n");
00621 
00622   /* clear out the requested forces first! */
00623   modifyAppliedForces().resize(0);
00624   modifyForcedAtoms().resize(0);
00625   modifyGroupForces().resize(getGroupMassEnd() - getGroupMassBegin());
00626   modifyGroupForces().setall(Vector(0,0,0));
00627 
00628 #ifdef NAMD_TCL
00629   // Call interpreter to calculate forces
00630 
00631   char cmd[129];  int code;
00632   strcpy(cmd,"calcforces");  code = Tcl_Eval(interp,cmd);
00633   const char *result = Tcl_GetStringResult(interp);
00634   if (*result != 0) CkPrintf("TCL: %s\n",result);
00635   if (code != TCL_OK) {
00636     const char *errorInfo = Tcl_GetVar(interp,"errorInfo",0);
00637     NAMD_die(errorInfo ? errorInfo : "Unknown Tcl error");
00638   }
00639 #endif
00640 
00641   reduction->submit();
00642 
00643 }


The documentation for this class was generated from the following files:
Generated on Mon Sep 25 01:17:18 2017 for NAMD by  doxygen 1.4.7