Brooks (brooksmoses) wrote,

  • Mood:

Today's work, roughly speaking....

  • Writing 285 lines of C++ code and comments, largely by copy-and-paste: 1 hour.
  • Figuring out which code to copy-and-paste: 8 hours.
All in all, it was a pretty good day's work, I'd say. I'm having all sorts of fun learning to work with ill-documented code libraries that are way bigger than I have time to understand completely -- which is, in part, what this is all about; up until now, most of my coding has involved only things I've written myself, and the experience is worth having.

What I'm writing, incidentally, is a convertor to load in data files in the format that this C++ library creates them in, and then write them back out in a format that my own postprocessing programs -- which will mostly be written in Fortran -- can read them in. This is made extra complicated by the fact that they're being read in as unstructured meshes (which means that every cell on the data grid is treated independently), and then written out as a structured mesh (which means the cells are ordered on a cartesian grid, in this case). Thus, I not only have to load the data files, but I also have to load the input file that was used by the program that initially created the unstructured mesh, so as to figure out what shape the cartesian grid should be. This took a fair bit of work to figure out what the mesh-creation program was doing, so as to separate out the parts of it that loaded its input file from the parts that deleted the existing unstructured mesh files in preparation for recreating them; that's where at least half of the figuring-out -- including a lot of erroneous copying-and-pasting of code -- came from.

So, what I accomplished today was the half of this convertor that reads in the data and input files. Tomorrow is other projects, and then Thursday I work on the output half -- a task for which I have relatively few high-level library functions to assist with, which I'm sure will be both useful and troublesome.
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded