SHARPy UDP data input and output interface.
The settings of this interface are to be used as the dictionary to the setting
DynamicCoupledsolver, which is the only one that is currently supported.
This interface allows for SHARPy to receive and send simulation data over the network using an UDP protocol.
variables_filenameis a filename to a
YAMLfile that contains a list of the input or output variables. The example below shows an acceptable input
--- - name: 'control_surface_deflection' # variable name. those in the timestep_info are supported var_type: 'control_surface' inout: 'in' # either `in`, `out` or `inout` position: 0 # control surface index - name: 'pos' # variable name var_type: 'node' # type of variable. In this case a node variable. Others: `panel`, `control_surface` inout: 'out' position: 5 # node number index: 2 # vector index, in this case a 3d vector where the desired index is number 2 - name: 'gamma' inout: 'out' position: [0, 1, 2] # [i_surf, i_chordwise, i_spanwise] var_type: 'panel' - name: 'psi' # CRV inout: 'out' var_type: 'node' position: 3 # node id index: 2 # dimension index ...
All variables in the aero and structural timestep info classes
datastructuresare supported, with the addition of
dtfor the time increment and
ntfor the current time step number.
If using a control surface input, make sure this control surface is given
control_surface_type = 2in the the case
.aero.h5file. Otherwise, the control surface will not move!
If the setting
True, then the clients from which the input signal is received will also be added to the destination client address book.
The input and output messages follow the example set by X-Plane
RREF0protocol. Thus, a message consists of a 5-byte header containing
RREF0followed by 8-bytes per variable, where the first 4-bytes correspond to the variable number (as ordered in the YAML file) as an integer and the latter 4-bytes correspond to the value of the variable in single precision float. The byte ordering is specified by the user.
A specific network log is created to detail the ins and outs of the communication protocol. The level of messages that are shown can be set in the settings.
The SHARPy input and output sockets do not time out.
The first time step in a simulation with UDP inputs takes particularly long. Make sure your client has a sufficient time out time to avoid issues. After the first time step, the UDP should not delay the simulation.
There is a limitation, for the moment, on just one control surface being supported for UDP input.
NetworkLoadertakes the following settings:
Path to YAML file containing input/output variables
Desired endianness byte ordering
Settings for the input network.:class:~sharpy.io.network_interface.InNetwork.
Settings for the output network
Send output to all clients, including those from where the input is received.
If not empty, writes received input data to the specified file.
Network log file name
Minimum logging level in console.
Minimum logging level in log file.