NAMD
ComputeStir.h
Go to the documentation of this file.
1 
7 /* Barry Isralewitz, July 2001 */
8 
9 #ifndef COMPUTESTIR_H
10 #define COMPUTESTIR_H
11 
12 #include "ComputeHomePatch.h"
13 #include "ReductionMgr.h"
14 #include "Vector.h"
15 #include "Tensor.h"
16 
17 
19 {
20 
21  public:
22  ComputeStir(ComputeID c, PatchID pid); // Constructor
23  virtual ~ComputeStir(); // Destructor
24 
25  virtual void doForce(FullAtom* p, Results* r);
26 
28  private:
29 
30  Bool stirOn;
31  BigReal omega; //rotation speed in radians/timestep
32  BigReal startingTheta; //rotation offset in radians, normally zero
33  // even for restarted runs
34  // since offset is automatically calculated
35  // as omega * firsttimestep
36  // useful to change speeds midrun
37  // or start torque mid-run, without losing
38  // track of timestep for handy bookeeping
39  Tensor matMult (Tensor , Tensor ); //multiplies two matrices
40  Tensor arbRotMat (BigReal theta); //make arbRotation matrix
41  // needs pre/post translation
42  Vector axisUnit; //rotation axis direction
43  Vector pivot; //rotation axis pivot
44  void printTensor (Tensor &); //for debug printing
45  void initVars (); //initialize the matrices needed
46  BigReal distanceToRay(Vector,Vector,Vector);// find dist. to Ray
47  BigReal findHeight(Vector); //find height along vector
48  Vector projectionOnRay (Vector,Vector,Vector); //find projection on ray
49  Vector placeThetaRadius (BigReal,BigReal,BigReal); //find point given theta
50  //and radius
51 
52  BigReal findTheta (Vector refPos);
53  Tensor leftMat, rightMat; // for arbitary rotations and related
54  // coordinate operations
55 
61 };
62 
63 #endif
64 
65 
66 
67 
68 
69 
70 
int ComputeID
Definition: NamdTypes.h:183
Definition: Vector.h:64
virtual void doForce(FullAtom *p, Results *r)
Definition: ComputeStir.C:288
SubmitReduction * reduction
Definition: ComputeStir.h:27
int Bool
Definition: common.h:133
ComputeStir(ComputeID c, PatchID pid)
Definition: ComputeStir.C:19
int PatchID
Definition: NamdTypes.h:182
virtual ~ComputeStir()
Definition: ComputeStir.C:39
Definition: Tensor.h:15
double BigReal
Definition: common.h:114