Design for Advanced Flow Visualization for WarpX
The ECP WarpX project is interested in doing flow field visualization for their simulations of lasers. A key part for understanding their science is to flow visualization techniques on electro-magnetic vector fields. These vector fields involved calculating the Lorentz Force on each particle. The Lorentz Force is defined as follows:
This requires an electric field E, magnetic field B, and the current velocity of the particle v. Additionally, to equation for particle advection, they prefer to use the LeapFrog solver.
To support this in the particle advection framework requires some additional classes and some generalization of concepts. The solver is already supported in the framework, so adding the LeapFrog method is straightforward. Support for the generating the Lorentz Force is more involved, and requires refactoring of the field classes in VTKm. This refactoring of the field class has begun, and is in the following MR: !2019 (closed) These changes also involve the use of particles with a mass, as opposed to the general assumption that particles are massless.
There are two main changes to support this functionality. The first is the introduction of different types of particles: massless, and particles with mass. Particles with mass have momentum, and so this must be stored with each particle.
A new field class has been created. The base implementation is that of the old notion of a field. Namely, it evaluates the vector at a given location. The new Field class provides support of additional calculations needed to compute the Lorentz force.