前端进度条性能优化、仿真结束后后处理优化;后端C代码生成流程优化:先识别来源,再按照已知未知量需求排序,最后局部求解
This commit is contained in:
1 parent
0dcb465d84
commit
91bd9fb252
77 files changed
+11223
-551
No files matched your search
@@ -3,6 +3,8 @@ from __future__ import annotations
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Literal
|
||||
|
||||
from .port_computation import IMPLICIT_PNEUMATIC, PortComputation
|
||||
|
||||
|
||||
PortKind = Literal["physical", "signal"]
|
||||
PortNominalRole = Literal["inlet", "outlet", "bidirectional", "input", "output"]
|
||||
@@ -45,6 +47,7 @@ class PortDefinition:
|
||||
nominal_role: PortNominalRole
|
||||
positive_flow_direction: Literal["intoComponent"] | None = None
|
||||
variables: tuple[PortVariableDefinition, ...] = ()
|
||||
computation: PortComputation | None = None
|
||||
|
||||
@classmethod
|
||||
def pneumatic(
|
||||
@@ -52,6 +55,7 @@ class PortDefinition:
|
||||
name: str,
|
||||
*,
|
||||
nominal_role: Literal["inlet", "outlet", "bidirectional"] = "bidirectional",
|
||||
computation: PortComputation = IMPLICIT_PNEUMATIC,
|
||||
) -> PortDefinition:
|
||||
return cls(
|
||||
name=name,
|
||||
@@ -59,6 +63,7 @@ class PortDefinition:
|
||||
domain="pneumatic",
|
||||
nominal_role=nominal_role,
|
||||
positive_flow_direction="intoComponent",
|
||||
computation=computation,
|
||||
variables=(
|
||||
PortVariableDefinition(
|
||||
"p",
|
||||
@@ -188,6 +193,7 @@ class PortDefinition:
|
||||
"nominalRole": self.nominal_role,
|
||||
"positiveFlowDirection": self.positive_flow_direction,
|
||||
"variables": [variable.as_interface_dict() for variable in self.variables],
|
||||
**({"computation": self.computation.as_dict()} if self.computation else {}),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user