17. Vibe coding with pyoomph
While this tutorial covers in principle all features pyoomph has to offer, a quicker approach to solve your particular problem with pyoomph might be the usage of AI.
To assist AI agents for that job, pyoomph offers the file AGENTS.md and more specific of companion files in the agents/ directory.
These files were generated by language models itself, namely by failure-driven documentation refinement: AI agents unaware of pyoomph just received the .md files and were asked to code a random problem case. In case of failures in the first try, the .md files were sharpened accordingly and a fresh agent was given the same task. All problem cases were picked with the requirement of having a possiblity for validation, i.e. either having an analytical solution or external benchmark/literature data available.
To use it, point your assistant at AGENTS.md before asking for a script:
Read https://github.com/pyoomph/pyoomph/blob/main/AGENTS.md, then write me a pyoomph script that ...
That single file is meant to be enough for a typical problem, since it carries a routing table to the more specialized companion files
If you use a coding assistant that reads a project file automatically - the name AGENTS.md
is a convention several of them follow - it will pick the file up on its own as soon as you work
inside a clone of the repository.
Note
Using assistants which work directly in your code base, e.g. Claude Code, Cortex or Kimi Code, work of course considerably better than a plain web agent, since it can directly access pyoomph’s source code and test and improve your script automatically. It works best if you clone pyoomph’s git directly to give your agent direct access to pyoomph’s full source code.
However, while AI helps you to get started, you are still fully responsible to check your code and the generated results.
It might therefore help to:
Read the documentation of the classes and methods used in the generated script. Check if they indeed do what you were asking.
Start from a case with an analytical solution, or a limit of your problem that has one, and compare the numerical solution against it.
Check the quantities that must hold whatever the discretisation: a conserved mass or volume, a symmetry, a flux balance, a value that must vanish.
Refine the mesh or tighten the time-stepping tolerance and confirm the answer moves the way it should.
Be explicit about the physics you want, in the same way you would be with a colleague. State the geometry, the boundary conditions and the units; say whether a quantity is dimensional; and say which limit you are in. An assistant asked for “a droplet simulation” will invent all of that, plausibly and without telling you.