97 class ForceDecomposition {
100 virtual ~ForceDecomposition() {}
102 virtual void setSnapshot(
Snapshot* snap) { snap_ = snap; }
104 virtual void distributeInitialData() = 0;
105 virtual void distributeData() = 0;
106 virtual void zeroWorkArrays() = 0;
107 virtual void collectIntermediateData() = 0;
108 virtual void distributeIntermediateData() = 0;
109 virtual void collectData() = 0;
110 virtual void collectSelfData() = 0;
111 virtual potVec getSelfPotential() {
return selfPot; }
112 virtual potVec getPairwisePotential() {
return pairwisePot; }
113 virtual potVec getExcludedPotential() {
return excludedPot; }
114 virtual potVec getSelectedPotential() {
return selectedPot; }
115 virtual potVec getExcludedSelfPotential() {
return excludedSelfPot; }
116 virtual potVec getSelectedSelfPotential() {
return selectedSelfPot; }
119 virtual bool checkNeighborList(vector<Vector3d> savedPositions);
120 virtual void buildNeighborList(vector<int>& neighborList,
122 vector<Vector3d>& savedPositions) = 0;
124 void setCutoffRadius(RealType rCut);
127 virtual Vector3d& getGroupVelocityColumn(
int atom2) = 0;
130 virtual vector<int>& getAtomsInGroupRow(
int cg1) = 0;
131 virtual vector<int>& getAtomsInGroupColumn(
int cg2) = 0;
133 virtual Vector3d getAtomToGroupVectorRow(
int atom1,
int cg1) = 0;
134 virtual Vector3d getAtomToGroupVectorColumn(
int atom2,
int cg2) = 0;
135 virtual RealType& getMassFactorRow(
int atom1) = 0;
136 virtual RealType& getMassFactorColumn(
int atom2) = 0;
139 virtual Vector3d getIntergroupVector(
int cg1,
int cg2) = 0;
140 virtual Vector3d getInteratomicVector(
int atom1,
int atom2) = 0;
143 virtual int& getNAtomsInRow() = 0;
144 virtual vector<int>& getExcludesForAtom(
int atom1) = 0;
145 virtual bool skipAtomPair(
int atom1,
int atom2,
int cg1,
int cg2) = 0;
146 virtual bool excludeAtomPair(
int atom1,
int atom2) = 0;
147 virtual int getGlobalIDRow(
int atom1) = 0;
148 virtual int getGlobalIDCol(
int atom2) = 0;
149 virtual int getGlobalID(
int atom1) = 0;
151 virtual int getTopologicalDistance(
int atom1,
int atom2) = 0;
152 virtual void addForceToAtomRow(
int atom1, Vector3d fg) = 0;
153 virtual void addForceToAtomColumn(
int atom2, Vector3d fg) = 0;
154 virtual Vector3d& getAtomVelocityColumn(
int atom2) = 0;
158 int atom2,
bool newAtom1 =
true) = 0;
165 virtual void fillSelfData(
SelfData& sdat,
int atom);
166 virtual void unpackSelfData(
SelfData& sdat,
int atom);
168 virtual void fillPreForceData(
SelfData& sdat,
int atom);
169 virtual void unpackPreForceData(
SelfData& sdat,
int atom);
171 virtual void addToHeatFlux(Vector3d hf);
172 virtual void setHeatFlux(Vector3d hf);
181 int atomStorageLayout_;
182 int rigidBodyStorageLayout_;
183 int cutoffGroupStorageLayout_;
184 bool needVelocities_;
185 bool usePeriodicBoundaryConditions_;
196 potVec excludedSelfPot;
198 potVec selectedSelfPot;
209 vector<vector<int>> topoDist;
210 vector<vector<int>> excludesForAtom;
211 vector<vector<int>> groupList_;
212 vector<RealType> massFactors;
213 vector<AtomType*> atypesLocal;
215 vector<Vector3i> cellOffsets_;
217 vector<vector<int>> cellList_;