Add diagram workbench UI with Modelica DoF coaching and ISO glyphs.

Ship the Next.js cycle editor with CAD chrome, technical HX symbols, Fixed/Free boundary guidance, and secondary water/air pressure drop support in the solver stack.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-17 22:46:46 +02:00
parent 62efea0646
commit 3358b74342
275 changed files with 70187 additions and 5230 deletions

View File

@@ -8,7 +8,7 @@
use approx::assert_relative_eq;
use entropyk_solver::{
CircuitConvergence, ConvergedState, ConvergenceCriteria, ConvergenceReport, ConvergenceStatus,
FallbackConfig, FallbackSolver, NewtonConfig, PicardConfig, Solver, System,
FallbackSolver, NewtonConfig, PicardConfig, Solver, System,
};
// ─────────────────────────────────────────────────────────────────────────────
@@ -18,7 +18,13 @@ use entropyk_solver::{
/// Test that `ConvergedState::new` does NOT attach a report (backward-compat).
#[test]
fn test_converged_state_new_no_report() {
let state = ConvergedState::new(vec![1.0, 2.0], 10, 1e-8, ConvergenceStatus::Converged, entropyk_solver::SimulationMetadata::new("".to_string()));
let state = ConvergedState::new(
vec![1.0, 2.0],
10,
1e-8,
ConvergenceStatus::Converged,
entropyk_solver::SimulationMetadata::new("".to_string()),
);
assert!(
state.convergence_report.is_none(),
"ConvergedState::new should not attach a report"
@@ -233,9 +239,7 @@ fn test_single_circuit_global_convergence() {
// ─────────────────────────────────────────────────────────────────────────────
use entropyk_components::port::ConnectedPort;
use entropyk_components::{
Component, ComponentError, JacobianBuilder, ResidualVector, StateSlice,
};
use entropyk_components::{Component, ComponentError, JacobianBuilder, ResidualVector, StateSlice};
struct MockConvergingComponent;
@@ -245,9 +249,10 @@ impl Component for MockConvergingComponent {
state: &StateSlice,
residuals: &mut ResidualVector,
) -> Result<(), ComponentError> {
// Simple linear system will converge in 1 step
residuals[0] = state[0] - 5.0;
residuals[1] = state[1] - 10.0;
// CM1.2: per-edge layout is (ṁ, P, h); index 0 is ṁ (pinned by the
// mass-flow closure), so this mock constrains P (index 1) and h (index 2).
residuals[0] = state[1] - 5.0;
residuals[1] = state[2] - 10.0;
Ok(())
}
@@ -256,8 +261,8 @@ impl Component for MockConvergingComponent {
_state: &StateSlice,
jacobian: &mut JacobianBuilder,
) -> Result<(), ComponentError> {
jacobian.add_entry(0, 0, 1.0);
jacobian.add_entry(1, 1, 1.0);
jacobian.add_entry(0, 1, 1.0);
jacobian.add_entry(1, 2, 1.0);
Ok(())
}