This commit is contained in:
Aik-Siong Koh
2023-06-18 01:06:39 -06:00
parent 3b08cd72df
commit 371b13a9e0
147 changed files with 2555 additions and 238 deletions

View File

@@ -70,13 +70,18 @@ void MbD::QuasiIntegrator::preFirstStep()
system->partsJointsMotionsForcesTorquesDo([](std::shared_ptr<Item> item) { item->preDynFirstStep(); });
}
void MbD::QuasiIntegrator::preStep()
{
system->partsJointsMotionsForcesTorquesDo([](std::shared_ptr<Item> item) { item->preDynStep(); });
}
double MbD::QuasiIntegrator::suggestSmallerOrAcceptFirstStepSize(double hnew)
{
auto hnew2 = hnew;
system->partsJointsMotionsForcesTorquesDo([&](std::shared_ptr<Item> item) { hnew2 = item->suggestSmallerOrAcceptDynFirstStepSize(hnew2); });
if (hnew2 > hmax) {
hnew2 = hmax;
std::string str = "StM: \Step size is at user specified maximum.";
std::string str = "StM: Step size is at user specified maximum.";
this->logString(str);
}
if (hnew2 < hmin) {
@@ -88,3 +93,9 @@ double MbD::QuasiIntegrator::suggestSmallerOrAcceptFirstStepSize(double hnew)
}
return hnew2;
}
void MbD::QuasiIntegrator::incrementTime(double tnew)
{
system->partsJointsMotionsForcesTorquesDo([](std::shared_ptr<Item> item) { item->storeDynState(); });
IntegratorInterface::incrementTime(tnew);
}