🚀 v1.2.1 is out #26
alexjilkin
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
v1.2.1 adds async simulation callbacks that allow JavaScript to control when LAMMPS advances to the next step.
The main new API is:
runScriptAsync(script, callback, { every, ... })It works for both
run Nandminimize.The callback can return a Promise. If it does, LAMMPS waits until the Promise resolves before continuing. This means JS directly gates simulation progress.
How it works
runScriptAsync(...).fix js/asyncif needed.END_OF_STEPandMIN_POST_FORCE.Callback data
Callbacks can receive:
Speed control
Simulation speed can be controlled in two ways:
every: how often the callback runsThe current Three.js example runs a single long
runand controls speed via Promise delay.Other fixes in this release
Tests
GitHub release:
https://github.com/lammps/lammps.js/releases/tag/v1.2.0
npm:
https://www.npmjs.com/package/lammps.js
Beta Was this translation helpful? Give feedback.
All reactions