An engineer at an automotive company wants to know how air flows around a new side mirror design. She opens her CAD tool, exports the geometry, hands it to the simulation team, and waits. One hour for meshing. Another hour for solver setup. Twenty-four hours for the CFD run to finish. Then she looks at the result, decides the drag is too high, changes the mirror shape slightly, and starts the whole cycle again.
Twenty-six hours per design iteration. If she wants to explore ten design variants, that’s a week and a half — before writing a single line of manufacturing spec.
This is the reality of physics simulation in engineering today, and it’s the problem a new generation of AI tools — including a project of mine called PhysIQ, which I’ll walk through in Part 2 — is trying to solve. But before any of that makes sense, we need to build up the basics: what physics simulation actually is, what a mesh is, what a neural network is, and why a special kind of neural network (a Graph Neural Network) turns out to be a remarkably good fit for this problem.
No prior background assumed. Let’s start from the ground up.
Physics simulation means predicting how a physical system changes over time, using a computer instead of a physical experiment. Will the air flow smoothly around this car, or will it create turbulent eddies? Will this bridge bend within safe limits under load? Will this cloth drape naturally over a character in an animated film?
To get there, it helps to start even further back — with the simplest physical idea there is: things change, and we have a precise mathematical language for describing how.
Suppose a car is moving. Its position changes over time — at one second it’s at 10 meters, at two seconds it’s at 20 meters. The rate at which position changes is called velocity. If velocity itself changes — the car speeds up or slows down — that rate of change is called acceleration. Newton’s second law, F = ma, says that force equals mass times acceleration: physics, in this view, is fundamentally a story about how quantities change.
Mathematicians have a precise tool for describing change: the derivative. The derivative of position with respect to time gives velocity; the derivative of velocity gives acceleration. An equation that involves derivatives is called a differential equation, and a huge amount of physics — pendulums, springs, falling objects, planetary orbits — can be written down entirely as a differential equation relating a few changing quantities to each other.
When a quantity only changes with respect to one variable (usually time), the equation is called an ordinary differential equation (ODE) — the position of a single falling ball is a classic example. But the air flowing around a car doesn’t just change over time; it changes in the x direction, the y direction, and the z direction too, all at once and interdependently. Equations with derivatives across multiple variables like this are called partial differential equations (PDEs), and almost every interesting engineering simulation — fluid flow, heat transfer, structural deformation — comes down to solving one.
The catch is cost. For fluids specifically, the governing PDE is the Navier-Stokes equations — a relationship connecting velocity, pressure, and how both change in space and time. For almost any shape or scenario you’d actually care about in engineering, equations like this have no clean, pen-and-paper solution. You can write Navier-Stokes on a blackboard in one line, but solving it exactly for “air flowing around a car mirror” is not something anyone can do with algebra. So instead, simulation tools fall back on numerical methods: break the problem into small enough pieces that an approximate solution is tractable to compute, even if it takes a lot of computation.
Here’s the core intuition for why “breaking into pieces” works, before we get to the specifics of meshes. Imagine trying to approximate a smooth curve using a computer that can only draw straight lines. One long straight line would be a poor approximation. But ten short straight line segments, each following the curve closely over a small stretch, gets you something visually indistinguishable from the real curve. More segments, better approximation — at the cost of more line segments to compute.
Physics simulation uses exactly this idea, just in two or three spatial dimensions instead of one: instead of solving a PDE everywhere, continuously, we divide space into many small regions and solve an approximate, simplified version of the physics within each one.
That dividing-into-small-regions step is where meshes come in.
Imagine the 2D cross-section of a pipe with a cylindrical obstacle in it — this is, conveniently, the actual benchmark problem used later in this series. To simulate fluid flowing around that cylinder, a solver needs to know the velocity and pressure everywhere in the domain, at every instant in time. Computing an exact, continuous answer everywhere is impossible. So instead, the domain is broken into a finite number of small, simple shapes — usually triangles in 2D, or tetrahedra in 3D — connected at shared corners. This collection of small shapes is called a mesh.
A mesh has three basic ingredients:
Instead of solving the PDE everywhere continuously, the solver only computes quantities like velocity and pressure at the nodes, and uses the mesh structure to estimate how those quantities vary across each small element. This is the core idea behind methods like the Finite Element Method (FEM) and Finite Volume Method (FVM): turn a continuous, infinite-dimensional problem into a finite, discrete one that a computer can actually solve, by assembling a large system of equations — one set of unknowns per node — and solving them simultaneously.
Why break a domain into triangles specifically? Triangles are the simplest 2D shape that can tile an irregular region without gaps, and — critically — a triangle is always “flat” and non-degenerate as long as its three vertices aren’t collinear. This makes the math of estimating a smoothly-varying quantity across each triangle straightforward.
Triangulation is the process of generating that triangle mesh from a set of points or boundary curves. Not all triangulations are equally good. A triangulation full of long, thin, needle-like triangles produces numerically unstable, inaccurate simulations — small errors get amplified. The gold standard is Delaunay triangulation: a specific way of connecting points into triangles such that no point lies inside the circumcircle of any other triangle. In practice, this rule tends to avoid thin slivers and produce triangles that are as close to equilateral as the point distribution allows — which keeps the numerical solver well-behaved.
Mesh quality also varies by where you are in the domain. Near the cylinder surface, where velocity changes rapidly (steep gradients, boundary layers, vortex shedding), you want a fine mesh — small triangles densely packed — to capture that detail accurately. Far from the cylinder, where the flow is calm and slowly varying, a coarse mesh — large triangles — is good enough and saves a lot of computation. This deliberate variation in mesh density is called mesh refinement, and getting it right is itself a specialized skill in computational engineering.
This is also where the real cost of classical simulation comes from: a fine, well-refined mesh might have hundreds of thousands or millions of nodes for a 3D problem, and the solver has to assemble and solve a system of equations at every single timestep, for potentially thousands of timesteps. That’s the “twenty-four hours” from the opening story.
If you already know what a neural network is, skip ahead — but for completeness:
A neural network is a function — a mathematical mapping from inputs to outputs — built out of stacked layers of simple operations. Each layer takes a vector of numbers, multiplies it by a matrix of learned weights, adds a bias, and passes the result through a nonlinear function (like ReLU, which just zeroes out negative values). Stack enough of these layers and the network can, in principle, approximate extremely complicated functions — this is the universal approximation property that makes neural networks broadly useful.
The “learning” part works like this: you show the network an input, compare its output to the correct answer using a loss function (a number that measures how wrong the prediction was), and then use backpropagation — repeated application of the chain rule from calculus — to figure out how to nudge every weight in the network to make that loss slightly smaller. Repeat this millions of times over a large dataset, and the weights gradually settle into values that make the network’s predictions accurate.
The specific architecture of layers matters enormously, and is usually chosen to match the structure of the data. Convolutional Neural Networks (CNNs) exploit the grid structure of images. Transformers exploit the sequential structure of text. And — as we’re about to see — Graph Neural Networks exploit the irregular, connected structure of meshes.
Here’s an idea that sits right at the intersection of physics and deep learning: what if, instead of (or in addition to) training a neural network on labeled examples, you trained it to directly satisfy a physical law?
This is the idea behind Physics-Informed Neural Networks (PINNs). A PINN is usually a fairly ordinary neural network — often a simple multi-layer perceptron — trained to output a predicted physical quantity (say, velocity and pressure) for any given point in space and time. The twist is in the loss function. Because the network’s output is a differentiable function of its inputs, you can use automatic differentiation (the same machinery behind backpropagation) to compute the derivatives of the network’s own output — exactly the derivatives that appear in the governing PDE (like Navier-Stokes). Plug those derivatives back into the PDE, and you get a number called the PDE residual: how badly the network’s current prediction violates the physical law. That residual becomes a term in the loss function. The network is, quite literally, penalized for disagreeing with physics, even at points where there’s no labeled training data at all.
It’s an elegant idea — physics itself becomes a teacher. But PINNs have real, practical limitations. Training against a nonlinear PDE residual is a hard optimization problem in its own right. A PINN trained for one specific geometry and boundary condition generally needs to be retrained from scratch if you change the shape — there’s no built-in notion of mesh connectivity or geometry in a standard MLP. And for problems that evolve over long time horizons, PINNs can drift or fail to converge cleanly.
This matters because it sets up a real tension worth understanding before we get to GNNs: do you want a network that is taught the physics directly via a PDE-based loss (a PINN), or a network that learns the physics implicitly by training on many examples of mesh-based simulation data, the way an image classifier learns “catness” implicitly from thousands of cat photos? Both are valid strategies, with different tradeoffs — and it’s the second strategy, applied specifically to mesh data, that leads us to geometric deep learning.
Recall that a mesh is irregular: some nodes have three neighbors, some have eight; edge lengths vary depending on local mesh refinement. A standard CNN expects a grid, where pixel [i, j] always has exactly four neighbors at a fixed distance. You simply cannot slide a convolution kernel over a mesh — there’s no consistent “next node” the way there’s a consistent “next pixel.”
Geometric deep learning is the field that generalizes deep learning to exactly this kind of non-Euclidean, irregular data: graphs, meshes, point clouds, manifolds. And the key realization, once you see it, is almost obvious: a mesh basically is a graph already. Nodes are mesh vertices. Edges are the connections between them. All that’s missing is a way to do something convolution-like — aggregating local neighborhood information — on this irregular structure.
That something is called message passing, and it’s the central operation in a Graph Neural Network (GNN). One round of message passing works like this:
This single round of message passing lets each node absorb information from its immediate neighbors. Stack many rounds — many “layers” of the GNN — and information propagates further across the mesh with each layer, the same way information would propagate several hops away in a single pass.
This isn’t just a clever computational trick to make graphs work with deep learning — it’s a genuinely physical match. In a real fluid or solid, a disturbance at one point physically propagates to its neighbors first, and from there to their neighbors, and so on. Message passing on a mesh graph respects exactly the same locality structure as the physics it’s trying to model. That correspondence is the whole reason GNNs turn out to be such a natural fit for learning physics simulation directly from mesh data — which is exactly the approach behind PhysIQ, covered in Part 2.
Putting it all together, there are roughly three distinct strategies for “physics AI” worth knowing about:
Physics-Informed Neural Networks (PINNs) — bake the governing PDE directly into the training loss. No simulation data strictly required, but limited generalization across geometries and slow to train.
Neural Operators (e.g. Fourier Neural Operators) — learn a mapping between entire input and output fields rather than fixed-size vectors, working naturally on regular grids but requiring awkward interpolation on unstructured, irregular meshes.
Data-driven mesh surrogates (Graph Neural Networks) — train a GNN directly on a dataset of mesh-based simulation trajectories (input mesh and boundary conditions → solution over time), and use it instead of the solver at inference time. This generalizes naturally across arbitrary mesh topologies, at the cost of needing a dataset of real simulation runs to learn from.
Each strategy makes a different bet about where the “physics knowledge” should live: explicitly in the loss function, implicitly in a learned operator over fields, or implicitly in a learned operator over graphs. PhysIQ is built on the third approach, following the architecture introduced by DeepMind’s MeshGraphNets — and that’s where Part 2 picks up.
It’s worth stepping back and looking at the two pipelines next to each other — the classical one, and the one machine learning enables:
Classical simulation:
Physics equations (PDEs) ↓Mesh (triangulation, refinement) ↓Numerical solver (FEM / FVM, every timestep) ↓Result — hours or days later
Machine-learning simulation:
Thousands of pre-computed simulations ↓Train a Graph Neural Network on that data ↓New geometry comes in ↓Prediction — seconds later
The classical pipeline re-solves the same physics from scratch, every single time, for every new geometry. The learning-based pipeline pays the cost once, up front, during training — and from then on, it’s not solving equations at inference time at all. It’s recognizing patterns in how solutions tend to behave, the same way an image classifier doesn’t “compute” that something is a cat, it recognizes the pattern from having seen many cats before.
Continued in Part 2: a full case study of PhysIQ — the actual GNN architecture, the data engineering behind training it efficiently, how it learns to flag its own uncertain predictions, and how it can run the simulation backwards to design a shape from a target performance metric.
The full codebase for PhysIQ is available at github.com/ahmealy/PhysIQ. A full demo is on YouTube.
*MeshGraphNets paper: Pfaff et al., “Learning Mesh-Based Simulation with Graph Networks”, ICLR 2021. *arxiv.org/abs/2010.03409
From PDEs to Graphs: A Primer on Physics Simulation and Geometric Deep Learning (Part 1/2) was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.