验收四路模型并优化拓扑求解性能

This commit is contained in:
huojiarong committed 2026-08-12 11:57:42 +00:00
1 parent caca32a513
commit 456c29b3b6
20 files changed
+1085 -137

No files matched your search

+11
View File
@@ -10,6 +10,7 @@ from app.main import (
reactflow_project_storage_data,
run_system_xml_simulation,
)
from app.simulation.systems.generic import GenericFluidSystem
from app.system_xml import validate_system_xml_document
from tests.test_amesim_pnvo001_signal_xml import signal_edge, signal_port
from tests.test_generic_system_xml_simulation import component_node, physical_edge
@@ -287,6 +288,16 @@ def force_node_mass_project() -> ReactFlowProjectPayload:
class AmesimMechanicalXmlTests(unittest.TestCase):
def test_mechanical_states_use_machine_scale_absolute_tolerances(self) -> None:
system = GenericFluidSystem(
compile_reactflow_network(zero_force_mass_project())
)
tolerances = system.mechanical_state_reducer.absolute_tolerances(1.0e-8)
self.assertEqual(tolerances, [1.0e-12, 1.0e-12])
self.assertEqual(len(tolerances), len(system.initial_state_vector()))
def test_sparse_legacy_reactflow_mecmas_defaults_are_canonicalized(
self,