Commit Graph
15 Commits
Author SHA1 Message Date
vinihcrosaandClaude Sonnet 4.6 9a16d8d0cf feat(simulation): add NavalDomain::serializeStateJson for WASM state export
Returns {"t":...,"vessels":[{"id":...,"x":...,"psi":...,"u":...,"r":...},...]}
2 tests verify JSON structure and time accumulation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 23:51:56 -03:00
vinihcrosaandClaude Sonnet 4.6 6196f0ca0e refactor(physics): replace CVODE with RK45, remove SUNDIALS dependency
CvodeConfig kept as backward-compat alias for RK45Config.
CvodeIntegrator removed. All 207 tests pass without SUNDIALS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 23:49:11 -03:00
vinihcrosaandClaude Sonnet 4.6 1474b0cf4c feat(physics): add Dormand-Prince RK45 adaptive integrator
6 tests pass: zero-force, constant-force, SHO period, analytical
precision, interface contract, and large-dt adaptation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 23:46:43 -03:00
vinihcrosaandClaude Sonnet 4.6 f84c914397 refactor(physics): extract IIntegrator pure interface to own header
Fix pre-existing -Werror for assert-only loop vars in world sources.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 23:42:37 -03:00
vinihcrosa 408738d3f0 Add unit and integration tests for naval simulation and world components
- Implemented comprehensive unit tests for the NavalSimulation class, covering N-body state independence, vessel control updates, and integration with maneuver systems.
- Created tests for the CouplingRegistry to validate force consumption and resolution behavior.
- Developed tests for the Environment and NavalEnvironment classes to ensure proper state management and functionality.
- Added tests for the IDomain interface to verify compliance with expected behaviors and constraints.
- Established tests for the World class to confirm domain management, time accumulation, and snapshot integrity.
2026-06-27 20:17:12 -03:00
vinihcrosaandClaude Sonnet 4.6 ae3365ce6a chore: ignore build-* and build_* directories
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 03:39:51 -03:00
vinihcrosaandClaude Sonnet 4.6 b11c4be0c5 refactor: reorganize repo into libs/ domain structure
Move files from flat core/naval/adapters layout into libs/{common,physics,simulation,vessel,world,persistence} with updated namespaces, CMakeLists, tests, README, AGENTS.md, and Doxyfile.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 03:34:51 -03:00
vinihcrosa 529535ba53 Add scenario examples and tests for body types and initial conditions
- Introduced a new body type "simple_box" with defined mass and added mass matrices in `simple_box.json`.
- Created scenarios for bodies with initial velocity and two bodies at rest in `body_with_initial_velocity.json` and `two_bodies_at_rest.json`, respectively.
- Implemented tests in `TestScenarioReader.cpp` to validate parsing of scenarios, body types, and simulation behavior.
- Ensured that bodies at rest remain at rest after simulation steps and that initial conditions are correctly applied.
2026-06-24 03:11:16 -03:00
vinihcrosaandClaude Sonnet 4.6 880558935f test(core): add integration tests for body at rest with no forces
Verify single and multi-body scenarios: body with no force models
and zero initial velocity stays at rest after 10s (100 × dt=0.1).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 22:06:42 -03:00
vinihcrosaandClaude Sonnet 4.6 dc878f9f17 refactor(core): AbstractBody interface + RigidBody6DOF + multi-body Simulation
- AbstractBody: pure interface (addForceModel, step, state, id) — no lifecycle
- RigidBody6DOF: absorbs Body + CvodeIntegrator + ForceModels; lazy CVODE init
- Simulation: multi-body container (map<int, AbstractBody> + insertion-order step)
- CvodeIntegrator: Body* → RigidBody6DOF* in RhsContext
- NavalSimulation: accepts unique_ptr<RigidBody6DOF>; Simulation now multi-body
- Remove Body.h/Body.cpp (replaced by RigidBody6DOF)
- 64/64 tests green

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 05:23:56 -03:00
vinihcrosaandClaude Sonnet 4.6 dd4e79cbd6 feat(naval): add naval domain module (M2)
NavalForceModel bridge pattern keeps core::ForceModel interface intact
while providing NavalContext (environment, speedToWater, speedToWind,
EMA q_avg) to all naval models via bindContext.

Force models: Inertial (Coriolis), Restoring (hydrostatic spring),
Damping (potential + linear/quadratic), Squat (ICORELS shallow-water),
Wind (REGULAR/ACSINKAGE), Current (OBOKATA section-integration and
REGULAR with Van der Pol VIM RK4), Thrust (open-water Kt), Rudder
(Prandtl lift), Tug (PUSH/PULL/ESCORTING with bilinear table).

Wave engine: JONSWAP/PIERSON/REGULAR spectrum, Mitsuyasu cos-2S
directional spreading, WAMIT RAO interpolation in WaveForces.

NavalSimulation wraps core::Simulation, rebuilds NavalContext each
step, maintains EMA (tau=16.5s). 63/63 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 01:14:23 -03:00
vinihcrosaandClaude Sonnet 4.6 3e8e95d544 feat(core): add core engine primitives (M1)
Implements the 6-DOF rigid body dynamics core:
- Types (Vector6, Matrix6x6), Forces, BodyState value type
- ForceModel abstract interface (non-const compute, D-09)
- Body: mass matrix inversion at construction, friend CvodeIntegrator (D-11)
- CvodeIntegrator: BDF integrator via SUNDIALS CVODE 7.x, static rhsCallback
- Simulation: orchestrates Body + CvodeIntegrator + ForceModel registry
- Math utilities: LinearAlgebra (invert6x6, matVecProduct), AngleUtils, Interpolation
- 29 tests, 100% passing (zero-force, constant-force, SHO period, time accumulation)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 23:49:57 -03:00
vinihcrosaandClaude Sonnet 4.6 2c56c8b1c5 build: initial repository setup (M0)
CMake project structure with ymir_core, ymir_naval, and ymir_adapters
static library targets. Catch2 and nlohmann/json via FetchContent;
SUNDIALS and CGAL probed as optional system deps (required from M1/M2).
Smoke tests pass on macOS ARM64. Docker multi-stage image for Linux
x86_64. GitHub Actions CI matrix: Linux x86_64, macOS ARM64, Windows
x86_64. Code quality tooling: .clang-format, .clang-tidy, Doxyfile.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 22:59:35 -03:00
vinihcrosa 9ec590acaf chore: add .claude/ to .gitignore 2026-06-21 22:33:08 -03:00
vinihcrosaandClaude Sonnet 4.6 292aba6687 chore: initial project scaffold
Add README, AGENTS.md, CLAUDE.md, and .gitignore.

Establishes project identity (general-purpose physics engine, naval domain
first), Ports and Adapters architecture rules, Conventional Commits, and
Semantic Versioning as project standards. Legacy reference docs moved to
.docs/ and gitignored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 22:31:35 -03:00