From 261557e5963ac03c0fd22bc99fb93c720e54f127 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Apr 2021 07:37:00 -0500 Subject: [PATCH] Fix translational periodic BCs for general planes --- src/surface.cpp | 2 ++ tests/regression_tests/periodic_hex/results_true.dat | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 tests/regression_tests/periodic_hex/results_true.dat diff --git a/src/surface.cpp b/src/surface.cpp index 8b2bb12832..1f542e64e0 100644 --- a/src/surface.cpp +++ b/src/surface.cpp @@ -1168,6 +1168,8 @@ void read_surfaces(pugi::xml_node node) // Compute the dot product of the surface normals Direction norm1 = surf1.normal({0, 0, 0}); Direction norm2 = surf2.normal({0, 0, 0}); + norm1 /= norm1.norm(); + norm2 /= norm2.norm(); double dot_prod = norm1.dot(norm2); // If the dot product is 1 (to within floating point precision) then the diff --git a/tests/regression_tests/periodic_hex/results_true.dat b/tests/regression_tests/periodic_hex/results_true.dat new file mode 100644 index 0000000000..09c5a77f58 --- /dev/null +++ b/tests/regression_tests/periodic_hex/results_true.dat @@ -0,0 +1,2 @@ +k-combined: +2.276564E+00 7.905769E-04