Files
solver/GNN/OndselSolver/MomentOfInertiaSolver.h
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

58 lines
2.3 KiB
C++

/***************************************************************************
* Copyright (c) 2023 Ondsel, Inc. *
* *
* This file is part of OndselSolver. *
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#pragma once
#include "EigenDecomposition.h"
namespace MbD {
class MomentOfInertiaSolver : public EigenDecomposition
{
//See document 9100moment.fodt
//m aJPP aJoo rPoP aAPo aJcmP aJcmPcopy rPcmP aJpp aAPp colOrder
//aJoo == aJpp when rPoP == rPcmP and aAPo == aAPp
public:
static void example1();
void doFullPivoting(size_t p);
void forwardEliminateWithPivot(size_t p) override;
void backSubstituteIntoDU() override;
void postSolve() override;
FColDsptr basicSolvewithsaveOriginal(FMatDsptr fullMat, FColDsptr fullCol, bool saveOriginal) override;
FColDsptr basicSolvewithsaveOriginal(SpMatDsptr spMat, FColDsptr fullCol, bool saveOriginal) override;
void preSolvewithsaveOriginal(FMatDsptr fullMat, FColDsptr fullCol, bool saveOriginal) override;
void preSolvewithsaveOriginal(SpMatDsptr spMat, FColDsptr fullCol, bool saveOriginal) override;
double getmatrixArowimaxMagnitude(size_t i) override;
void doPivoting(size_t p) override;
void setm(double mass);
void setJPP(FMatDsptr mat);
void setrPoP(FColDsptr col);
void setAPo(FMatDsptr mat);
void setrPcmP(FColDsptr col);
FMatDsptr getJoo();
DiagMatDsptr getJpp();
FMatDsptr getAPp();
void calc();
void calcJoo();
void calcJpp();
void calcAPp();
FColDsptr eigenvectorFor(double lam);
void calcJppFromDiagJcmP();
void calcJppFromFullJcmP();
double modifiedArcCos(double val);
double m = 0.0;
FMatDsptr aJPP, aJoo, aAPo, aJcmP, aJcmPcopy, aAPp;
FColDsptr rPoP, rPcmP;
DiagMatDsptr aJpp;
std::shared_ptr<FullRow<size_t>> colOrder;
};
}