GlobalMasterEasy Class Reference

#include <GlobalMasterEasy.h>

Inheritance diagram for GlobalMasterEasy:

GlobalMaster GlobalMasterMisc List of all members.

Protected Member Functions

 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)
virtual void easy_init (const char *)
virtual void easy_calc (void)

Protected Attributes

char * config

Detailed Description

Definition at line 19 of file GlobalMasterEasy.h.


Constructor & Destructor Documentation

GlobalMasterEasy::GlobalMasterEasy ( const char *  the_config_name  )  [protected]

Definition at line 32 of file GlobalMasterEasy.C.

References DebugM, Node::molecule, ReductionMgr::Object(), Node::Object(), REDUCTIONS_BASIC, and ReductionMgr::willSubmit().

00032                                                               {
00033   DebugM(1,"Here\n");
00034 
00035   molecule = Node::Object()->molecule;
00036   int len = strlen(the_config_name);
00037   configName = new char[len+1];
00038   strcpy(configName,the_config_name);
00039 
00040   reduction = ReductionMgr::Object()->willSubmit(REDUCTIONS_BASIC);
00041 
00042   initialize();
00043 }

GlobalMasterEasy::~GlobalMasterEasy (  )  [protected, virtual]

Definition at line 45 of file GlobalMasterEasy.C.

00045                                     {
00046   delete [] configName;
00047   delete reduction;
00048 }


Member Function Documentation

void GlobalMasterEasy::addEnergy ( BigReal   )  [protected]

Definition at line 104 of file GlobalMasterEasy.C.

Referenced by GlobalMasterMisc::easy_calc().

00104                                           {
00105   energy += e;
00106 }

int GlobalMasterEasy::addForce ( int  atomid,
Force  force 
) [protected]

Definition at line 96 of file GlobalMasterEasy.C.

References ResizeArray< Elem >::add(), GlobalMaster::modifyAppliedForces(), GlobalMaster::modifyForcedAtoms(), and Molecule::numAtoms.

Referenced by GlobalMasterMisc::easy_calc().

00097 {
00098   if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1;  // failure
00099   modifyForcedAtoms().add(atomid);
00100   modifyAppliedForces().add(force);
00101   return 0;  // success
00102 }

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

Reimplemented in GlobalMasterMisc.

Definition at line 179 of file GlobalMasterEasy.C.

00179                                  {
00180   CkPrintf("Default GlobalMasterEasy::easy_calc() called.\n");
00181 }

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

Reimplemented in GlobalMasterMisc.

Definition at line 175 of file GlobalMasterEasy.C.

00175                                              {
00176   CkPrintf("Default GlobalMasterEasy::easy_init() called.\n");
00177 }

int GlobalMasterEasy::getAtomID ( const char *  segid,
int  resid,
int  index 
) [protected]

Definition at line 63 of file GlobalMasterEasy.C.

References Molecule::get_atom_from_index_in_residue().

00064 {
00065   return molecule->get_atom_from_index_in_residue(segid,resid,index);
00066 }

int GlobalMasterEasy::getAtomID ( const char *  segid,
int  resid,
const char *  aname 
) [protected]

Definition at line 51 of file GlobalMasterEasy.C.

References Molecule::get_atom_from_name().

00052 {
00053   return molecule->get_atom_from_name(segid,resid,aname);
00054 }

double GlobalMasterEasy::getMass ( int  atomid  )  [protected]

Definition at line 68 of file GlobalMasterEasy.C.

References Molecule::atommass(), and Molecule::numAtoms.

00069 {
00070   if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1.;  // failure
00071   return molecule->atommass(atomid);
00072 }

int GlobalMasterEasy::getNumAtoms ( const char *  segid,
int  resid 
) [protected]

Definition at line 57 of file GlobalMasterEasy.C.

References Molecule::get_residue_size().

00058 {
00059   return molecule->get_residue_size(segid,resid);
00060 }

int GlobalMasterEasy::getPosition ( int  atomid,
Position position 
) [protected]

Definition at line 82 of file GlobalMasterEasy.C.

References GlobalMaster::getAtomIdBegin(), GlobalMaster::getAtomIdEnd(), and GlobalMaster::getAtomPositionBegin().

Referenced by GlobalMasterMisc::easy_calc().

00083 {
00084   AtomIDList::const_iterator a_i = getAtomIdBegin();
00085   AtomIDList::const_iterator a_e = getAtomIdEnd();
00086   PositionList::const_iterator p_i = getAtomPositionBegin();
00087   for ( ; a_i != a_e; ++a_i, ++p_i ) {
00088     if ( *a_i == atomid ) {
00089       position = *p_i;
00090       return 0;  // success
00091     }
00092   }
00093   return -1;  // failure
00094 }

int GlobalMasterEasy::requestAtom ( int  atomid  )  [protected]

Definition at line 75 of file GlobalMasterEasy.C.

References ResizeArray< Elem >::add(), GlobalMaster::modifyRequestedAtoms(), and Molecule::numAtoms.

Referenced by GlobalMasterMisc::easy_init().

00076 {
00077   if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1;  // failure
00078   modifyRequestedAtoms().add(atomid);
00079   return 0;  // success
00080 }


Member Data Documentation

char* GlobalMasterEasy::config [protected]

Definition at line 36 of file GlobalMasterEasy.h.

Referenced by GlobalMasterMisc::GlobalMasterMisc().


The documentation for this class was generated from the following files:
Generated on Thu Nov 23 01:17:18 2017 for NAMD by  doxygen 1.4.7