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

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.


Constructor & Destructor Documentation

GlobalMasterTcl::GlobalMasterTcl (  ) 

Definition at line 521 of file GlobalMasterTcl.C.

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

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

GlobalMasterTcl::~GlobalMasterTcl (  ) 

Definition at line 531 of file GlobalMasterTcl.C.

References DebugM.

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


Member Function Documentation

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

Reimplemented from GlobalMaster.

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

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 19 01:17:19 2018 for NAMD by  doxygen 1.4.7