I'm currently working on this project and I have a basic structural analyzer that uses the finite element method. Essentially, I turn each block into a set of trusses, construct a stiffness matrix relating each truss's force to each other, and feed it into Matlab.
The next task is for me to speed it up, ideally by using some GPU acceleration. Since Matlab does not yet support spare matrix computations in the GPU, I'm looking into the other libraries available. One approach I'm considering taking is to use CULA Sparse's solvers to speed things up. But there are also a multitude of finite element software packages that may do a better job, and save me the performance overhead of constructing matrices and retrieving results.
What I'm wondering is, which of these finite element software packages is right for me? That's a hard question, so here are a few qualifiers, in order of importance:
- It's part of a program, so a library is preferred over a complete modelling package.
- Established and well-documented
- GPU acceleration
- It should quickly compute results for relatively small data sets (solve a 10,000 element system in about a second)
- The price for a student should be under $300.
- An interface in both Java and C.
Does anyone have a recommendation? Or would it be better to go forward with my CULA idea?
Edit: Jed Brown requested that I give the computation I'm making in more detail. I am not a civil engineer, but I spoke with one about the possibility of a making a structural analysis system that would look and feel good. I already have a prototype. Here's how it works.
- Within the setting of a game like Minecraft, a subroutine targets some contiguous region of blocks R to be tested. The program creates a truss mesh out of the region of blocks, and assigns a weight to each node in the mesh (based on how heavy the blocks would be). There are base nodes bordering the region.
- From this mesh, the program makes a wide stiffness matrix T and a weight vector w. From there, it needs to solve the equation Tf = w, where f, the unknown, is a vector indicating the forces exerted by each truss and base node. In other words, a row of T dictates how the truss and base forces add up to counteract the weights of the nodes.
- Currently, my program solves this by solving the equation TT'u=b using a conjugate gradient solver, then getting f = T'u.
- Once I have the forces on each of the trusses, I can determine which blocks break under the strain. Rather than using a detailed deformation model, I just have each block if one of its comprising trusses exerts a force beyond a threshold.
Because my structural analysis system is to be used in a game, and not a serious engineering context, speed is much more important than accuracy. A lot of the work in making this will consist of tweaking variables in order to give the game a good feel.