diff --git a/OndselSolver/ASMTGearJoint.cpp b/OndselSolver/ASMTGearJoint.cpp index 00e1d99..e941ab0 100644 --- a/OndselSolver/ASMTGearJoint.cpp +++ b/OndselSolver/ASMTGearJoint.cpp @@ -9,6 +9,7 @@ #include "ASMTGearJoint.h" #include "GearJoint.h" +#include "SimulationStoppingError.h" using namespace MbD; @@ -57,6 +58,7 @@ void MbD::ASMTGearJoint::readRadiusJ(std::vector& lines) void MbD::ASMTGearJoint::createMbD(std::shared_ptr mbdSys, std::shared_ptr mbdUnits) { + if (radiusI == 0.0 || radiusJ == 0.0) throw SimulationStoppingError("Gear radius is zero."); ASMTJoint::createMbD(mbdSys, mbdUnits); auto gearJoint = std::static_pointer_cast(mbdObject); gearJoint->radiusI = radiusI; diff --git a/OndselSolver/ASMTRackPinionJoint.cpp b/OndselSolver/ASMTRackPinionJoint.cpp index ae8b66f..f7470af 100644 --- a/OndselSolver/ASMTRackPinionJoint.cpp +++ b/OndselSolver/ASMTRackPinionJoint.cpp @@ -9,6 +9,7 @@ #include "ASMTRackPinionJoint.h" #include "RackPinJoint.h" +#include "SimulationStoppingError.h" using namespace MbD; @@ -44,6 +45,7 @@ void MbD::ASMTRackPinionJoint::readPitchRadius(std::vector& lines) void MbD::ASMTRackPinionJoint::createMbD(std::shared_ptr mbdSys, std::shared_ptr mbdUnits) { + if (pitchRadius == 0.0) throw SimulationStoppingError("Rack pinion radius is zero."); ASMTJoint::createMbD(mbdSys, mbdUnits); auto rackPinJoint = std::static_pointer_cast(mbdObject); rackPinJoint->pitchRadius = pitchRadius; diff --git a/OndselSolver/AccNewtonRaphson.cpp b/OndselSolver/AccNewtonRaphson.cpp index 683df36..a690141 100644 --- a/OndselSolver/AccNewtonRaphson.cpp +++ b/OndselSolver/AccNewtonRaphson.cpp @@ -90,7 +90,7 @@ void AccNewtonRaphson::incrementIterNo() str = ss.str(); system->logString(str); - throw SimulationStoppingError(""); + throw SimulationStoppingError("iterNo > iterMax"); } } diff --git a/OndselSolver/PosNewtonRaphson.cpp b/OndselSolver/PosNewtonRaphson.cpp index 60edc7e..1d3140c 100644 --- a/OndselSolver/PosNewtonRaphson.cpp +++ b/OndselSolver/PosNewtonRaphson.cpp @@ -38,7 +38,7 @@ void PosNewtonRaphson::incrementIterNo() str = ss.str(); system->logString(str); - throw SimulationStoppingError(""); + throw SimulationStoppingError("iterNo > iterMax"); } } diff --git a/OndselSolver/QuasiIntegrator.cpp b/OndselSolver/QuasiIntegrator.cpp index 9ec9480..cd63811 100644 --- a/OndselSolver/QuasiIntegrator.cpp +++ b/OndselSolver/QuasiIntegrator.cpp @@ -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) { @@ -61,7 +61,7 @@ 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) { @@ -69,7 +69,7 @@ void QuasiIntegrator::run() 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"); } }