NAMD
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GlobalMasterMisc Class Reference

#include <GlobalMasterMisc.h>

Inheritance diagram for GlobalMasterMisc:
GlobalMasterEasy GlobalMaster

Public Member Functions

 GlobalMasterMisc ()
 
virtual ~GlobalMasterMisc ()
 
- Public Member Functions inherited from GlobalMaster
void processData (AtomIDList::iterator a_i, AtomIDList::iterator a_e, PositionList::iterator p_i, PositionList::iterator g_i, PositionList::iterator g_e, BigRealList::iterator gm_i, BigRealList::iterator gm_e, ForceList::iterator gtf_i, ForceList::iterator gtf_e, IntList::iterator goi_i, IntList::iterator goi_e, BigRealList::iterator gov_i, BigRealList::iterator gov_e, AtomIDList::iterator last_atoms_forced_i, AtomIDList::iterator last_atoms_forced_e, ForceList::iterator last_forces_i, AtomIDList::iterator, AtomIDList::iterator, ForceList::iterator)
 
bool changedAtoms ()
 
const AtomIDListrequestedAtoms ()
 
bool changedForces ()
 
const AtomIDListforcedAtoms ()
 
const ForceListappliedForces ()
 
bool changedGroups ()
 
const ResizeArray< AtomIDList > & requestedGroups ()
 
const ForceListgroupForces ()
 
bool changedGridObjs ()
 
const IntListrequestedGridObjs ()
 
const BigRealListgridObjForces ()
 
bool requestedTotalForces ()
 
void clearChanged ()
 
virtual ~GlobalMaster ()
 
void check () const
 
void setLattice (const Lattice *lat)
 

Protected Member Functions

virtual void easy_init (const char *)
 
virtual void easy_calc (void)
 
- Protected Member Functions inherited from GlobalMasterEasy
 GlobalMasterEasy (const char *the_config_name)
 
virtual ~GlobalMasterEasy ()
 
int getAtomID (const char *segid, int resid, const char *aname)
 
int getNumAtoms (const char *segid, int resid)
 
int getAtomID (const char *segid, int resid, int index)
 
double getMass (int atomid)
 
int requestAtom (int atomid)
 
int getPosition (int atomid, Position &position)
 
int addForce (int atomid, Force force)
 
void addEnergy (BigReal)
 
- Protected Member Functions inherited from GlobalMaster
 GlobalMaster ()
 
AtomIDListmodifyRequestedAtoms ()
 
AtomIDListmodifyForcedAtoms ()
 
ForceListmodifyAppliedForces ()
 
ResizeArray< AtomIDList > & modifyRequestedGroups ()
 
ForceListmodifyGroupForces ()
 
IntListmodifyRequestedGridObjects ()
 
BigRealListmodifyGridObjForces ()
 
AtomIDList::const_iterator getAtomIdBegin ()
 
AtomIDList::const_iterator getAtomIdEnd ()
 
PositionList::const_iterator getAtomPositionBegin ()
 
PositionList::const_iterator getGroupPositionBegin ()
 
PositionList::const_iterator getGroupPositionEnd ()
 
ForceList::const_iterator getGroupTotalForceBegin ()
 
ForceList::const_iterator getGroupTotalForceEnd ()
 
IntList::const_iterator getGridObjIndexBegin ()
 
IntList::const_iterator getGridObjIndexEnd ()
 
BigRealList::const_iterator getGridObjValueBegin ()
 
BigRealList::const_iterator getGridObjValueEnd ()
 
AtomIDList::const_iterator getLastAtomsForcedBegin ()
 
AtomIDList::const_iterator getLastAtomsForcedEnd ()
 
ForceList::const_iterator getLastForcesBegin ()
 
AtomIDList::const_iterator getForceIdBegin ()
 
AtomIDList::const_iterator getForceIdEnd ()
 
ForceList::const_iterator getTotalForce ()
 
void requestTotalForce (bool yesno=true)
 
BigRealList::const_iterator getGroupMassBegin ()
 
BigRealList::const_iterator getGroupMassEnd ()
 

Protected Attributes

Vector originalPosition
 
bool firstTime
 
- Protected Attributes inherited from GlobalMasterEasy
char * config
 
- Protected Attributes inherited from GlobalMaster
bool totalForceRequested
 
const Latticelattice
 
AtomIDList::iterator atomIdBegin
 
AtomIDList::iterator atomIdEnd
 
PositionList::iterator atomPositionBegin
 
PositionList::iterator groupPositionBegin
 
PositionList::iterator groupPositionEnd
 
BigRealList::iterator groupMassBegin
 
BigRealList::iterator groupMassEnd
 
ForceList::iterator groupTotalForceBegin
 
ForceList::iterator groupTotalForceEnd
 
IntList::iterator gridObjIndexBegin
 
IntList::iterator gridObjIndexEnd
 
BigRealList::iterator gridObjValueBegin
 
BigRealList::iterator gridObjValueEnd
 
AtomIDList::iterator lastAtomsForcedBegin
 
ForceList::iterator lastForcesBegin
 
AtomIDList::iterator lastAtomsForcedEnd
 
AtomIDList::iterator forceIdBegin
 
AtomIDList::iterator forceIdEnd
 
ForceList::iterator totalForceBegin
 
bool reqAtomsChanged
 
AtomIDList reqAtoms
 
bool appForcesChanged
 
AtomIDList fAtoms
 
ForceList appForces
 
bool reqGroupsChanged
 
ResizeArray< AtomIDListreqGroups
 
ForceList grpForces
 
bool reqGridObjsChanged
 
IntList reqGridObjs
 
BigRealList gridobjForces
 

Additional Inherited Members

- Public Attributes inherited from GlobalMaster
int step
 
int old_num_groups_requested
 

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().

20  : GlobalMasterEasy("miscForcesScript") {
21  // Initialize subclass
23  delete[] config;
24 }
GlobalMasterEasy(const char *the_config_name)
virtual void easy_init(const char *)
GlobalMasterMisc::~GlobalMasterMisc ( )
virtual

Definition at line 26 of file GlobalMasterMisc.C.

26  {
27  ;
28 }

Member Function Documentation

void GlobalMasterMisc::easy_calc ( void  )
protectedvirtual

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.

60  {
61  if(firstTime) {
63  NAMD_die("Couldn't get initial position.");
64  }
65  iout << iINFO << "Initial pos: " << originalPosition << "\n" << endi;
66  firstTime = false;
67  }
68 
69  Vector myp;
70  BigReal k = 100.0;
71  if(getPosition(0,myp)) {
72  NAMD_die("Couldn't get position.");
73  }
74  iout << iINFO << "Atom 0 is at " << myp << "\n" << endi;
75  addForce(0,-k * (myp-originalPosition));
76  iout<<iINFO << "Adding force " << -k*(myp-originalPosition) << "\n" << endi;
77  addEnergy(0.5 * k * (myp-originalPosition).length2());
78 }
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:81
int getPosition(int atomid, Position &position)
Definition: Vector.h:64
int addForce(int atomid, Force force)
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
#define iout
Definition: InfoStream.h:51
void addEnergy(BigReal)
void NAMD_die(const char *err_msg)
Definition: common.C:85
double BigReal
Definition: common.h:114
void GlobalMasterMisc::easy_init ( const char *  config)
protectedvirtual

Reimplemented from GlobalMasterEasy.

Definition at line 41 of file GlobalMasterMisc.C.

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

Referenced by GlobalMasterMisc().

41  {
42  iout << iINFO << " MISC FORCES CONFIG\n";
43  iout << iINFO << "**********************\n";
44  iout << config;
45  iout << iINFO << "**********************\n" << endi;
46 
47  requestAtom(0);
48 
49  firstTime = true;
50 }
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:81
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
#define iout
Definition: InfoStream.h:51
int requestAtom(int atomid)

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: