adding multiple grid cells to javascript example#743
Conversation
|
📄 Documentation for this branch is available at: https://ncar.github.io/musica/branch/multicell_js/ |
There was a problem hiding this comment.
Pull request overview
This PR adds support for simulating multiple grid cells in a JavaScript WASM chemical kinetics example. The implementation allows users to visualize how different initial conditions (with perturbations) evolve in parallel across multiple independent simulation cells.
Changes:
- Added a grid cells input control (1-50 cells) alongside the existing solver selector
- Modified mechanism builders to broadcast rate parameters across all grid cells
- Updated plotting to display trajectories for multiple cells with distinct colors
- Implemented perturbation logic for Lorenz example to show divergence in chaotic systems
Comments suppressed due to low confidence (1)
javascript/wasm/example.html:704
- The table is populated for every step after burnout (lines 697-704), but the times array is only pushed after the burnout check. This creates a logic inconsistency: during the burnout period (i < burnout), no data is collected for plotting or the table, which is correct. However, the table population code runs inside the loop after the burnout check but before times.push, which is confusing. The table population should align with the data collection logic for clarity.
const row = document.createElement('tr');
const rowVals = [cumulativeTime.toFixed(2)].concat(valsNow0);
rowVals.forEach(cellVal => {
const td = document.createElement('td');
td.textContent = String(cellVal);
row.appendChild(td);
});
resultsTbody.appendChild(row);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #743 +/- ##
=======================================
Coverage 74.60% 74.60%
=======================================
Files 109 109
Lines 8115 8115
=======================================
Hits 6054 6054
Misses 2061 2061
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
All of these additions are from copilot...