You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes: #16 Add the ability to control the simulation from JS (#24)
* Add the ability to control the simulation from JS
* Remove unnecessary #ifdef __EMSCRIPTEN__
* Move all generate files into dist
* Improve and fix CI
* Remove js file
* Simple updated readme
* Clean up the new interface a bit
* fix js async callbacks for run/minimize + compute scalar sync, add tests
* Rename async method
* Change example to control simulation speed only through the async method
* Bumped version
---------
Co-authored-by: Anders Hafreager <anders.hafreager@cognite.com>
Run LAMMPS directly in the browser — a WebAssembly build with TypeScript-ready bindings.
7
-
The package exports the compiled `lammps.js` module together with a modern interface (`LAMMPSWeb`) that exposes snapshots for particles, bonds and simulation box data.
6
+
LAMMPS in the browser. WebAssembly build + a small TS-friendly client.
8
7
9
-
## Usage
8
+
## Install
9
+
10
+
```bash
11
+
npm install lammps.js
12
+
```
13
+
14
+
## Usage (main flow: `runScriptAsync`)
15
+
16
+
`runScriptAsync()` is the main API.
17
+
It works with `run ...` and `minimize ...`.
18
+
Your callback is called every `N` steps (`every`).
19
+
LAMMPS waits for the callback Promise before going to the next step.
20
+
If the Promise never resolves, simulation stays paused.
0 commit comments