完成求解器雅可比矩阵首轮优化,增加更新目录,整理了文档文件夹,增加了服务启动脚本

This commit is contained in:
lujingze committed 2026-08-17 07:33:31 +00:00
1 parent 6bb0591d32
commit 16a7eb2d6c
48 files changed
+8172 -217

No files matched your search

+21 -8
View File
@@ -2,6 +2,7 @@ from __future__ import annotations
import asyncio
import json
import os
import threading
import time
import unittest
@@ -321,14 +322,18 @@ class GenericSystemXmlSimulationTests(unittest.TestCase):
if phase == "integrating" and progress >= 0.2:
cancel_event.set()
result = GenericFluidSystem(
compile_reactflow_network(chain_project())
).simulate(
SolveIVPConfig(t_stop=0.05, method="BDF", max_step=0.001),
sample_step=0.005,
progress_callback=request_cancel_after_progress,
cancel_check=cancel_event.is_set,
)
with patch.dict(
os.environ,
{"SIMULATION_ODE_JACOBIAN_MODE": "optimized"},
):
result = GenericFluidSystem(
compile_reactflow_network(chain_project())
).simulate(
SolveIVPConfig(t_stop=0.05, method="BDF", max_step=0.001),
sample_step=0.005,
progress_callback=request_cancel_after_progress,
cancel_check=cancel_event.is_set,
)
self.assertFalse(result.success)
self.assertEqual(result.status, "cancelled")
@@ -343,6 +348,14 @@ class GenericSystemXmlSimulationTests(unittest.TestCase):
sparsity = integration["jacobianSparsity"]
self.assertGreater(sparsity["nonzeroCount"], 0)
self.assertGreater(sparsity["colorGroupCount"], 0)
self.assertEqual(
integration["jacobian"]["mode"],
"scipySparseFiniteDifference",
)
self.assertEqual(
integration["jacobian"]["fallbackReason"],
"denseStateDependencyPattern",
)
self.assertEqual(
integration["totals"]["finiteDifferenceRhsEstimate"],
sum(