Muscat.Bridges.CoSAppBridge module¶
- class CoSAppMuscatReader(name: str, **kwargs)[source]¶
Bases:
SystemCosApp Muscat Mesh Reader
- design_methods¶
- drivers¶
- inputs¶
- name2variable¶
- outputs¶
- setup()[source]¶
System port and/or child System are defined in this function.
This function allows to populate a customized System class. The helper functions for the user are:
add_input : add an input port
add_output : add an output port
add_inward : add a inward variable
add_outward : add a outward variable
add_child : add a child System
See also
add_input,add_output,add_inward,add_outward,add_childExamples
Here is an example of System subclassing:
>>> class AdvancedDuct(System): >>> >>> def setup(self): >>> self.add_input(FlowPort, 'in') >>> self.add_output(FlowPort, 'out') >>> self.add_inward({'heat_source': 1.0, >>> 'pressure_loss': 0.01}) >>> self.add_outward('wall_temperature', 400.) >>> >>> self.add_child(AnotherSystem('system2'))
- class MuscatMeshPort(name: str, direction: PortType, variables: dict[str, Any] | None = None)[source]¶
Bases:
PortCoSApp port for Muscat Meshes. This port implement a spacial connector to pass only a view of the mesh
- class Connector(name: str, sink: BasePort, source: BasePort, mapping: str | list[str] | dict[str, str] | None = None)[source]¶
Bases:
BaseConnectorCustom connector for MuscatMeshPort objects, no copy of the object
- setup()[source]¶
Port variables are defined in this function by calling add_variable.
This function allows to populate a customized Port class. The add_variable function is only callable in the frame of this function.
Examples
Here is an example of Port subclassing:
>>> class FlowPort(Port): >>> def setup(self): >>> self.add_variable('Pt', 101325.) >>> self.add_variable('Tt', 273.15) >>> self.add_variable('W', 1.0)