Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check rackpin and gear for zero radii #71

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions OndselSolver/ASMTGearJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "ASMTGearJoint.h"
#include "GearJoint.h"
#include "SimulationStoppingError.h"

using namespace MbD;

Expand Down Expand Up @@ -57,6 +58,7 @@ void MbD::ASMTGearJoint::readRadiusJ(std::vector<std::string>& lines)

void MbD::ASMTGearJoint::createMbD(std::shared_ptr<System> mbdSys, std::shared_ptr<Units> mbdUnits)
{
if (radiusI == 0.0 || radiusJ == 0.0) throw SimulationStoppingError("Gear radius is zero.");
ASMTJoint::createMbD(mbdSys, mbdUnits);
auto gearJoint = std::static_pointer_cast<GearJoint>(mbdObject);
gearJoint->radiusI = radiusI;
Expand Down
2 changes: 2 additions & 0 deletions OndselSolver/ASMTRackPinionJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "ASMTRackPinionJoint.h"
#include "RackPinJoint.h"
#include "SimulationStoppingError.h"

using namespace MbD;

Expand Down Expand Up @@ -44,6 +45,7 @@ void MbD::ASMTRackPinionJoint::readPitchRadius(std::vector<std::string>& lines)

void MbD::ASMTRackPinionJoint::createMbD(std::shared_ptr<System> mbdSys, std::shared_ptr<Units> mbdUnits)
{
if (pitchRadius == 0.0) throw SimulationStoppingError("Rack pinion radius is zero.");
ASMTJoint::createMbD(mbdSys, mbdUnits);
auto rackPinJoint = std::static_pointer_cast<RackPinJoint>(mbdObject);
rackPinJoint->pitchRadius = pitchRadius;
Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/AccNewtonRaphson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void AccNewtonRaphson::incrementIterNo()
str = ss.str();
system->logString(str);

throw SimulationStoppingError("");
throw SimulationStoppingError("iterNo > iterMax");
}
}

Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/PosNewtonRaphson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void PosNewtonRaphson::incrementIterNo()
str = ss.str();
system->logString(str);

throw SimulationStoppingError("");
throw SimulationStoppingError("iterNo > iterMax");
}
}

Expand Down
6 changes: 3 additions & 3 deletions OndselSolver/QuasiIntegrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void QuasiIntegrator::run()
ss << "MbD: Check to see if a curve-curve is about to have multiple contact points." << std::endl;
auto str = ss.str();
this->logString(str);
throw SimulationStoppingError("");
throw SimulationStoppingError("singular matrix");
}
}
catch (TooSmallStepSizeError ex) {
Expand All @@ -61,15 +61,15 @@ void QuasiIntegrator::run()
ss << "MbD: If they are not, lower the permitted minimum step size." << std::endl;
auto str = ss.str();
this->logString(str);
throw SimulationStoppingError("");
throw SimulationStoppingError("stepSize < stepSizeMin");
}
}
catch (TooManyTriesError ex) {
std::stringstream ss;
ss << "MbD: Check to see if the error tolerance is too demanding." << std::endl;
auto str = ss.str();
this->logString(str);
throw SimulationStoppingError("");
throw SimulationStoppingError("iTry > iTryMax");
}

}
Expand Down
Loading