|
YAC 3.21.0
Yet Another Coupler
|
Encapsulates YAC setup and exchange for the ml_predictor component. More...

Public Member Functions | |
| __init__ (self, str component_name="ml_predictor") | |
| Initialize the YAC coupler for the ml_predictor component. | |
| setup (self, str grid_name, np.ndarray x_vertices, np.ndarray y_vertices) | |
| Define the 2D regular grid and fields for the ml_predictor component. | |
| bool | has_data (self) |
| bool | heat_flux_is_coupled (self) |
| Whether heat_flux is actually coupled back to the simulation component. | |
| str | datetime (self) |
| Return the current datetime of the next exchange (temperature is used as a reference). | |
| np.ndarray|None | recv_temperature (self) |
| Receive the temperature field from the Fortran component. | |
| send_heat_flux (self, np.ndarray heat_flux) | |
| Send the predicted heat flux back to the Fortran component. | |
| finalize (self) | |
| Finalize the YAC coupler and clean up resources. | |
Data Fields | |
| component_name | |
| yac | |
| comp | |
| temp_field | |
| heat_flux_field | |
| heat_flux_is_coupled | |
Encapsulates YAC setup and exchange for the ml_predictor component.
Definition at line 11 of file ml_coupler.py.
| ml_coupler.MLCoupler.__init__ | ( | self, | |
| str | component_name = "ml_predictor" ) |
Initialize the YAC coupler for the ml_predictor component.
| [in] | component_name | Name of the component for registration in YAC |
Definition at line 16 of file ml_coupler.py.
| str ml_coupler.MLCoupler.datetime | ( | self | ) |
Return the current datetime of the next exchange (temperature is used as a reference).
Definition at line 79 of file ml_coupler.py.
| ml_coupler.MLCoupler.finalize | ( | self | ) |
Finalize the YAC coupler and clean up resources.
Definition at line 120 of file ml_coupler.py.

| bool ml_coupler.MLCoupler.has_data | ( | self | ) |
Definition at line 63 of file ml_coupler.py.
| bool ml_coupler.MLCoupler.heat_flux_is_coupled | ( | self | ) |
Whether heat_flux is actually coupled back to the simulation component.
A one-way (training) configuration only couples temperature, in which case heat_flux's role is ExchangeType.NONE instead of ExchangeType.SOURCE.
send_heat_flux Definition at line 67 of file ml_coupler.py.
| np.ndarray | None ml_coupler.MLCoupler.recv_temperature | ( | self | ) |
Receive the temperature field from the Fortran component.
Definition at line 89 of file ml_coupler.py.
| ml_coupler.MLCoupler.send_heat_flux | ( | self, | |
| np.ndarray | heat_flux ) |
Send the predicted heat flux back to the Fortran component.
Only call this if heat_flux_is_coupled is True; otherwise there is no coupling configured for heat_flux to send data on (e.g. during a one-way training run).
| [in] | heat_flux | The predicted heat flux values to send back. |
Definition at line 103 of file ml_coupler.py.
| ml_coupler.MLCoupler.setup | ( | self, | |
| str | grid_name, | ||
| np.ndarray | x_vertices, | ||
| np.ndarray | y_vertices ) |
Define the 2D regular grid and fields for the ml_predictor component.
| [in] | grid_name | Name of the grid for registration in YAC |
| [in] | x_vertices | X coordinates of the grid vertices |
| [in] | y_vertices | Y coordinates of the grid vertices |
Definition at line 30 of file ml_coupler.py.
| ml_coupler.MLCoupler.comp |
Definition at line 24 of file ml_coupler.py.
| ml_coupler.MLCoupler.component_name |
Definition at line 22 of file ml_coupler.py.
| ml_coupler.MLCoupler.heat_flux_field |
Definition at line 26 of file ml_coupler.py.
| ml_coupler.MLCoupler.heat_flux_is_coupled |
Definition at line 113 of file ml_coupler.py.
| ml_coupler.MLCoupler.temp_field |
Definition at line 25 of file ml_coupler.py.
| ml_coupler.MLCoupler.yac |
Definition at line 23 of file ml_coupler.py.