Programming Project

Resources by Kjetil André Johannessen for TMA4220.

Resources

  • Grids - Mesh generation files required for first project
  • WriteVTF - Write function for GLview native file format (.vtf)
  • shell.m - Required for mesh generation in first project
  • getplate.m - Used in some of the second project options

There follows of collection of resources related to computational geometries:

GMSH

Some students may find this free mesh generator/processor useful, available at gmsh. Tutorials etc. can be found on the site. For those wishing to use meshes created in this manner, the following cleanup scripts may be useful:

In addition, there is a gmsh to Matlab mesh converter: msh2m.cpp

You may compile the GMSH to Matlab converter (in Linux) by typing

g++ msh2m.cpp -o msh2m

and use this by typing

msh2m myGeometry.msh myMatlab

which will read the file myGeometry.msh and write the following files

  • myMatlab_pts.m
  • myMatlab_lines.m
  • myMatlab_tri.m
  • myMatlab_tetr.m
  • myMatlab_nodes.m

containing respectively all points specified, lines, triangles, tetrahedrons and nodal coordinates. For 2D examples, your elements would be in myMatlab_tri.m, the boundary elements in myMatlab_lines.m and the nodal coordinates in myMatlab_nodes.m

Minecraft

A simpler way of creating meshes is to build a structure on our dedicated minecraft server, and then convert this to a matlab triangulation by the supplied scripts. See minecraft.math.ntnu.no

Be aware that there may be some interruptions/irregularities in the server this week (16.10) as it is brought to life again!

Geometries

Here is a handful of sample geometries which you may download and play around with for your project. You may choose to use any of these in your final submission, or create your own.

Princess Cake

This is the geometry of the skirt for the princess cake. The volumetric tetrahedrals are seperated into two parts: those of the cake dough and those for the metal tube in the middle.

King & Queen

King and Queen chess pieces.

Heart

Need something to warm your heart? Why not try the finite element method?

Beef

Cooking a piece of steak.

Cheese

A piece of swiss cheese. More food geometry for those doing heat equations or do you envision doing something else with it?

Dragon

Volumetric mesh from Stanford 3D Scanning repository

Solid ball

This is simply the unit ball as in problem set part 1. The difference is that this is created in GMSH, and may be easier to alter for your own creations. Note that the actual triangulation returned will be different from the getSphere.m matlab script.

Apple-pen

I got a pen… I got an apple… Apple-pen!

2018-11-02, aurelila