Skip to content

Commit 7df971d

Browse files
committed
[#1392] Remove quaternion diffusion runtime size check
Drop the QuaternionStateData propagation-time diffusion shape guard so it matches the regular StateData convention of trusting configured diffusion storage. Remove the unit test that only covered that runtime resize check.
1 parent 7b118a0 commit 7df971d

2 files changed

Lines changed: 0 additions & 16 deletions

File tree

src/simulation/dynamics/_GeneralModuleFiles/quaternionStateData.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,6 @@ QuaternionStateData::propagateState(double dt, std::vector<double> pseudoStep)
141141

142142
for (size_t i = 0; i < getNumNoiseSources(); i++) {
143143
const auto& diffusion = this->stateDiffusion.at(i);
144-
if (diffusion.rows() != 3 || diffusion.cols() != 1) {
145-
auto errorMsg = "State " + this->getName() + " has a quaternion diffusion with size " +
146-
std::to_string(diffusion.rows()) + "x" +
147-
std::to_string(diffusion.cols()) + ". QuaternionStateData expects " +
148-
"each diffusion source to be a 3x1 rotational increment vector.";
149-
logAndThrow(this->bskLogger, errorMsg);
150-
}
151-
152144
Eigen::Vector3d stochasticRotVec(diffusion(0), diffusion(1), diffusion(2));
153145
q = applyRotationVector(q, stochasticRotVec * pseudoStep.at(i));
154146
}

src/simulation/dynamics/tests/test_quaternionStateData.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,6 @@ TEST(QuaternionStateDataTest, RejectsMismatchedPseudoStepCount)
198198
EXPECT_THROW(q.propagateState(0.0, {1.0, 2.0}), BasiliskError);
199199
}
200200

201-
TEST(QuaternionStateDataTest, RejectsNonRotationalDiffusionSize)
202-
{
203-
auto q = makeQ(1.0, 0.0, 0.0, 0.0);
204-
q.setNumNoiseSources(1);
205-
206-
EXPECT_THROW(q.propagateState(0.0, {1.0}), BasiliskError);
207-
}
208-
209201
TEST(QuaternionStateDataTest, CloneDeepCopiesAndIsIndependent)
210202
{
211203
auto q = makeQ(0.5, 0.5, 0.5, 0.5, /*omega*/ 0.1, 0.2, 0.3);

0 commit comments

Comments
 (0)