Hello all,
Back in university I wrote a flow solver as part of a graduate CFD (computational fluids dynamics) course. This was written in Fortran 90 on a Linux machine, I forget what compiler I used. It is simple main program that utilizes several subroutines (one to allocate the memory, another to create the mesh of control volumes, another to initialize the variables, calculate divergence, etc..). It was nicely modular, but it still had some bugs.
I want to resurrect this code and rewrite it in C++. I am trying to learn C++ and the class structure is giving me fits - every 'explanation' I read is thoroughly non-intuitive and I am left more confused. I have written modules for Orbiter by religiously copying everything in the SDK manual, but this is my first unguided foray into trying to make a C++ console app (it just needs to read some inputs from a file, run some calculations, and write out a data file, graphics and GUIs are not needed).
I *think* the way to go is to translate the subroutines into C++ code into individual header files, and then call them from a main cpp code (class?). Can anyone put me on the right path? I get along OK with the C++ language (formulas and such), it really is just the class structure and related code relating base and main classes and headers that I can't get straight in my head.
I am using MS Visual C++ 2008 Express Edition if that helps.
Back in university I wrote a flow solver as part of a graduate CFD (computational fluids dynamics) course. This was written in Fortran 90 on a Linux machine, I forget what compiler I used. It is simple main program that utilizes several subroutines (one to allocate the memory, another to create the mesh of control volumes, another to initialize the variables, calculate divergence, etc..). It was nicely modular, but it still had some bugs.
I want to resurrect this code and rewrite it in C++. I am trying to learn C++ and the class structure is giving me fits - every 'explanation' I read is thoroughly non-intuitive and I am left more confused. I have written modules for Orbiter by religiously copying everything in the SDK manual, but this is my first unguided foray into trying to make a C++ console app (it just needs to read some inputs from a file, run some calculations, and write out a data file, graphics and GUIs are not needed).
I *think* the way to go is to translate the subroutines into C++ code into individual header files, and then call them from a main cpp code (class?). Can anyone put me on the right path? I get along OK with the C++ language (formulas and such), it really is just the class structure and related code relating base and main classes and headers that I can't get straight in my head.
I am using MS Visual C++ 2008 Express Edition if that helps.