Check rackpin and gear for zero radii
This commit is contained in:
@@ -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<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;
|
||||
|
||||
@@ -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<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;
|
||||
|
||||
@@ -90,7 +90,7 @@ void AccNewtonRaphson::incrementIterNo()
|
||||
str = ss.str();
|
||||
system->logString(str);
|
||||
|
||||
throw SimulationStoppingError("");
|
||||
throw SimulationStoppingError("iterNo > iterMax");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ void PosNewtonRaphson::incrementIterNo()
|
||||
str = ss.str();
|
||||
system->logString(str);
|
||||
|
||||
throw SimulationStoppingError("");
|
||||
throw SimulationStoppingError("iterNo > iterMax");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user