SmoldynFileWriter sets no boxsize: models starting with few or no particles get one virtual box (N×M surface checks)

Abierto
#2,159 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
66/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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 .smoldynInput VCell 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 boxsize explicitly (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.

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).

Lenguaje dominante
Java
Estrellas
140
Forks
35
Merge medio
17 h 39 min
PR fusionados (30 d)
19

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de virtualcell/vcell

Todos los issues de virtualcell/vcell

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.