OpenAtom  Version1.5a
StructFactorCache.h
1 #include "debug_flags.h"
2 #include "structureFactorCache.decl.h"
3 #include "StructureFactorMessages.h"
4 
5 #ifndef _StructFactorCache_h_
6 #define _StructFactorCache_h_
7 
8 class PlaneAtom {
9  public:
10  int plane;
11  int atom;
12  CkVec <CkArrayIndex2D> particles;
13  PlaneAtom(){}
14  bool operator==(const PlaneAtom& obj) const {
15  return (obj.plane==plane && obj.atom ==atom);
16  }
17  PlaneAtom(int _plane, int _atom): plane(_plane), atom(_atom) {}
18  void pup(PUP::er &p) {
19  p|plane;
20  p|atom;
21  p|particles;
22  }
23 
24 };
25 
26 class PlaneCount {
27  public:
28  int plane;
29  int count;
30  int state;
31  int updated;
32  PlaneCount() {}
33  PlaneCount(int p, int c, int _state) : plane(p), count(c), state(_state) { updated = 0;}
34 };
35 PUPbytes(PlaneCount);
36 
38 
39 class StructFactCache : public Group {
40  public:
41  void printCountStructFact();
42  int numSfGrps,natm_nl,natm_nl_grp_max, totalsize;
43  const UberCollection thisInstance;
44  StructFactCache(int numSfGrps_in,int natm_nl_in,int natm_nl_grp_max_in,
45  UberCollection _thisInstance) :thisInstance(_thisInstance)
46  {
47  numSfGrps = numSfGrps_in;
48  natm_nl = natm_nl_in;
49  natm_nl_grp_max = natm_nl_grp_max_in;
50  }
51  int getStructFact(int planeIndex, int atmGrp, complex **sf, complex **sf_x, complex **sf_y, complex **sf_z);
52  void getStructFactIdx(int sfindex, int atmGrp, complex **sf, complex **sf_x, complex **sf_y, complex **sf_z);
53  void acceptStructFact(StructFactorMsg *msg);
54  void removeAll();
55  void setZero(int);
56  int existStructFactGrp(int planeIndex, int atmGrp);
57  int registerPP(int state, int plane, int atmGrp);
58  int existsPP(int plane, int atmGrp);
59 
60  void pup(PUP::er &p) {
61  p|numSfGrps; p|natm_nl; p|natm_nl_grp_max, p|totalsize;
62  }//routine
63 
64  CkVec<GSlabInfo> gSpaceSlabs;
65  CkVec<int*> structFactorAtmGrps;
66  CkVec<complex*> structFactorList;
67  CkVec<complex*> structFactorfxList;
68  CkVec<complex*> structFactorfyList;
69  CkVec<complex*> structFactorfzList;
70  CkVec<int> structFactorSize;
71  CkVec<PlaneCount> planeCountList;
72  CkVec <PlaneAtom> ppList;
73  private:
74  int existStructFact(int planeIndex);
75  int incCountStructFact(int planeIndex);
76  int decCountStructFact(int planeIndex);
77 
78 
79 };
80 
81 #endif //_StructFactorCache_h_
holds the UberIndex and the offset for proxies
Definition: Uber.h:68
Add type declarations for simulationConstants class (readonly vars) and once class for each type of o...
int registerPP(int state, int plane, int atmGrp)
local particle planes register themselves with the cache so they can be launched by the arrival of an...
Useful debugging flags.