agentleFS
AI-ModConAI-ModCon/genesis-skills/skills/plasma-sim-skills/gkeyll/SKILL.md

gkeyll

Skill30 starsChanged 51 days agoBSD-2-ClauseView on GitHub

Gkeyll plasma simulation framework. Use when installing gkeyll, writing Lua input files for VlasovMaxwell, Gyrokinetic, or Moments apps, configuring species and field parameters, or launching gkeyll runs on local machines or HPC clusters.

The file

Files
SKILL.md

Gkeyll — Plasma Simulation Framework

Gkeyll is a multi-physics plasma simulation framework supporting kinetic (Vlasov-Maxwell), gyrokinetic, and multi-fluid moment models. Simulations are configured via Lua scripts and can run on CPUs (serial or MPI) or GPUs (CUDA).

Installation

Known machines (easiest):

git clone https://github.com/ammarhakim/gkeyll.git
cd gkeyll

# Build dependencies then configure
./machines/mkdeps.<machine>.sh      # e.g., macos, traverse, perlmutter
./machines/configure.<machine>.sh
make install -j $(nproc)

Custom/new systems:

cd install-deps
./mkdeps.sh --build-openblas=yes --build-superlu=yes
cd ..
./configure --help                  # review options for compiler paths
make -j $(nproc)

See references/installation.md for full dependency list, machine script names, GPU/CUDA options, and per-layer build targets.

Input File Basics

Gkeyll uses Lua scripts (.lua files) with four sections:

-- 1. Load the App
local Plasma = require("App.Plasma").VlasovMaxwell

-- 2. Preamble: user parameters and derived quantities
local vte = math.sqrt(eV * Te / me)   -- thermal velocity

-- 3. App configuration table
local plasmaApp = Plasma.App {
   tEnd = 1e-6,                        -- simulation end time
   nFrame = 10,                        -- output frames
   lower = {-math.pi},                 -- config-space lower bound
   upper = { math.pi},                 -- config-space upper bound
   cells = {64},                       -- config-space resolution
   periodicDirs = {1},

   elc = Plasma.Species {              -- species block
      charge = -eV, mass = me,
      lower = {-6*vte}, upper = {6*vte},
      cells = {32},
      init = ...,
   },

   field = Plasma.Field {              -- field block
      epsilon0 = eps0, mu0 = mu0,
   },
}

-- 4. Run
plasmaApp:run()

See references/input-format.md for all App types, Common/Species/Field keys, and annotated examples.

Running Simulations

# Serial
$HOME/gkylsoft/gkeyll/bin/gkeyll input.lua

# MPI parallel
mpirun -np 4 $HOME/gkylsoft/gkeyll/bin/gkeyll input.lua

# Verify MPI support
$HOME/gkylsoft/gkeyll/bin/gkeyll -help   # look for "Built with MPI"

Output files: sim_N.bp (ADIOS2 / BP format), one file per frame per field/species.

Post-process with postgkyl:

conda install -c gkyl -c conda-forge postgkyl
pgkyl sim_elc_0.bp plot

See references/running.md for MPI decomposition, GPU flags, postgkyl commands, and regression testing.

Quick Reference

AppPhysics model
VlasovMaxwellFully kinetic Vlasov-Maxwell
GyrokineticGyrokinetic (delta-f or full-f)
MomentsMulti-fluid moment-Maxwell
PKPM10-moment pressure-kinetic

Additional Resources

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.