GlobalMasterTest Class Reference

#include <GlobalMasterTest.h>

Inheritance diagram for GlobalMasterTest:

GlobalMaster List of all members.

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 13 of file GlobalMasterTest.h.


Member Function Documentation

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

Reimplemented from GlobalMaster.

Definition at line 15 of file GlobalMasterTest.C.

References ResizeArray< Elem >::add(), GlobalMaster::appliedForces(), DebugM, GlobalMaster::getAtomIdBegin(), GlobalMaster::getAtomIdEnd(), GlobalMaster::getAtomPositionBegin(), ResizeArray< Elem >::item(), GlobalMaster::modifyAppliedForces(), GlobalMaster::modifyForcedAtoms(), GlobalMaster::modifyRequestedAtoms(), NAMD_die(), GlobalMaster::requestedAtoms(), ResizeArray< Elem >::resize(), ResizeArray< Elem >::size(), Vector::x, Vector::y, and Vector::z.

00015                                  {
00016   DebugM(3,"Test calculate called\n");
00017   if(requestedAtoms().size() != 2) {
00018     DebugM(3,"putting two atoms into request list");
00019     modifyRequestedAtoms().resize(0);
00020     modifyRequestedAtoms().add(0);
00021     modifyRequestedAtoms().add(1);
00022     modifyForcedAtoms().add(0);
00023     
00024     int s = appliedForces().size();
00025     modifyAppliedForces().resize(s+1);
00026     modifyAppliedForces().item(s).x = 2;
00027     modifyAppliedForces().item(s).y = 0;
00028     modifyAppliedForces().item(s).z = 0;
00029     return; // we can't expect to have the rights atoms yet, so go on
00030   }
00031 
00032   const AtomID *atomID_ptr = getAtomIdBegin();
00033   const AtomID *atomID_end = getAtomIdEnd();
00034   const Position *position_ptr = getAtomPositionBegin();
00035   
00036   if(atomID_end - atomID_ptr != 2) {
00037     DebugM(3,"found " << atomID_end - atomID_ptr << " atoms\n");
00038     NAMD_die("Wrong number of atoms.");
00039   }
00040 
00041   while(atomID_ptr != atomID_end) {
00042     DebugM(2,"Atom " << *atomID_ptr << " is at "
00043            << position_ptr->x << " " << position_ptr->y << " "
00044            << position_ptr->z << "\n");
00045     position_ptr ++;
00046     atomID_ptr ++;
00047   }
00048 }


The documentation for this class was generated from the following files:
Generated on Wed Nov 22 01:17:20 2017 for NAMD by  doxygen 1.4.7