Tutorial 1: Self-weight column¶
Introduction¶
This quick start tutorial walks through the steps of running your first MPM3S problem.
This tutorial analyses a column deforming under its own weight and solves the static equilibrium equations. It is simple but introduces you to all components of the code: setting up the input file, running the analysis and viewing the output data.
This tutorial has three main sections after the introduction:
Background: the GIMPM¶
This problem introduces you to the MPM3S code, and how it is different to methods such as finite element analysis. The GIMPM can be classed as a fictitious domain method: the mesh and boundary conditions do not necessarily align with the material domain, the body that is being modelled by the material points. This enables the GIMPM to avoid the distorted mesh issues normally associated with finite elements.
The GIMPM broadly works in three steps:

- (a) initial state which loads the material point data on the background mesh
- (b) deforming the mesh and the material points together
- (c) resetting the mesh but not the material points, distorting the body relative to the mesh
Under this framework you define two things: the background mesh on which the equations are solved, through its element size, and the material points - the modelled body, which carries all the material and kinematic data at the Generalised Interpolation Material Points (GIMPs). In MPM3S both are set in the "material points" section of the input file. Boundary conditions (roller or fixed faces) are applied to the nodes of the background mesh, whereas body forces such as gravity are applied to the material points directly.
Input setup¶
Problem summary¶
The aim is to recover the vertical stress field that develops in a column compressed by its own weight, and to compare it against the analytical solution
where \(\rho\) is the density, \(g = 10\) m/s\(^2\) is the acceleration due to gravity, \(L = 50\) m is the initial height of the column and \(z_p\) is the initial height of the material point. Stress is tension positive, so the column is in compression. Because Poisson's ratio is zero and the sides of the column are on rollers, the cross-section does not change and this Cauchy stress calculation is true for any magnitude of deformation.
The column is \(3.125 \times 3.125 \times 50\) m, made of a homogeneous Hencky elastic material with Poisson's ratio \(\nu = 0\) and density \(\rho = 80\) kg/m\(^3\). The Young's modulus is \(E = 10^4\) Pa, which gives a large deformation: the column shortens to under half its height. These are the height, material and gravity of the column example in AMPLE.
The column is divided into 16 elements of \(3.125\) m, each filled with a \(2 \times 2 \times 2\) grid of GIMPs - 128 in total. Gravity is applied gradually over 40 load steps, each solved by a Newton-Raphson scheme.

The simulation is configured through a single JSON object - a human-readable, editable text file. The complete file for this problem can be found here, and every key is described on the input_data.json file format page.
input_data_gravity_column.jsonMachine¶
"GPU": "off"runs the analysis on the CPU, which is plenty for a problem this small (GPU)."domain update": "stretch"lets each GIMP's domain stretch with the material, so the GIMPs shrink as the column is compressed, most near the base (domain update).- It is optional; without it the domains keep their initial size.
Material points¶
- One layer, \(50\) m thick, on a \(3.125 \times 3.125\) m footprint (material points).
"element size"sets the background elements to \(3.125\) m."number of material points per element 1": 2places a \(2 \times 2 \times 2\) grid of GIMPs in each element.- The material is the Hencky elastic model, with the parameters from the Problem summary.
"extra capacity"reserves spare storage for material points created by mesh refinement; there is no refinement here, but the key is still required.
Rigid bodies and contact¶
- There are no rigid bodies, so
"rigid bodies"is an empty list (rigid bodies). - The
"contact"section is still required; its friction coefficient has no effect (contact properties).
Analysis¶
- A single static stage (analysis stages).
"load": "gravity ramp"increases gravity from zero to its full value over the 40 load steps."rigid bodies": "off", as there are none.- Rollers on the four sides (\(x\) and \(y\)
"min"and"max") and a fixed base (boundary conditions). - The top is left free; the
"max"\(z\) face lies at twice the column height, in the empty space above the column, so it never touches the material.
Solver¶
- Newton-Raphson iterations to a tolerance of \(10^{-6}\) in each load step (solver).
- A step that has not converged after 20 iterations is retried with half the load increment.
- The column fills its elements completely, so the ghost stabilisation is switched off, with both ghost factors set to zero.
Output¶
- VTK output, for visualisation in ParaView (or VisIt), is written to
vtk_columnat every load step ("vtk percent": 0), with the displacement, stress, strain and volume of each GIMP (output). - CSV output is written to
csv_column, also at every load step, with each GIMP's initial position, current position and stress - everything needed to compare against the analytical solution. - There are no rigid bodies, so no rigid-body fields are needed.
"output": {
"vtk": "on",
"vtk directory": "vtk_column",
"vtk percent": 0,
"vtk material point fields": ["displacement", "stress", "strain", "volume"],
"csv": "on",
"csv directory": "csv_column",
"csv percent": 0,
"csv material point fields": ["initial position", "position", "stress"],
"csv rigid body fields": []
}
Deploying and running the problem¶
MPM3S is written in the Julia programming language, and there are multiple ways to run the code, all explored on the deployment page. As this is a small problem that runs quickly, this tutorial uses Julia directly; see the installation guide for installing Julia and MPM3S.
Working in the MPM3S folder
Julia runs in the MPM3S folder - the folder you downloaded - throughout this tutorial, and every path in the commands and scripts is relative to it. The input file is read from validation_data_and_jsons/input_data_gravity_column.json, and the output folders vtk_column and csv_column are written to, and read back from, the MPM3S folder.
terminalSetting up and running the problem¶
The input file for this tutorial comes with MPM3S, as validation_data_and_jsons/input_data_gravity_column.json; it is the same file as the one provided here.
Open a terminal and start Julia; -t auto makes every CPU core available:
Then, in Julia, move into the folder where you downloaded MPM3S, activate it, install its dependencies and load MPM3S:
The output folders vtk_column and csv_column are created in the MPM3S folder. The commands work the same on Windows, macOS and Linux. The first time, Pkg.instantiate() downloads and installs MPM3S's dependencies, which can take several minutes; after that it returns straight away (see MPM3S installation). If you are unsure how to open a command/terminal window on your operating system, see Command/terminal window.
$ julia -t auto
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.12.4 (2026-01-06)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org release
|__/ |
julia> cd("path/to/MPM3S")
julia> using Pkg; Pkg.activate(".")
Activating project at `path/to/MPM3S`
julia> Pkg.instantiate()
julia> using MPM3S
Running the problem¶
Julia is now running in the MPM3S folder and MPM3S loaded. The JSON file for this problem is loaded with MPM3S and is stored in the folder validation_data_and_jsons, the simulations are started with:
Reading the output¶
MPM3S prints a single progress line, redrawn in place after every step; in a log file a new line is kept for every whole percent. When the analysis finishes, the line reads:
stage 1/1- the current stage and the number of stages.- the bar and
100.0%- progress through the stage. t 1.0/1.0- the load fraction reached in a static stage (or the time in a dynamic stage), out of its final value.step 41- the step counter. It starts at 1 and counts every converged step of the analysis; it is also the number in the output file names.Δt 0.025- the current increment, here \(1/40\) of the load.NR 3- the Newton-Raphson iterations used by the last step.cuts 0- steps that did not converge and were retried with half the increment.del 0- material points deleted because they became too distorted or isolated.N 201- the number of nodes in the background mesh.
In dynamic analyses a P2G-fail count is added if a velocity projection fails to converge.
Viewing the results¶
The results are written as the simulation runs, so you do not need to wait until it has finished to view them. The VTK files are in vtk_column and the CSV files in csv_column, one file per load step, numbered from 00002 to 00041. The 1 in mps_1_... is the layer number.
Visualising the output in ParaView¶
The output files can be opened in ParaView to inspect the deformed column and the data carried by the GIMPs. Each GIMP is drawn as a box the size of its domain. The walkthrough below opens the GIMP data, colours it by displacement and stress, and shows how the GIMP domains have deformed.
Navigating the 3D view
Once a dataset is rendered you can move the camera with the mouse inside the RenderView:
- Left-click and drag to rotate the view about the focal point.
- Middle-click and drag (or
Shift+left-drag) to pan. - Scroll wheel (or right-click and drag) to zoom in and out.
- Press
Ror use View → Reset Camera to reframe the scene if you get lost.
1. Open ParaView. Launch ParaView from your applications menu or terminal; you should see an empty render view.
2. Open the output files. File → Open and navigate to vtk_column. ParaView groups the numbered files into one series, mps_1_..vtu; select it (1) and click OK (2).
3. Apply the reader. Click Apply (1) in the Properties panel. The column of GIMPs appears at the first load step.
4. Colour the GIMPs by displacement. Change Coloring to displacement (1); the menu beside it shows Magnitude, which for this column is the vertical displacement. At the first load step the displacements are still small.
5. Advance to the final step. Click the Go to Last button (▶|) (1) in the time toolbar, then Rescale to Visible Range (2) in the colour-map toolbar so the colour scale matches the deformed column. The column has shortened from \(50\) m to about \(24\) m, so the top has moved down by about \(26\) m.
6. Colour by vertical stress. Change Coloring to stress (1) and ZZ (2), and rescale (3). The compressive stress increases steadily from zero at the top to its largest value at the base.
7. Look at the GIMP domains. Change the Representation to Surface With Edges (1) and zoom in on the base and the top of the column. With "domain update": "stretch" the GIMPs near the base are squashed to about \(30\%\) of their original height, while those near the top have shortened by only about \(6\%\).
Analysing the stress variation with height¶
csv_column holds one CSV file per load step. The first line of each file is the load fraction, time, and the second line holds the column headers; after that there is one row per GIMP. The final step, mps_1_00041.csv, starts:
time,1.0000000000000004
initial position_x,initial position_y,initial position_z,position_x,position_y,position_z,stress_xx,stress_yy,stress_zz,stress_xy,stress_yz,stress_xz
0.78125,0.78125,0.78125,0.78125,0.78125,0.2403573773453606,0.0,0.0,-38314.3115766303,0.0,0.0,0.0
0.78125,0.78125,2.34375,0.78125,0.78125,0.7210721320360816,0.0,0.0,-38314.311576630294,0.0,0.0,0.0
0.78125,0.78125,3.90625,0.78125,0.78125,1.204539179340215,-1.777267913332324e-12,-1.777267913332324e-12,-37256.332724039145,-0.0,-0.0,-0.0
--- many more rows of data ---
initial position_z is \(z_p\) in the analytical solution, position_z is the GIMP's current height, and stress_zz is the vertical Cauchy stress in Pa.
Floating-point spellings in the raw CSV
Values such as 1.0000000000000004 are the exact binary representation Julia stores for 1.0, the trailing digits of the stresses are floating-point noise, and horizontal stresses such as -1.777267913332324e-12 are zero to round-off.
The short Julia script below plots the stresses from the final step against the analytical solution from the Problem summary. You can run it in the same Julia session straight after the analysis, either by copying it into the REPL or by saving it as plot_stress.jl in the MPM3S folder and running include("plot_stress.jl"). It needs Plots; DelimitedFiles comes with Julia.
To install Plots, once, start Julia and, before activating MPM3S (so that Plots is not added to MPM3S itself), use:
The commands to run the plot are:using DelimitedFiles, Plots
# the final output step of the column; skip the "time" line, then read the header
data, header = readdlm("csv_column/mps_1_00041.csv", ',', Float64; skipstart=1, header=true)
column(name) = data[:, findfirst(==(name), vec(header))]
z0 = column("initial position_z")
szz = column("stress_zz")
# analytical vertical stress
ρ, g, L = 80.0, 10.0, 50.0
σ(z) = -ρ * g * (L - z)
z = range(0.0, L, length=100)
scatter(-szz, z0, label="MPM3S", xlabel="vertical compressive stress (Pa)", ylabel="initial height (m)")
plot!(-σ.(z), z, label="analytical")

The numerical stresses agree with the analytical solution to within 3% of the stress at the base (\(40\) kPa). The differences are largest in the bottom element, where the column is most compressed, and in the top element.
To see how the accuracy depends on the mesh, halve "element size" in Material points to 1.5625 and run the problem again.






