Skip to content

Commit 655f492

Browse files
committed
Expand angular analysis for roto-translate move
1 parent 231c19c commit 655f492

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/move.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,14 +961,21 @@ AtomicSwapCharge::AtomicSwapCharge(Space& spc, std::string name, std::string cit
961961
AtomicSwapCharge::AtomicSwapCharge(Space& spc) : AtomicSwapCharge(spc, "swapcharge", "") {}
962962

963963
void TranslateRotate::_to_json(json& j) const {
964+
// For a spherical sphere of radius R, the ratio between mean squared translation (t)
965+
// and mean squared rotation (r) is approximately MSD_r * 4R^2 = MSD_t.
966+
const auto should_approach_radius =
967+
std::sqrt(mean_squared_displacement.avg() / mean_squared_rotation_angle.avg() / 4.0);
968+
964969
j = {{"dir", translational_direction},
965970
{"dp", translational_displacement / 1.0_angstrom},
966971
{"dprot", rotational_displacement / 1.0_rad},
967972
{"dirrot", fixed_rotation_axis},
968973
{"molid", molid},
969974
{unicode::rootof + unicode::bracket("r" + unicode::squared), std::sqrt(mean_squared_displacement.avg())},
970975
{"√⟨θ²⟩/°", std::sqrt(mean_squared_rotation_angle.avg()) / 1.0_deg},
971-
{"molecule", Faunus::molecules[molid].name}};
976+
{"√⟨θ²⟩", std::sqrt(mean_squared_rotation_angle.avg()) / 1.0_rad},
977+
{"molecule", Faunus::molecules.at(molid).name},
978+
{"R/Å ≈ √(⟨r²⟩/4⟨θ²⟩)", should_approach_radius}};
972979
roundJSON(j, 3);
973980
}
974981
void TranslateRotate::_from_json(const json& j) {

0 commit comments

Comments
 (0)