Snapshots

a string to connect pieces of my life

Thursday, March 13, 2008

debugging

Warning: this post is going to be very nerdy.

I have been learning Computational Fluid Dynamics (CFD) using C language. And since last Friday, I have been strugging with the same problem. It was a very simple problem, but the results just didn't come out right, no matter how I modified my code.

This afternoon I read the code for the hundredth time. There it was! A huge bug! I was super excited about it. However, after I fixed the bug, the results didn't show much difference.

About ten minutes ago, I found another mistake. I am now confident (and pray) this is what has been crewing me up. It is rather simple, or even silly. See, in C program, you have to define the type of a parameter. And parameters of different types should not interract with each other without conversion. Yeah, it is very much like marriage between different religions.

Anywho, I happened to use "1/2" instead of "0.5" in some of the equations. So the program decided a lot of zeroes to my precious parameters. Ha!

I hope now it is satisfied.

1 Comments:

At 9:06 AM, Anonymous Anonymous said...

hehe, big progress! Congs!

 

Post a Comment

<< Home