Programming project

You are required to do task 1-3 of the programming project on this page, and choose a task 4 of your own choice. The deadline for submission of the written report is 22nd November and you are required to hand in a written report as well as a short (~10min) presentation. The presentation will be in H1 on Friday 25th November from 10:15 to 13:15

Presentations will be held in the following order:

  • Ruben Bø and Lars Odsæter
  • Elisabeth Prestegård and Lars Dahle
  • Elisabeth Solheim
  • Cecilia Halmøy
  • Amund Hov
  • Tore Sivertsen Bergslid
  • Jakub Both and Sebastian Kraemer
  • Geir Fiksdal and Espen Graff Berglie
  • Jørgen Endal and Stein-Olav Davidsen
  • Kjersti Hatleid, Malika Zaroil and Ingvild Amaliksen
  • Stian Kristoffersen and Bjørn Theisen
  • Turid S. Solberg and Krstin Hornæs
  • Mathias F. Tjomsland

If your name is not on the list, please contact the teaching assistant to make sure that your project has been handed in


  • 24.11: Presentation order is available
  • 21.11: In the written report, set up the name of the group members, but not the student or candidate number.
  • 11.11: The deadline for the written report is moved to Tuesday 22.11. Kjetil will be away 16.-17. November and is not able to answer any questions during this time
  • 10.11: I will be collecting minecraft results to create a summary (see below)
  • 04.11: Updated the problem set where I fixed all errata issues and hopefully all reprecussions
  • 28.10: Errata section added
  • 20.10: Minecraft map-converter available for downloading


  • What I really ment to say about equation (10) is that it is epsilon_xy = 2*(1+nu)/E sigma_xy (mult by 2)
  • Equation (11) should have -f as the right hand side, not f (add minus-sign)
  • Equation (10) should read sigma_xy = 2*(1-nu)/E epsilon_xy (mult by 2)
  • Equation (5) should read Mdu/dt = -Au (add minus-sign)
  • The specific heat capacity is 3 973 J/kg K (mult. by 1000)

Notice that some of these changes may have reprecussions on other equations, but I trust that these are clear.

Problem set



GLview is a post-processing program designed for visualization of finite element results. It is a commercial project, but as a NTNU student you have access to it through progdist. It comes in a lightweight version, GLview Express, and a full version GLview Inova. To view the demo above you will have to install the latter. To get the results shown in the introduction do the following

  • double click "mode shape" on the upper left menu
  • move the "Time" slider on the upper left menu to 8
  • set current displacement to "relative scaling" in the lower left menu
  • in the "animation" tab, click "mode shape animation setup" and just press OK when the pop-up menu comes

Note that the "time" slider in step 2 is a misleading name as it really is the eigenvalues and not related to time whatsoever. The first time is just bogus output followed by 6 zero eigenvalues (10^-7 is assumed to be numerical zero). All eigenvalues above 8 are nonzero ones and display true eigenmodes of the geometry/material choice. Play around with the different ones to get a feeling on how they look like.

If you like, it is entirely possible to write your own GLview result files. It is possible to do this with pure ASCII files as long as you follow a fairly simple structure. More information on this may come if there is any interest in doing this. Note that this is optional and you may choose to use Matlab for all parts of your implementation and visualization if you are more comfortable with this.


An optional way of generating your mesh files is to read this from the computergame Minecraft. In the resource section you will find a small program to extract all necessary data from the minecraft region files.


This program may contain bugs and may not compile or run on all machine architectures. The precompiled version is done on my 64bit ubuntu computer. If you need to compile it yourself then this depends on the boost library as well as zlib and these needs to be installed. If all is installed properly the command 'make' should compile it without errors.

The ubuntu machines at "Nullrommet" have both zlib and boost already installed, so all you need to do to get it compiling is to swap the include line (see "Use" below) and run 'make'.


The data is given as hexahedrals. This is not what you have been implemented so far and there is two fixes for this. Either you convert all hexahedral elements into tetrahedrons or you modify your assembly routine to support hexahedral elements. Each minecraft block is split into 8 finite element cubes, where slabs, stairs and doors will not generate all 8. All elements are identified with 10 numbers, the eight corner nodes followed by Block Id's and possible some nonzero meta data as well. Note that there exists several decorative blocks as well such as torches, paintings, buttons, levers, fences, redstone etc. Some (but by no means all of them) are filtered out. If you get strange blocks that you don't feel should be there make sure that it is not filled with some decorative block (default is that ALL blocks generate the full 8 finite elements). A complete list of all block id tagged as decorative is found in "decompress_minecraft_map_file.cpp" at the IS_DECORATIVE macro on top.


First of all you will need to change the line

#include <boost/iostreams/filter/zlib.hpp>


#include "/home/birkeland/kjetijo/Minecraft/boost/iostreams/filter/zlib.hpp"

where swap out the install address "/home/birkeland/kjetijo/Minecraft/" with what is appropriate for your installation. Then:

  • Start minecraft and press F3 to see the world coordinates.
  • Put your minecraft "region" folder in the same folder as the program
  • Run 'make' to compile the program.
  • Run './decomress_minecraft_map_file xmin xmax ymin ymax zmin zmax', where xmin,xmax,… are parameters to the bounding box you are requesting.

The program should dump 3 files, "nodes.m", "elements.m" and "minecraft_blocks.vtf". The last one is a GLview file which can be used for verifications that your extracted data is correct


I figured that Markus Persson would probably be interested in learning that his game is being used as a teaching tool at university-level, and with respect to this I will be putting together a summary of the results produced. If you like to join in, you could choose a handful of result pictures or (youtube) videos and mail them to me. I'll make sure that you are credited with full name (unless you dont want to of course). Incidentaly, MineCon starts on the finish-deadline of this project…


  • Kjetil A. Johannessen
  • Mail: kjetijo (at)
  • Office: Room 652, Central Building II
  • Contact hours: Not 16.-17. November
2011-11-24, kjetijo