Conversation
…tored in the BOUT.dmp.*.nc files to plot the particle positions in SI units, following the change to normalised units in the vantage component. Optional argument to plot equal scale length axes in the animated figure. Set an explicit `dpi` in the `ani.save()` command.
…hen distribute this over MPI ranks. Tested only in serial. Prototype code for MPI map information for DG0 object is left in place.
… to determine how dg0 is created (in a later commit).
…ch of code to make the `mesh_coupler_dg0` variable.
…h()` and `create_dmplex_from_GMSH_msh()` are separate functions for initialising the DMPlex. For now, always use the `project_eval_dg0` object for projection and evaluation.
… of triangles in kinetic grid.
…egrees of freedom to BOUT++ Field2D data when the kinetic mesh has a different number of degrees of freedom to the BOUT++ grid. This commit does not update the VantageSourceManager.
…emperature are inputs. The initial condition is a uniform Maxwellian across the entire kinetic domain. Propagate the temperature to the standard deviation of the distrubtion of marker particles for the initial condition and for the recombination markers.
…n the kinetic mesh.
… moments such as pressure and temperature.
…Coupling/dmplex-features
…h is externally supplied.
…e.0.nc` output file can be used as a valid grid file when produced by a hermes-3 simulation running in serial.
…s VantageDiagnosticsManager.
…on the kinetic mesh.
…tion in parallel. Rename `source_data` variable to `source_data_plasma_grid`.
…mesh covers a larger physical volume than the plasma grid. Plasma quantities (set from inputs) are temporarily extended to the kinetic mesh. Diagnostics are written at every timestep, and the mass conservation check in `tests/integrated/particle-pusher/runtest` now uses data from the `VTKHDF` file.
… Field2D, std::vector and particle groups. Correct bug in ASSERT1() in vantage_sources.cxx.
…grid, and to transfer this data first to the kinetic mesh and then to the particle group with functions from the VantageDataTransfer class. Test `vantage-iz-rec-balance` fails with NaN but `bout_particle_push` and `dmplex-vertex-coordinates` pass. Further work is required to add `ASSERT1()` or similar checks to ensure that the data operated on by VantageDataTransfer, VantageDiagnosticsManager, etc, are correct when variables are passed in two different ways. Alternatively, it may be appropriate to make a redesign of these classes to ensure there is a single source of truth for particle groups, `bout_mesh`, `neso_mesh` and other data.
… data transfer functions to act on multiple particle groups for the same mesh.
…re only applied when the electron density is greater then the `electron_density_reaction_threshold` input parameter. Set the marker group plasma properties with the `update_particle_properties_from_plasma()` function. Set the standard deviation of the velocity distribution for the markers from the plasma temperature.
…c mesh and plasma grid diagnostics, through a for loop indexing over the existing sources in the source manager object. Only scalar source variables are presently supported. Any new scalar sources are automatically diagnosed.
… Field2D for the ion_density. Fails mass conservation test for the cases where the kinetic mesh extends beyond the BOUT++ mesh boundary.
…h cell volumes, transferred from the kinetic mesh to plasma grid using unit weights so that the areas of triangles in the kinetic mesh are added to make the area of the quad in the BOUT++ mesh.
…rom the sources stored in Field2D format.
… this field in the `particle-pusher/runtest` to diagnose mass conservation.
…lative area of the two kinetic mesh triangles which subdivide the plasma quadrilateral cell.
…c input grid file for a test of the extended kinetic mesh implementation in a slab case. The test uses the the `tests/integrated/particle-pusher` test code to run the same advection, ionisation and recombination tests on the extended, triangular, kinetic mesh as on the existing quad mesh that aligns with the BOUT++ grid. This verifies mass conservation in the new kinetic mesh implementation.
…igned with a BOUT++ grid. Achieves a speedup in the test runtime.
mrhardman
marked this pull request as ready for review
September 22, 2026 15:19
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.
Purpose
This PR enables the Vantage component to use a mesh for kinetic particles which extends beyond the BOUT++ plasma simulation domain.
Changes
When writing this PR, we assume that the kinetic mesh is provided in a GMSH
.mshformat (see https://gmsh.info/). The mesh is assumed to be triangular with the region overlapping with the BOUT++ mesh constructed by bisection of the quadrilaterals implied by theRxy,Zxycorners of the BOUT++ grid cells. The remainder of the mesh is arbitrary, and can extend to a wall boundary. It is assumed that the user is able to provide a list of integersmap_RZ_to_itriangle_0,map_RZ_to_itriangle_1, which define for each(x,y)in the BOUT++ Mesh object the global triangular cell definitions for the triangles at that(x,y), consistent with the triangles defined in the GMSH.mshfile.This PR also refactors the Vantage component to introduce source files that contain the
VantageSourceManagerclass, a classVantageDataTransferfor moving data fromField2Dand NESO-particles particle groups andstd::vectorstorage formats, and a classVantageDiagnosticsManagerfor handling BOUT++ and NESO-Particles kinetic diagnostics. The plasma data seen by the particles is only constant within the BOUT++ plasma simulation domain, and is zero outside of the plasma data. Plasma data is specified throughField2Dvariables, which should enable coupling to the Hermes-3 state. Plasma properties of particles are updated after particle pushing. Reactions are only applied to particles or markers with non-zero electron density (as a proxy for whether or not the particle is within the plasma domain).The diagnostics now write the moments of the neutral particle distribution in VTKHDF file format, with a new file for each internal time iteration of the Vantage component. The sources
SizandSrecare also written in the VTKHDF diagnostics. The VTKHDF diagnostic covers the entire kinetic mesh. The pre-existing diagnostics are also supported, writing source data on the BOUT++ grid.The
particle-pusherintegrated test is updated to use VTKHDF data for the neutral particles, and BOUT++.ncdata for the sources and the saved "ion_density" written by the Vantage component. The Vantage component makes an internal mass conservation test by default.Validation
The pre-existing tests verify that the existing quadrilateral DMPlex mesh features remain supported. Local tests were performed with valid
.mshand.ncgrid files to test the features here. Automatic tests will follow.AI Assistance
Non-agentic AI was consulted in writing and debugging this work.
Documentation
Documentation has not been updated.
###To do
mesh_coupler_dg0object for meshes with non-rectangular quadrilateral cells, seehermes-3/src/vantage.cxx
Lines 639 to 645 in 8921151