Archive for Computing

How to compile CFAST on Mac OS X and Linux

The Consolidated Model of Fire and Smoke Transport (CFAST) model is a two-zone fire model developed by NIST. From the NIST website, you can download the Windows version of CFAST, which includes a graphical user interface frontend (CEdit) for the creation and execution of CFAST cases. However, there are no downloadable CFAST binaries or user interfaces for the Mac and Linux platforms; you must compile CFAST yourself.

This guide will help you compile the CFAST executable on Mac OS X and Linux. This is useful for running CFAST cases on Mac or Linux machines, which is especially useful for scripting CFAST runs for optimization problems or running CFAST on a large number of cases in batch mode.

You will need the Intel Fortran compilers (ifort) and a copy of the CFAST source code from the CFAST Google Code site. You can try to use other free compilers, but I find that the Intel compilers are the most compatible and produce the most optimized (fastest) binaries. Note: there are heavily discounted Intel compilers for students.

To download the CFAST source code, the easiest way is to install subversion on your Mac or Linux machine and issue the following command:

svn co http://cfast.googlecode.com/svn/trunk/ cfast

Once you have the CFAST source code on your machine, you can perform the following steps to compile the CFAST executable.

1. In the cfast/CFAST/ directory, edit the makefile_linux file and make the following changes:

  • Replace ‘radation’ with ‘radiation’; this is a typo
  • Add ‘cyl_conduct.o’, ‘datamodules.o’, and ‘ssHeaders.f’ to the obj_serial section
  • Add the following lines to the Object Dependencies section:
    • cyl_conduct.o : cyl_conduct.f
    • datamodules.o : datamodules.f90
    • ssHeaders.o : ssHeaders.f
  • Add ‘cyl_conduct.f’, ‘datamodules.f90′, and ‘ssHeaders.f’ to the cfast.o line

Note: The corrected makefile can also be downloaded from here.

2. Copy datamodules.f90 from the cfast/CFAST/Include/ directory to the cfast/CFAST/Source/ directory

3. Change to the cfast/CFAST/Source/ directory

4. Run the command ‘ifort -c datamodules.f90′ to compile the datamodules and iofiles modules

5. Finally, run the command ‘make -f ../makefile_linux intel_osx_64’ to build CFAST

5b. If you are running Linux, the command is ‘make -f ../makefile_linux intel_linux’

Using these steps, I was able to build CFAST on an Intel Macbook Pro running 10.6 (Snow Leopard) as well as a Linux machine running CentOS release 5.6 with the 64-bit Intel Fortran Compiler version 12.0.4.184.

With your new CFAST executable file (cfast_osx_intel_64), you can run a CFAST case using the following syntax:

./cfast_osx_intel_64 casename

where casename is the name of your CFAST casename.in file (notice the .in file extension is omitted from the command).
Happy modeling!

Leave a comment »


Plotting data on videos – A useful way to convey qualitative and quantitive information

flameheight_boxscale_cb_rad1



Every once in a while, someone makes an impression on you that lasts for a lifetime. It sticks with you every single time. This is one of those, although a bit on the nerdy side, it is one that can change the way you present information in a very meaningful way.

I was once sitting at the NIST annual fire conference, going about my business, and someone working on a project regarding the structural response aspect of buildings on fire showed a video in their presentation. No big deal, right? Normally, we get cool fire videos, then some plots, and so on. Sometimes the plots are interesting, sometimes they are default from Excel with the ugly legend and all – with no story to tell.

But not this guy. He showed a video with real-time plots superimposed over the video showing the exact real-time structural response of the structure overlaid on the video in a plot. “AMAZING!” I thought. And it stuck with me. A useful way to convey synchronous information. People love videos, why not tell the qualitative AND quantitative story at the same time?

So I started working in grad. school on fire problems, and naturally, soon thereafter, I was scheduled to give a presentation. As most of my real creative coding and writing work happens of hours between the hours of 1 AM and 6 AM, I wanted to make this happen. I REALLY wanted some real-time plotting action in my presentation. No Excel templates for me! So I stayed up for a couple nights and worked on a way to use MATLAB to make this plotting dream a reality: I worked on importing videos, messing with frame rates, tons of images, and so forth. And soon thereafter, it happened. I had a working script.

I used it to show plots of large-scale fire tests with actual and predicted flame heights vs. time as seen here:

You need to a flashplayer enabled browser to view this YouTube video



And I used the script to show the predicted flame heights on a small-scale test in an amazing way that just about anyone can relate to, fire-crazed scientist or not:

You need to a flashplayer enabled browser to view this YouTube video



From anyone who has seen the videos firsthand, the response has been amazing. This is a great teaching and communication tool, and surprisingly enough, I haven’t found any existing program or tool that does this. And so I am sharing the videos and script here for anyone to use to better convey information.

My next steps are: 1) to convert the script to Python (since I am now almost exclusively using Python+numpy+scipy for my graduate research and daily work instead of MATLAB, and 2) to make the script into a cross-platform and easy to use tool.

I’m providing the code in its raw and uncommented and unedited form. It generates a number of images with plots superimposed on them, and then it is trivial to use a program to stitch them together into a video. I used Quicktime’s built in method. Sorry, too much current work going on finishing my MS thesis and Master’s degree to clean up the code, but it’s a brutal use of the “release early, release often” ideal! Hopefully someone can make some use of it.

So, here are the linked .m files:

http://www.koverholt.com/scripts/ssPlotVideo.m
http://www.koverholt.com/scripts/fireplotVideo.m

Enjoy! And please leave your comments or ideas!

Comments (1) »


How to remove yourself and your thoughts from this world

“… and television on all over the place is leading to a steady dumbing
down of the American public and a corrosion of basic critical thinking in the population.”

- Jamie Raskin, American University law professor, November 2004 on the Democracy Now! radio program


Flickr user sandymichelle


Just this past Sunday I had to kill my television – in the best sense of the word. You know: denounce, unrecognize, and the such. It was really stealing away any free (and productive) time that I had. I mean, the idle brain cells spin out of control and zoning out in front of TV after a long day of work leads to: not caring about what you eat, not thinking critically about other great things in the world, not spending ol’ fashioned time with your family or friends. (Lots of great, original articles about Killing Your TV)

I remember about 4 years ago when I came across a similar “Turn Off Your TV” site online in the form of a podcast. And the 2 people were talking on and on about trans fatty acids. I was so compelled as to what they were saying I remember typing as fast as I could to take notes and replaying parts and looking up health terms and the such. Learning. Critical thinking. Sharing. I went on to write an article in the paper at my school and was excitedly telling everyone about my findings. I continued to look up more and more information – I was addicted to knowledge. Just a few minutes ago, I just finished my meal of baked chicken, couscous, and black bean soup with tomatoes, onions, bell peppers, and garlic. And I know that most of that motivation to eat healthy as I do today came from that little audio finding 4 years back. Now it allows me, 4 years later, a chance for me to just sit and enjoy a meal – in peace and quiet – and experience the flavors of life one by one. Hmm, there was life before TV.

I kept running past the idea that parents talk to their kids about 28 minutes a day while the average adult watches 2.5 hours of television per day. Hmm. What are we doing to ourselves? Now, I’m not being anti-fun here, entertainment is great, and I make it through most of my day with a humorous outlook on life. But I see people ignoring food as they eat, sitting silently among family or friends, just gazing. Paying lots of money – to be advertised to constantly and have this machine suck away brain cells.


Flickr user janz87


I also came across someone who said – if aliens came to visit us and checked out the layout of our homes, they would think the television is some sort of god of ours, as our entire houses are arranged around the careful placement of the television set. And then comes the arguments about using a DVR to save time. Of course, it is better than just mindlessly watching channels and surfing without barriers, but there are other ways to go about getting your fix without paying a crapload (ahem). But I can think of many better things to do anyway! I don’t think you’ll lose sleep at night or have regrets on your deathbed – just wondering and wishing that you you had watched more TV.


Flickr user chrisdonia


On another note, it is awesome to see change and progress going on all around the world, from the recent election all the way down to the small world of fire protection engineering. Every time I watch one of the videos about technology and change in this era – I get all giddy and warm on the inside. It’s true.

There’s a giant conversation going on. And it doesn’t depend on power or money or anything. Just a passion – a want. I think of how one person that I know revamped and forever changed the world of fire modeling by utilizing a couple of free tools to bring together thousands of users who were all previously working in dark corners. I think of how a few scratches I made on a notebook one night turned into a tool that hundreds of fire model users use every week – and I think of the next step, and the next, constantly progressing. I think of those that are “too busy” to participate in this movement and think this is only for nerds and computer people – and how bad I want them to participate.

I came to the conclusion that the two ideas I speak about here are interrelated. Apathy and social sloth. Here’s what I think: no one is any more busy than anyone else. Some of us just want something more strongly than others. And that used to be okay, praised even – when the dark corners were predominant. But now, everything is public – the world pushes upon itself.

Don’t be “too busy” watching TV or sitting out on this big movement – wherever you are or whoever you are. This is big. Join in anytime.

Comments (2) »