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, plot

# prepare domain, geometry, basis
domain, geom = mesh.rectilinear( [range(9),range(9)] )
basis = domain.basis( 'spline', degree=2 )

# construct matrix, right hand side, constraints
matrix = domain.integrate( basis['i,k'] * basis['j,k'], geometry=geom, ischeme='gauss2' )
rhs = domain.boundary['right'].integrate( basis, geometry=geom, ischeme='gauss2' )
con = domain.boundary['bottom'].project( 0, onto=basis, geometry=geom, ischeme='gauss2' )

# solve system
lhs = matrix.solve( rhs, constrain=con )
sol = basis.dot( lhs )

# plot solution
points, colors = domain.elem_eval( [geom, sol], ischeme='bezier9', separate=True )
with plot.PyPlot( 'solution' ) as plt:
  plt.mesh( points, colors )
  plt.colorbar()

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.