ansys / pytwin

Ansys Digital Twin repository
https://twin.docs.pyansys.com
MIT License
19 stars 7 forks source link

Add option to read input snapshots from memory, rather than disk #107

Closed EDCarman closed 1 year ago

EDCarman commented 1 year ago

📝 Description of the feature

Add option to read input snapshots from memory, rather than disk

For much the same reasons why we may prefer output snapshots in memory, rather than disk, we should consider providing input snapshots from memory. This will reduce disk I/O in cases where we may connect multiple models, all with vector inputs and outputs.

💡 Steps for implementing the feature

One potential implementation would be to modify the TbRom._reduce_field_input() method and replace the snapshot_filepath argument with a general snapshot argument that could be a string or Path, to read from disk, or an array or list of vec values. Optionally add a on_disk: bool to explicitly indicate to treat the input as a vector or Path.

If on_disk, read the binary file as before. If not, skip reading and use the vector directly (convert list to np.ndarray?)

🔗 Useful links and references

No response

lboucin commented 1 year ago