NACA Airfoils Code - Convert Fortran to C++BRL-CAD
Status: ClosedTime to complete: 100 hrs Mentors: Gauravjeet Singh, Ch3ckTags: c, code, c++, airfoils, transcoding, translation, fortran

The NACA airfoils are airplane wing shapes developed by the National Advisory Committee for Aeronautics (NACA). These shapes are described by a series of digits, which are translated into actual shapes by a series of computer programs. These programs date back several decades, and were written in Fortran.

BRL-CAD's interest in this code is as a possible means of procedurally generating wing geometry in BRL-CAD models, but we would prefer to have the shape generating logic in one of BRL-CAD's standard languages - C or C++. The target code for this effort is a modernization of older NACA codes by Ralph Carmichael called naca456.

The initial conversion will attempt to precisely reproduce the functionality as currently expressed in the Fortran code - any more elaborate reworking of the logic will be evaluated after we have a C/C++ version that reproduces the Fortran outputs correctly.

Your task involves converting the file https://github.com/starseeker/naca/blob/master/splprocs.f90 to C++.

  1. Check out the git repository: git clone https://github.com/starseeker/naca
  2. Make sure you can build the stub files that are there (cd naca; mkdir build; cd build; cmake ..; make)
  3. Translate the logic in splprocs.f90 into splprocs.cxx
  4. Make sure the code compiles (it will not be expected to do anything at this stage.)
  5. Submit the new .cxx file. (If you are comfortable doing so, you can fork the project on github, do your work in the fork, and submit a github pull request instead - either approach is fine.)

You'll want to make sure to preserve any comments that contain useful information from the Fortran sources, as well as the actual logic. If you're successful, there will be follow-on tasks building on this one to complete the conversion of the other files in naca456.

References:
  • http://www.pdas.com/naca456.html
  • https://github.com/starseeker/naca
Uploaded Work
File name/URLFile sizeDate submitted
task-10-naca-airfoils-1.diff15.7 KBDecember 07 2014 04:40 UTC
task-10-naca-airfoils-1.diff15.4 KBDecember 07 2014 14:22 UTC
Comments
Andromeda Galaxyon December 7 2014 04:34 UTCTask Claimed

I would like to work on this task.

Sean on December 7 2014 04:39 UTCTask Assigned

This task has been assigned to Andromeda Galaxy. You have 100 hours to complete this task, good luck!

Andromeda Galaxyon December 7 2014 05:51 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 7 2014 07:36 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Sean on December 7 2014 07:43 UTCminor issues

If you run "make regress", I believe you'll find that your changes will fail.  You should not include any system headers before common.h (we have a regression test that checks exactly this).  The order is common then system then library then local.  If there's an interface header, it should be first and can be the only header.


Besides the header, the Doxygen comment comes before the wrong function.  It should be listed before EvaluateCubicAndDerivs as the @param lines refer to the function that follows.  You can/could have left it that way if that's how it was listed in the Fortran you transcoded, but then it shouldn't have been a Doxygen-marked comment.


The rest I'm going to take for granted. ;)


 

Andromeda Galaxyon December 7 2014 14:22 UTCReady for review

The work on this task is ready to be reviewed.

Popescu Andrei on December 7 2014 16:05 UTC

Patch applies fine. Based on Sean's comment above, I m going to close the patch. Well done!


Andrei

Popescu Andrei on December 7 2014 16:05 UTCTask Closed

Congratulations, this task has been completed successfully.