# Learning c++ for math, CFD, etc.

1. Mar 1, 2016

### Mech2013

When I took such courses I suffered due to the fact that I could not code/program. My friends and professors knew how to make 1-D or 2-D grids for heat transfer problems, writing calculus formulas and differential equations in code. How can I learn this? I already know how to solve these problems by hand. Which books are recommended to learn to write in c++ something such as a grid based on nodes in a generic CFD problem for 1D or 2D steady state heat conduction of (for example) a steel rod or something simple like writing the definite integral of f(x)dx from 3 to 5 when f(x) = x^2. Are there any texts out there that teach you how to translate math/physics problems to c++ or making a grid for a CFD problem in c++?

2. Mar 1, 2016

3. Mar 3, 2016

### NumericalFEA

Since you are interested in learning scientific programming in C++ on the truly professional level, you might consider the following book that is dealing with programming of problems related to stress analysis of shells (a very common engineering problem):

The book contains all relevant mathematics and the complete source codes implementing the algorithms described in the book. (The book is available on Amazon:
https://www.amazon.com/Computational-Geometry-Surfaces-Application-Analysis/dp/0646930818 )

Hope this helps.

4. Mar 3, 2016

5. Mar 3, 2016

### Mech2013

This is good. I took three finite element courses, but we used matlab and my professor always had to help me code. I always wanted to learn FEA in c++ instead. The price is a bit too extravagant though. I can easily afford it, but still. I'll wait until I have fully understood the basics of c++ before buying it. Thanks for the suggestion.

6. Mar 4, 2016

### NumericalFEA

Certainly, you are welcome (I think the price is set due to the size of the codes provided on the CD supplied with the book).
Actually, there is a number of books on Amazon covering general topics like "C++ for scientists and engineers", "numerical methods in C++", etc.; you might search for a suitable book just using those keywords. Hopefully you will find one that suits your interests.