## Sample codes

These are codes that demonstrate basic methods in computational mechanics.

Note to prospective students: These sample codes are simple implementations of basic methods. Any students interested in experimenting with these codes or expanding their capabilities are exactly the type of students that are a good fit for this research group. ### 2D finite element code in Python

This code demonstrates a simple 2D plane strain finite element code in Python using both numpy and matplotlib. The global stiffness matrix is stored in full format (i.e. not sparse). Interested students can try to convert to a sparse format via scipy.sparse. ### Matlab code for quadtree mesh with hanging nodes

This code demonstrates static condensation degrees of freedom to enforce compatibility in a mesh with hanging nodes. A simple patch test demonstrates that compatibility is enforced. ### Matlab code for 1D bridging domain method

MAE 598 Student Project: David Chao, spring 2012

This code demonstrates the bridging domain method in 1D with both consistent Lagrange multiplier constraints and diagonalized constraint equations. The diagonalized version damps some of the high frequency energy at the coupling interface. ### Matlab xfem example

This code demonstrates a strong discontinuity within a total Lagrangian explicit extended finite element formulation. In the simulation, a velocity boundary condition is applied to a bimaterial strip, where there is no cohesive interaction between the two materials.

## Mesh generators for MATLAB

Simple codes for creating meshes in MATLAB. ### 2D uniform mesh generator

This MATLAB function generates a 2D finite element mesh in MATLAB. You can generate a plot with commands like
m = uniform_mesh(5, 6, 5.0, 5.0);
p.vertices = m.x';
p.faces = m.connectivity';
p.facecolor = 'w';
patch(p) 