Files
solver/GNN/OndselSolver/DispCompIecJecKeqc.cpp
forbes-0023 98051ba0c9 feat: add Phase 1 constraint solver addon, move prior content to GNN/
- Move existing OndselSolver, GNN ML layer, and tooling into GNN/
  directory for integration in later phases
- Add Create addon scaffold: package.xml, Init.py
- Add expression DAG with eval, symbolic diff, simplification
- Add parameter table with fixed/free variable tracking
- Add quaternion rotation as polynomial Expr trees
- Add RigidBody entity (7 DOF: position + unit quaternion)
- Add constraint classes: Coincident, DistancePointPoint, Fixed
- Add Newton-Raphson solver with symbolic Jacobian + numpy lstsq
- Add pre-solve passes: substitution + single-equation
- Add DOF counting via Jacobian SVD rank
- Add KindredSolver IKCSolver bridge for kcsolve integration
- Add 82 unit tests covering all modules

Registers as 'kindred' solver via kcsolve.register_solver() when
loaded by Create's addon_loader.
2026-02-20 20:35:47 -06:00

68 lines
2.2 KiB
C++

/***************************************************************************
* Copyright (c) 2023 Ondsel, Inc. *
* *
* This file is part of OndselSolver. *
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#include "DispCompIecJecKeqc.h"
#include "EndFrameqc.h"
using namespace MbD;
DispCompIecJecKeqc::DispCompIecJecKeqc()
{
}
DispCompIecJecKeqc::DispCompIecJecKeqc(EndFrmsptr frmi, EndFrmsptr frmj, EndFrmsptr frmk, size_t axisk) : DispCompIecJecKec(frmi, frmj, frmk, axisk)
{
}
void DispCompIecJecKeqc::initialize()
{
priIeJeKepEK = std::make_shared<FullRow<double>>(4);
ppriIeJeKepEKpEK = std::make_shared<FullMatrix<double>>(4, 4);
}
void DispCompIecJecKeqc::initializeGlobally()
{
ppAjOKepEKpEK = std::static_pointer_cast<EndFrameqc>(efrmK)->ppAjOepEpE(axisK);
}
void DispCompIecJecKeqc::calcPostDynCorrectorIteration()
{
auto frmIqc = std::static_pointer_cast<EndFrameqc>(frmI);
auto frmJqc = std::static_pointer_cast<EndFrameqc>(frmJ);
auto efrmKqc = std::static_pointer_cast<EndFrameqc>(efrmK);
aAjOKe = efrmKqc->aAjOe(axisK);
rIeJeO = frmJqc->rOeO->minusFullColumn(frmIqc->rOeO);
riIeJeKe = aAjOKe->dot(rIeJeO);
//std::cout << "DispCompIecJecKeqc riIeJeKe = " << riIeJeKe << std::endl;
pAjOKepEKT = efrmKqc->pAjOepET(axisK);
ppAjOKepEKpEK = efrmKqc->ppAjOepEpE(axisK);
for (size_t i = 0; i < 4; i++)
{
priIeJeKepEK->at(i) = ((pAjOKepEKT->at(i))->dot(rIeJeO));
auto& ppAjOKepEKipEK = ppAjOKepEKpEK->at(i);
auto& ppriIeJeKepEKipEK = ppriIeJeKepEKpEK->at(i);
ppriIeJeKepEKipEK->at(i) = ((ppAjOKepEKipEK->at(i))->dot(rIeJeO));
for (size_t j = i + 1; j < 4; j++)
{
auto ppriIeJeKepEKipEKj = (ppAjOKepEKipEK->at(i))->dot(rIeJeO);
ppriIeJeKepEKipEK->at(j) = ppriIeJeKepEKipEKj;
ppriIeJeKepEKpEK->at(j)->at(i) = ppriIeJeKepEKipEKj;
}
}
}
FMatDsptr DispCompIecJecKeqc::ppvaluepEKpEK()
{
return ppriIeJeKepEKpEK;
}
FRowDsptr MbD::DispCompIecJecKeqc::pvaluepEK()
{
return priIeJeKepEK;
}