Files
vinihcrosaandClaude Sonnet 4.6 ef68a17e9b refactor(physics): settle body at floating equilibrium in NavalDomain::initialize
Instead of callers hardcoding the heave equilibrium position, let force models
declare their static contribution via a new virtual hook:

  NavalForceModel::applyStaticEquilibrium(Vector6& q)

RestoringForces overrides it to analytically solve for the heave equilibrium
(q[2] = wavesOriginPosition[2] - draft - netBuoyancy / hydro_rest[2][2]),
which eliminates the 4.9 MN heave impulse that previously coupled to surge
through off-diagonal added mass and damping terms.

NavalDomain::initialize() calls the hook for every registered model before
the first step, so any vessel added to the domain automatically starts at
the correct floating position — no per-caller configuration needed.

RigidBody6DOF::setState is promoted to public to support pre-simulation
state injection (previously only accessible to RK45Integrator via friend).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 08:36:04 -03:00
..