Repository navigation
Chombo: field viewer ("View in 3D") without Python — pure-Java volume and membrane VTU writers - #2157
Merged
Merged
Conversation
Two small runs of Solver_Suite_6_2.vcml (test resource models/) made with the vcell-chombo bundle's VCellChombo2D_x64/VCellChombo3D_x64: "chombo 2D" (sim 105373152, a disk of radius 3 on an 8 x 8 mesh) and "chombo 3d" (sim 104116603, a ball of radius 4 on 8 x 8 x 8: whole voxels, cut cells and a triangulated membrane), saved at t = 0, 0.5, 1. The initial conditions of s2 (membrane, rate 0) and RanC_nuc (volume, x1e-8) were set to floor(x/1.25) + 100 floor(y/1.25) + 10000 floor(z/1.25), so a value names the voxel it was computed in. The .fvinput files are the solver inputs (the 2D run needed dt = 0.01). The .log and .zip are forced past .gitignore: the reader needs them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Chombo solver writes each variable's statistics as <var>_mean,
_total, _min, _max. StatisticType.fromName rejected "mean", and since the
post-processing file is read whenever a run's data is opened, every Chombo
result failed to open ("No Statistic with name mean"), fresh runs
included. Fixes #1894.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Chombo volume and membrane grids came only from the Python VTK service, which the data server is never given (vcell.vtk.pythonDir), so every Chombo field-viewer request failed, as MovingBoundary's did before #2155. writeChomboVolumeVtkGridAndIndexData and writeChomboMembraneVtkGridAndIndexData are now concrete on the VtkService base class, for every service, with no Python fallback. VtuWriter writes, as the Python service did: - the volume: polygons (2D); whole voxels, then tetrahedra, then the cut cells as VTK_POLYHEDRON with their own faces (3D), in VTK 9.4's layout (file version 2.3, face_connectivity/face_offsets/polyhedron_to_faces/ polyhedron_offsets, connectivity the distinct point ids ascending); - the membrane: the surface points, one VTK_LINE per line (2D) or one VTK_TRIANGLE per surface triangle (3D); with the ChomboIndexData in cell order. ChomboVtuPythonEquivalenceTest runs the real Python service on the VisMeshes ChomboMeshMapping builds from real 2D and 3D runs: identical cells, types, connectivity, polyhedron faces and index files (byte for byte), points to Float32 precision. ChomboVtuWriterTest checks, through ChomboVtkFileWriter, that every volume and membrane value pairs with its cell (the fixture's values name the voxel they were computed in). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
getVtuMeshData(ChomboFiles, ...) read vcell.primarySimdatadir.internal, which exists only on the server, so the desktop could not serve a local Chombo run's values. A LocalVCDataIdentifier (a quick run) now uses its own directory for the meshes and the values; any other identifier takes the same server path as before. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
DataServerImpl over a DataSetControllerImpl, a server-run identifier, the results under vcell.primarySimdatadir.internal/<owner>/ and vcell.vtk.pythonDir unset, as in the deployed data container: both real runs serve their volume and membrane meshes and one value per cell at every time, written beside the run, with nothing handed to Python. Before the Java writers this failed with "required System property vcell.vtk.pythonDir not defined". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…anes /grid reported a VTU-mode grid's dimension from its cell types, so a 3D Chombo membrane (triangles only) came back as 2D and the viewer drew it top-down in the plane, as a 2D run. It now reports the embedding dimension (volume cells, or points that span z), as FEniCSx bundles do. /timeseries&snap=nearest now snaps a click onto a Chombo membrane variable's lines or triangles (the viewer sends it for every body-fitted probe), and a 3D membrane's points no longer take a 2D plane's z. FieldViewerServerChomboLocalRunTest serves the real 2D and 3D runs as the desktop serves a quick run (LocalDataSetController, no server properties, no Python): /info lists the _Membrane domain, /grid is a triangle surface in 3D (segments in 2D) in microns on the sphere (circle), /field pairs one value with each membrane and volume cell, and /timeseries snaps a click beside the membrane onto it. The browser fixtures chomboRun2d/chomboRun3d serve the same runs; test_chombo_membranes.py checks the 3D membrane is drawn and probed in 3D, the cut-cell volume, and switching between them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Section 4 now describes the pure-Java volume and membrane writers, their VTU layout (polyhedra in VTK 9.4's form), the directories, the field viewer's membrane handling and the test fixture. Reading no longer needs linux/amd64 (jhdf), the "mean" statistic is read (#1894), and a solver bundle now ships. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jcschaff
added a commit
that referenced
this pull request
Oct 5, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The browser field viewer could not open any stored Chombo result: like MovingBoundary before #2155, the Chombo VTU grids came only from the Python VTK service, which the data server is never given (
vcell.vtk.pythonDir). This PR writes them in Java, following #2155's design, and fixes what stood between a real Chombo run and the viewer.VtkService.writeChomboVolumeVtkGridAndIndexData/writeChomboMembraneVtkGridAndIndexData, concrete on the base class, used on the desktop and the server with no Python fallback).VtuWritergains:VTK_POLYHEDRONwith their own faces (3D), in VTK 9.4's layout (version 2.3,face_connectivity/face_offsets/polyhedron_to_faces/polyhedron_offsets). This is what the Python service writes today; it no longer converts cut cells to tetrahedra (Chombo VisMesh is not watertight: cropVoxels clips each voxel independently, leaving EB-surface cracks and exposed interior walls #1895).VTK_LINEs in 2D orVTK_TRIANGLEs in 3D.ChomboIndexDatain cell order, as Python wrote it.Hdf5PostProcessorreads Chombo's<var>_meanstatistic as the average. Before this, every Chombo result failed to open, fresh runs included.LocalVCDataIdentifier) uses its own directory. Server paths are unchanged./gridreports the embedding dimension. A 3D membrane (triangles only) used to come back asdimension: 2, so the viewer drew it top-down in the plane, like a 2D run. It is now drawn as a surface in 3D./timeseries&snap=nearestsnaps probes onto a Chombo membrane variable's lines or triangles.Evidence
Real data. I ran two Chombo runs locally with the vcell-chombo solver bundle (
localsolvers/mac64/vcell-chombo), fromSolver_Suite_6_2.vcml: "chombo 2D" (8×8 disk) and "chombo 3d" (8×8×8 ball: 56 voxels, 224 cut-cell polyhedra, 888 membrane triangles). Both are committed as a fixture (about 540 KB) invcell-core/src/test/resources/org/vcell/vis/chombo/. Thes2(membrane) andRanC_nuc(volume) initial conditions encode the voxel each value was computed in, so the tests can check that each value is paired with the right cell. The dev cluster wasn't reachable from here, so no archived/simdatarun was used.Python equivalence (
ChomboVtuPythonEquivalenceTest, realpythonVtkvia Poetry, VTK 9.4.1), on VisMeshes built byChomboMeshMappingfrom both runs. Java and Python produce identical cells, cell types, connectivity and polyhedron faces. The index files match byte for byte, and points agree to Float32 precision (max |dx| ≈ 4.6e-7):Tests (each fails on the old code)
ChomboVtuWriterTest(2D, 3D): every volume and membrane value pairs with its cell; membrane on the sphere/circlerequired System property "vcell.vtk.pythonDir" not defined(andNo Statistic with name meanbefore #1894's fix)ChomboVtuPythonEquivalenceTest(2D, 3D)ChomboServerVtuPathTest: data server path,pythonDirunsetHdf5PostProcessorTest.testReadChomboStatisticsNo Statistic with name meanFieldViewerServerChomboLocalRunTest(2D, 3D):/infolists_Membrane;/gridis a triangle surface in 3D with physical coordinates;/fieldpairs one value per triangle (and per volume cell);/timeseriessnaps a click onto the membranedimension2; 2D: the membrane click misses (no snap); with the old core,pythonDirnot definedtest_chombo_membranes.py(newchomboRun2d/chomboRun3dfixtures; Chromium, WebKit, Firefox: 12 passed)Locally:
mvn clean install dependency:copy-dependencies -DskipTestspasses.org.vcell.vis.**,Hdf5PostProcessorTest,CartesianMeshChomboTestandcbit.vcell.solvers.mb.*pass.org.vcell.client.viz.*passes (all 12 classes).Nothing serialized over the API changed, so I didn't run
validate-openapi-spec.sh.Not done / gaps
chomboToPhysicaluses the solver mesh's size, whileChomboMeshMappinguses the finest level's.🤖 Generated with Claude Code