CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Help~~~~How to read a program as a fresh man? (https://www.cfd-online.com/Forums/main/90285-help-how-read-program-fresh-man.html)

SingleMinded July 6, 2011 09:08

Help~~~~How to read a program as a fresh man?
 
Hi,I'am a fresh man of CFD.Now,I'am reading a program about Euler solver,which employs the usual form like Roe scheme and explict scheme.However,it became a huge problem that the program is TOO LARGE and COMPLEX than I learned before.SO,how to read it in an appropriate method?
Thank you very much.

julien.decharentenay July 6, 2011 20:40

Getting into someone else program is always a bit of a nightmare - specially if the documentation is sparse. Here is what I would try:

1) Try to get an automated tool to create documentation from the file structure (doxygen for example or whatever is appropriate for the programming language used);
2) Try to load the code into a suitable IDE (netbeans for example);
3) Try to get the overall idea of the algorithm (and function) involved by starting from the main subroutine/function;
4) Use your previous experience and hang to thread of codes you recognize.

Keep trying: If you look at it long and hard enough (and keep documenting as you go along), you will get to understand it.

Tip: use function names (that usually relates to what the subroutine does), but beware that sometimes the function names may be misleading (i.e. the developer changed its mind and the algorithm halfway through but did not bother to change the name)

Regards,
Julien

SingleMinded July 6, 2011 22:25

Thank you very much.What you write was very concrete and helpful.
I would try your advice .
Good luck~~

andy_ July 7, 2011 08:10

Quote:

Originally Posted by SingleMinded (Post 314927)
However,it became a huge problem that the program is TOO LARGE and COMPLEX than I learned before.SO,how to read it in an appropriate method?

As usual with a large task, and mastering a full CFD code for the first time is a large task, preparation is going to help. The most useful preparation in my experience is to make sure you have all the mathematical methods written down in front of you and that you understand how they work before looking at the code.

SingleMinded July 7, 2011 08:18

ok,thank you.


All times are GMT -4. The time now is 13:16.