67 void setSelectedMolecule(
Molecule* selectedMolecule);
68 bool updateLambda(RealType& particleTarget, RealType& deltaLambda);
70 bool getHasSelectedMolecule()
const {
return hasSelectedMolecule_; }
72 void setHasSelectedMolecule(
bool hasSelectedMolecule) {
73 hasSelectedMolecule_ = hasSelectedMolecule;
76 RealType getScaledDeltaU(RealType d_lambda)
const {
77 RealType lambda = currentSnapshot_->getSPFData()->lambda;
79 return -(f_lambda(lambda + d_lambda) - f_lambda(lambda)) *
80 (potentialSink_ - potentialSource_);
83 Molecule* getSelectedMolecule() {
return selectedMolecule_; }
84 Snapshot getTemporarySourceSnapshot() {
return *temporarySourceSnapshot_; }
85 Snapshot getTemporarySinkSnapshot() {
return *temporarySinkSnapshot_; }
87 void combineForcesAndTorques();
88 void updatePotentials();
89 void updateVirialTensor();
91 RealType f_lambda(RealType lambda)
const {
return std::pow(lambda, k_); }
94 void calcForces()
override;
96 void updateLongRangePotentials();
97 void updateShortRangePotentials();
98 void updateSelfPotentials();
99 void updateExcludedPotentials();
100 void updateRestraintPotentials();
101 void updateSelectionPotentials();
104 T linearCombination(T quantityA, T quantityB) {
105 RealType result = f_lambda(currentSnapshot_->getSPFData()->lambda);
107 return T {(1.0 - result) * quantityA + result * quantityB};
110 std::unique_ptr<Thermo> thermo_ {
nullptr};
112 Snapshot* currentSnapshot_ {
nullptr};
113 Snapshot* temporarySourceSnapshot_ {
nullptr};
114 Snapshot* temporarySinkSnapshot_ {
nullptr};
117 std::vector<int> sourceNeighborList_;
118 std::vector<int> sourcePoint_;
119 std::vector<Vector3d> sourceSavedPositions_;
121 std::vector<int> sinkNeighborList_;
122 std::vector<int> sinkPoint_;
123 std::vector<Vector3d> sinkSavedPositions_;
125 bool hasSelectedMolecule_ {};
127 Molecule* selectedMolecule_ {
nullptr};
130 RealType potentialSource_ {};
131 RealType potentialSink_ {};