GlobalMasterMisc Class Reference

#include <GlobalMasterMisc.h>

Inheritance diagram for GlobalMasterMisc:

GlobalMasterEasy GlobalMaster List of all members.

Public Member Functions

 GlobalMasterMisc ()
virtual ~GlobalMasterMisc ()

Protected Member Functions

virtual void easy_init (const char *)
virtual void easy_calc (void)

Protected Attributes

Vector originalPosition
bool firstTime

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 19 of file GlobalMasterMisc.h.


Constructor & Destructor Documentation

GlobalMasterMisc::GlobalMasterMisc (  ) 

Definition at line 20 of file GlobalMasterMisc.C.

References GlobalMasterEasy::config, and easy_init().

00020                                    : GlobalMasterEasy("miscForcesScript") {
00021   // Initialize subclass
00022   easy_init(config);
00023   delete[] config;
00024 }

GlobalMasterMisc::~GlobalMasterMisc (  )  [virtual]

Definition at line 26 of file GlobalMasterMisc.C.

00026                                     {
00027   ;
00028 }


Member Function Documentation

void GlobalMasterMisc::easy_calc ( void   )  [protected, virtual]

Reimplemented from GlobalMasterEasy.

Definition at line 60 of file GlobalMasterMisc.C.

References GlobalMasterEasy::addEnergy(), GlobalMasterEasy::addForce(), endi(), firstTime, GlobalMasterEasy::getPosition(), iINFO(), iout, NAMD_die(), and originalPosition.

00060                                  {
00061   if(firstTime) {
00062     if(getPosition(0,originalPosition)) {
00063       NAMD_die("Couldn't get initial position.");
00064     }
00065     iout << iINFO << "Initial pos: " << originalPosition << "\n" << endi;
00066     firstTime = false;
00067   }
00068 
00069   Vector myp;
00070   BigReal k = 100.0;
00071   if(getPosition(0,myp)) {
00072     NAMD_die("Couldn't get position.");
00073   }
00074   iout << iINFO << "Atom 0 is at " << myp << "\n" << endi;
00075   addForce(0,-k * (myp-originalPosition));
00076   iout<<iINFO << "Adding force " << -k*(myp-originalPosition) << "\n" << endi;
00077   addEnergy(0.5 * k * (myp-originalPosition).length2());
00078 }

void GlobalMasterMisc::easy_init ( const char *   )  [protected, virtual]

Reimplemented from GlobalMasterEasy.

Definition at line 41 of file GlobalMasterMisc.C.

References endi(), firstTime, iINFO(), iout, and GlobalMasterEasy::requestAtom().

Referenced by GlobalMasterMisc().

00041                                                    {
00042   iout << iINFO << "  MISC FORCES CONFIG\n";
00043   iout << iINFO << "**********************\n";
00044   iout << config;
00045   iout << iINFO << "**********************\n" << endi;
00046 
00047   requestAtom(0);
00048 
00049   firstTime = true;
00050 }


Member Data Documentation

bool GlobalMasterMisc::firstTime [protected]

Definition at line 29 of file GlobalMasterMisc.h.

Referenced by easy_calc(), and easy_init().

Vector GlobalMasterMisc::originalPosition [protected]

Definition at line 28 of file GlobalMasterMisc.h.

Referenced by easy_calc().


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