Skip to content

Commit

Permalink
Correct compilation warnings with exceptions (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
huguesdpdn-aerospace authored Aug 15, 2024
1 parent ff06314 commit 20845a3
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion OndselSolver/ASMTAssembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ void MbD::ASMTAssembly::runKINEMATIC()
try {
mbdSystem->runKINEMATIC(mbdSystem);
}
catch (SimulationStoppingError ex) {
catch (const SimulationStoppingError& ex) {
}
}

Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/DifferenceOperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void DifferenceOperator::calcOperatorMatrix()
try {
operatorMatrix = CREATE<LDUFullMatParPv>::With()->inversesaveOriginal(taylorMatrix, false);
}
catch (SingularMatrixError ex) {
catch (const SingularMatrixError& ex) {
}
}

Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/PosICNewtonRaphson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void PosICNewtonRaphson::run()
postRun();
break;
}
catch (SingularMatrixError ex) {
catch (const SingularMatrixError& ex) {
auto redundantEqnNos = ex.getRedundantEqnNos();
system->partsJointsMotionsLimitsDo([&](std::shared_ptr<Item> item) { item->removeRedundantConstraints(redundantEqnNos); });
system->partsJointsMotionsLimitsDo([&](std::shared_ptr<Item> item) { item->constraintsReport(); });
Expand Down
6 changes: 3 additions & 3 deletions OndselSolver/QuasiIntegrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void QuasiIntegrator::run()
try {
IntegratorInterface::run();
}
catch (SingularMatrixError ex) {
catch (const SingularMatrixError& ex) {
std::stringstream ss;
ss << "MbD: Solver has encountered a singular matrix." << std::endl;
ss << "MbD: Check to see if a massless or a very low mass part is under constrained." << std::endl;
Expand All @@ -53,7 +53,7 @@ void QuasiIntegrator::run()
throw SimulationStoppingError("singular matrix");
}
}
catch (TooSmallStepSizeError ex) {
catch (const TooSmallStepSizeError& ex) {
std::stringstream ss;
ss << "MbD: Step size is prevented from going below the user specified minimum." << std::endl;
ss << "MbD: Check to see if the system is in a locked position." << std::endl;
Expand All @@ -64,7 +64,7 @@ void QuasiIntegrator::run()
throw SimulationStoppingError("stepSize < stepSizeMin");
}
}
catch (TooManyTriesError ex) {
catch (const TooManyTriesError& ex) {
std::stringstream ss;
ss << "MbD: Check to see if the error tolerance is too demanding." << std::endl;
auto str = ss.str();
Expand Down
4 changes: 2 additions & 2 deletions OndselSolver/SystemSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void SystemSolver::runBasicKinematic()
basicIntegrator->setSystem(this);
basicIntegrator->run();
}
catch (NotKinematicError ex) {
catch (const NotKinematicError& ex) {
this->runQuasiKinematic();
}
}
Expand All @@ -186,7 +186,7 @@ void SystemSolver::runQuasiKinematic()
basicIntegrator->setSystem(this);
basicIntegrator->run();
}
catch (DiscontinuityError ex) {
catch (const DiscontinuityError& ex) {
this->discontinuityBlock();
}
}
Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/VectorNewtonRaphson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void VectorNewtonRaphson::solveEquations()
try {
this->basicSolveEquations();
}
catch (SingularMatrixError ex) {
catch (const SingularMatrixError& ex) {
this->handleSingularMatrix();
}
}
Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/VelSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void VelSolver::solveEquations()
try {
this->basicSolveEquations();
}
catch (SingularMatrixError ex) {
catch (const SingularMatrixError& ex) {
this->handleSingularMatrix();
}
}
Expand Down

0 comments on commit 20845a3

Please sign in to comment.