From 66e7e998af4f37b70b48f6dbf6526724adfbd76e Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 31 Mar 2021 23:31:12 -0500 Subject: [PATCH] Always call LocalCoord::rotate and set LocalCoord::rotated. --- src/geometry.cpp | 4 +--- src/particle.cpp | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/geometry.cpp b/src/geometry.cpp index 8e6519fa86..9d612412b5 100644 --- a/src/geometry.cpp +++ b/src/geometry.cpp @@ -188,9 +188,7 @@ find_cell_inner(Particle& p, const NeighborList* neighbor_list) coord.r -= c.translation_; // Apply rotation. - if (!c.rotation_.empty()) { - coord.rotate(c.rotation_); - } + coord.rotate(c.rotation_); } else if (c.type_ == Fill::LATTICE) { //======================================================================== diff --git a/src/particle.cpp b/src/particle.cpp index 2e24131742..d05b81d848 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -38,6 +38,10 @@ namespace openmc { void LocalCoord::rotate(const std::vector& rotation) { + if (rotation.empty()) { + this->rotated = false; + return; + } this->r = this->r.rotate(rotation); this->u = this->u.rotate(rotation); this->rotated = true;