NAMD
ComputeHomePatches.h
Go to the documentation of this file.
1 
7 #ifndef COMPUTEHOMEPATCHES_H
8 #define COMPUTEHOMEPATCHES_H
9 
10 #include "NamdTypes.h"
11 #include "common.h"
12 #include "Compute.h"
13 #include "HomePatch.h"
14 
15 #include "Box.h"
16 #include "OwnerBox.h"
17 
18 class PatchElem {
19  public:
27  Force *f;
28 
30  patchID = -1;
31  p = NULL;
32  positionBox = NULL;
33  avgPositionBox = NULL;
34  forceBox = NULL;
35  x = NULL;
36  r = NULL;
37  f = NULL;
38  }
39 
40  PatchElem(PatchID p_param) {
41  patchID = p_param;
42  }
43 
44  PatchElem(HomePatch *p_param, Compute *cid, int useAvgPos) {
45  patchID = p_param->getPatchID();
46  p = p_param;
47  positionBox = p_param->registerPositionPickup(cid);
48  if ( useAvgPos ) {
50  }
51  forceBox = p_param->registerForceDeposit(cid);
52  x = NULL;
53  r = NULL;
54  f = NULL;
55  }
56 
57  ~PatchElem() {};
58 
59  int operator==(const PatchElem &elem) const {
60  return (elem.patchID == patchID);
61  }
62 
63  int operator<(const PatchElem &elem) const {
64  return (patchID < elem.patchID);
65  }
66 };
67 
69 
70 class ReductionMgr;
71 
72 class ComputeHomePatches : public Compute {
73 protected:
75  int hasPatchZero; // used for calculations/data needed only once
76 
78 
80 
81 public:
83  virtual ~ComputeHomePatches();
84  virtual void initialize();
85  virtual void atomUpdate();
86  Flags *getFlags(void) { return &(patchList[0].p->flags); }
87 };
88 
89 #endif
90 
Box< Patch, CompAtom > * registerAvgPositionPickup(Compute *cid)
Definition: Patch.C:134
int ComputeID
Definition: NamdTypes.h:183
Definition: Vector.h:64
ComputeHomePatchList patchList
PatchElem(PatchID p_param)
HomePatch * p
UniqueSortedArray< PatchElem > ComputeHomePatchList
ComputeHomePatches(ComputeID c)
virtual void atomUpdate()
PatchElem(HomePatch *p_param, Compute *cid, int useAvgPos)
int PatchID
Definition: NamdTypes.h:182
int operator==(const PatchElem &elem) const
PatchID getPatchID()
Definition: Patch.h:114
Flags * getFlags(void)
virtual void initialize()
Box< Patch, CompAtom > * avgPositionBox
Box< Patch, Results > * forceBox
Box< Patch, CompAtom > * positionBox
int operator<(const PatchElem &elem) const
Box< Patch, CompAtom > * registerPositionPickup(Compute *cid)
Definition: Patch.C:107
CompAtom * x
Box< Patch, Results > * registerForceDeposit(Compute *cid)
Definition: Patch.C:228