About Nutils

Nutils is an open source project aimed at the creation of a modern, general purpose Python programming library for finite element applications. The project is led by Evalf Computing and is being developed in close collaboration with academia, most notably the Technical University of Eindhoven. Nutils is under active development and is presently in use for both industrial applications and academic research.

Nutils is MIT licenced and is free to use in any application. It is important to understand that Nutils is not a ready to use program. It does not have a user interface and no predetermined functionality. What it is instead is a collection of high level objects that can be mixed, matched and extended to build any specific simulation in the form of a Python script. Knowledge of both computational physics and general programming are required to use Nutils to its potential.

To illustrate the workflow, the following fully functional script solves the Laplace problem ∬ ∇v·∇u = ∫ v f on a square domain with mixed Dirichlet and Neumann boundary conditions, using quadratic spline basis functions and and 8x8 computational grid. The result is as shown in the figure.

from nutils import mesh, function, solver, plot

domain, geom = mesh.rectilinear([8, 8])

# create namespace
ns = function.Namespace()
ns.x = geom
ns.basis = domain.basis('spline', degree=2)
ns.u = 'basis_n ?dofs_n'

# construct residual
res = domain.integral('-basis_n,i u_,i' @ ns, geometry=ns.x, degree=2)
res += domain.boundary['right'].integral('basis_n' @ ns, geometry=ns.x, degree=2)

# construct dirichlet constraints
sqr = domain.boundary['bottom'].integral('u^2' @ ns, geometry=ns.x, degree=4)
cons = solver.optimize('dofs', sqr, droptol=1e-15)

# find dofs such that res == 0
dofs = solver.solve_linear('dofs', res, constrain=cons)

# plot solution
x, u = domain.elem_eval([ns.x, ns.u], ischeme='bezier9', arguments=dict(dofs=dofs), separate=True)
with plot.PyPlot('solution') as plt:
  plt.mesh(x, u, cmap='jet')

More elaborate examples including demonstrations of isogeometric analysis, the finite cell method, and goal based adaptivity can be found in the examples directory of the code repository. Installation instructions as well as full API documentation (in progress) can be found at docs.nutils.org.

For more information contact info@nutils.org.