#include <GlobalMasterTest.h>
Inheritance diagram for GlobalMasterTest:

Protected Member Functions | |
| virtual void | calculate () |
Definition at line 13 of file GlobalMasterTest.h.
|
|
Reimplemented from GlobalMaster. Definition at line 15 of file GlobalMasterTest.C. References ResizeArray< Elem >::add(), GlobalMaster::appliedForces(), AtomID, DebugM, GlobalMaster::getAtomIdBegin(), GlobalMaster::getAtomIdEnd(), GlobalMaster::getAtomPositionBegin(), ResizeArray< Elem >::item(), GlobalMaster::modifyAppliedForces(), GlobalMaster::modifyForcedAtoms(), GlobalMaster::modifyRequestedAtoms(), NAMD_die(), Position, 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 }
|
1.3.9.1