Files
solver/MbDCode/PosICNewtonRaphson.cpp
2023-05-20 17:55:13 -06:00

23 lines
646 B
C++

#include <assert.h>
#include <exception>
#include "PosICNewtonRaphson.h"
#include "SingularMatrixError.h"
#include "SystemSolver.h"
void MbD::PosICNewtonRaphson::run()
{
while (true) {
try {
VectorNewtonRaphson::run();
break;
}
catch (SingularMatrixError ex) {
auto redundantEqnNos = ex.getRedundantEqnNos();
system->partsJointsMotionsDo([&](std::shared_ptr<Item> item) { item->removeRedundantConstraints(redundantEqnNos); });
system->partsJointsMotionsDo([&](std::shared_ptr<Item> item) { item->constraintsReport(); });
system->partsJointsMotionsDo([&](std::shared_ptr<Item> item) { item->setqsu(qsuOld); });
}
}
}