Correct compilation warnings with exceptions (#76)

This commit is contained in:
huguesdpdn
2024-08-16 00:38:24 +02:00
committed by GitHub
parent ff063144ef
commit 20845a39cc
7 changed files with 10 additions and 10 deletions

View File

@@ -1434,7 +1434,7 @@ void MbD::ASMTAssembly::runKINEMATIC()
try {
mbdSystem->runKINEMATIC(mbdSystem);
}
catch (SimulationStoppingError ex) {
catch (const SimulationStoppingError& ex) {
}
}

View File

@@ -36,7 +36,7 @@ void DifferenceOperator::calcOperatorMatrix()
try {
operatorMatrix = CREATE<LDUFullMatParPv>::With()->inversesaveOriginal(taylorMatrix, false);
}
catch (SingularMatrixError ex) {
catch (const SingularMatrixError& ex) {
}
}

View File

@@ -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(); });

View File

@@ -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;
@@ -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;
@@ -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();

View File

@@ -161,7 +161,7 @@ void SystemSolver::runBasicKinematic()
basicIntegrator->setSystem(this);
basicIntegrator->run();
}
catch (NotKinematicError ex) {
catch (const NotKinematicError& ex) {
this->runQuasiKinematic();
}
}
@@ -186,7 +186,7 @@ void SystemSolver::runQuasiKinematic()
basicIntegrator->setSystem(this);
basicIntegrator->run();
}
catch (DiscontinuityError ex) {
catch (const DiscontinuityError& ex) {
this->discontinuityBlock();
}
}

View File

@@ -53,7 +53,7 @@ void VectorNewtonRaphson::solveEquations()
try {
this->basicSolveEquations();
}
catch (SingularMatrixError ex) {
catch (const SingularMatrixError& ex) {
this->handleSingularMatrix();
}
}

View File

@@ -58,7 +58,7 @@ void VelSolver::solveEquations()
try {
this->basicSolveEquations();
}
catch (SingularMatrixError ex) {
catch (const SingularMatrixError& ex) {
this->handleSingularMatrix();
}
}