My source code is available for several projects. These are primarily codes that I have written in order to better understand an algorithm or technique. I hope they can help you do the same. If you would like a copy of any of the codes below, you can access the source code at my public Bitbucket page.

All code is licensed under the Academic Free License ("AFL") v3.0. Code is provided as is, without warranty or support. However, I encourage you to modify the code and to contact me with revisions and any bug-fixes.

Projects Currently Available:

Explicit FEM with XFEM

A Matlab implementation of the two-dimensional explicit-dynamics finite element method which uses the Extended Finite Element Method (XFEM) to model discontinuities. The code is very cleanly organized and well-commented. The code also now supports XFEM with an implicit FEM solver. To download the source-code, go here.

Sample output. Red is the undeformed mesh/crack. Dashed blue shows XFEM crack surfaces.

Graphical User Interface. Click for full-size.

  • Choice of implicit or explicit solver.
  • Includes several choices of mass lumping techniques, chosen at runtime.
  • Properly integrates enriched elements using subcell quadrature.
  • Uses shifted enrichment functions to eliminate the need for blending elements.
  • Discontinuities (cracks) are defined using levelsets.
  • Support for multiple (non-intersecting) discontinuities.
  • Reads meshes in ABAQUS .inp format. These can also be created with CUBIT.
  • Plots deformed mesh live as the simulation progresses.
  • Plots XFEM crack surfaces.
  • Includes several meshes and sample inputs, everything needed to run.

Sample output from the implicit solver.

Note: because of the nature of my research, crack-tip elements are not implemented. The code is easily extensible, if you implement them please email me your revisions!

Bridging Domain Method for Composite Lattices

A Matlab implementation of the Bridging Domain Method (BDM) in 1 dimension. Mostly written by Jifeng Zhao, with cleanup and bug-fixes by Philip Moseley. To download the source-code, go here.

Sample output.

  • Supports composite lattices.
  • Live output of energies and displacements.

Drucker-Prager Plasticity Model

For full details and sample output, see the post here.

A Matlab code for modeling pressure-dependent materials such as soil or concrete. The code uses the Drucker-Prager smoothed approximation to the Mohr-Coulomb plasticity model. The Drucker-Prager material model is non-linear, so it is integrated with an iterative scheme. To download the source-code, go here.

Plane strain loading, deviatoric stress vs. deviatoric strain.

Levelset Image Segmentation

For full details and sample output, see the post here.

Levelsets implemented in C++, with both explicit and semi-implicit solution methods. The semi-implicit solution is calculated using Intel's Math Kernel Library (MKL) Helmholtz solver in two dimensions. Spatial derivatives are solved using central differences. To download the source-code, go here.

The Fast Marching Method (FMM) is also implemented in the code, but unused for this specific application.

Implicit solution, 250 steps, λ=5.0, ν=3.0, Δτ=40.0, μ=0.01