SmoldynFileWriter sets no boxsize: models starting with few or no particles get one virtual box (N×M surface checks)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 66/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java
Research direction
Start at vcell-core/src/main/java/org/vcell/solver/smoldyn/SmoldynFileWriter.java, where the .smoldynInput file is assembled, and locate where box statements could be emitted alongside molperbox. Determine what mesh-spacing or diffusion-length information is available at that point (the writer already has geometry/membrane panel data) to compute a boxsize. Done means a model starting with zero or few particles produces a .smoldynInput containing an explicit boxsize, verified by running such a model and checking Smoldyn's log reports more than 1 virtual box.
Written by the indexing model from the issue text.
Description
Summary
SmoldynFileWriter writes neither boxsize nor molperbox. Smoldyn then sizes its virtual boxes from the initial molecule count.
In vcell-fvsolver's Smoldyn 2.38, boxesupdatelists uses mpbox = 4 or 5 and molcount(...) (L638). The boxes per side are ceil(L·(n / mpbox / V)^(1/dim)). A model that starts with no particles, e.g. particles created by a reaction, therefore gets 0 → clamped to 1 box per side, so a single box. Few initial particles give a few huge boxes.
With one box, every molecule is tested against every surface panel every time step: N molecules × M triangles. VCell meshes membranes finely (9,516 triangles for a 4 µm sphere on a 37³ mesh), so this can dominate run time as particles accumulate.
Evidence
- Native: confirmed from the code above, not from a timed run. The
.smoldynInputVCell generates has no box statements, and vcell-fvsolver's log does not print Smoldyn's box parameters. - The same Smoldyn logic, measured in a co-simulation (upstream Smoldyn with the VCell hybrid extensions; 806 membrane triangles; exchange model starting with 0 particles):
- Smoldyn reported 1 virtual box. Profiling put about 95% of the time in
checksurfaces → lineXpanel/panelside. - Setting
boxsizeexplicitly (two grid spacings) cut the cost 10×, from 4.55 to 0.45 wall s per simulated s. - A model starting with 20,000 particles automatically got 18³ boxes and did not show the problem.
- Details: DESIGN.md §11.
- Smoldyn reported 1 virtual box. Profiling put about 95% of the time in
Suggested fix
Write boxsize explicitly, e.g. a small multiple of the mesh spacing (or the diffusion length per step), instead of relying on molperbox and the initial count.
Related, and already in VCell: the highResVolumeSamples map accelerates compartment tests (posincompart). Box sizing is the corresponding acceleration for collision checks during diffusion.
Found while benchmarking the embedded hybrid against a process-bigraph co-simulation (vivarium-collective/viva-pde-particle).
- Dominant language
- Java
- Stars
- 140
- Forks
- 35
- Avg merge
- 17h 39m
- Merged PRs (30d)
- 19
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from virtualcell/vcell
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
virtualcell/vcell#2193 · 1 comment ·
Maintainers usually reply within 1 day
-
Accessibility Requirement Java-based User Interface
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
virtualcell/vcell#2138 ·
Maintainers usually reply within 1 day
-
Accessibility Requirement Java-based
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
virtualcell/vcell#2137 ·
Maintainers usually reply within 1 day
-
Accessibility Requirement User Interface
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
virtualcell/vcell#2135 ·
Maintainers usually reply within 1 day
-
Accessibility Requirement Java-based User Interface
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
virtualcell/vcell#2134 ·
Maintainers usually reply within 1 day
All issues in virtualcell/vcell
Similar issues
-
API `/api/dataverses/{identifier}/dataset/linkingDataverses?alreadyLinking=true` returns at most 1 collectionPossibly taken A pull request linked to this issue is open or already merged. OpenType: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
javaoperatorsdk.client.oauth-token has no effect on the Kubernetes clientPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
MCP add-on: JSON responses with non-ASCII characters are truncated (wrong Content-Length)Possibly taken @dhanushbs10 claimed this today. Openadd-on bug in:mcp
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Map.Coordinate does not implement proper equalsPossibly taken A pull request linked to this issue is open or already merged. Openvaadin-map
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vaadin/flow-components#10586 ·
Maintainers usually reply within 1 day
-
WeReadInstaller writes the launcher database on the main thread at handover (Activity pause timeout)Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 70/100