Engineering and Scientific C++: a good, domain-specific, introduction to programming in C++. A bit dated in language details, but the overall approach hasn't aged.
I suggest that you read through the SO answers to questions such as 'How should I design a large C++ program ?' for advice on other books which may be of interest.
As to best practices, here are some suggestions. Again, I'm not sure of your starting point so some of this may be too basic:
As I wrote above, you should be planning from the outset to develop a parallel program. If message-passing on a cluster is not your cup of tea, at least consider shared memory programming for a multi-core desktop. OpenMP is worth investigating.
Make yourself familiar with existing work. The BOOST libraries are probably essential. While I applaud your intention to roll-your-own, don't ignore existing well-established numerical libraries such as BLAS and LAPACK which you'll find at Netlib. Depending on your development platform and toolset you may find them already installed.
If you are coming from a scientific background, you may want to improve your knowledge of and skills in software engineering. Matters such as: source code control; testing; code profiling and optimisation; deep knowledge of what your compiler(s) can do. In my experience many computational scientists have a weak background in all of this stuff.
You should be planning to spend (approximately) as much time on designing and testing your program as on actually coding it. Even working on your own it is essential to have a good plan of action before you start coding. There's no reason why it has to be complete in every detail at the beginning but never enter territory without a map.
You are silent on the aspect(s) of the physical world you want to simulate. There is a lot of prior art in all sorts of physical simulations, if you were a bit more specific SO might be able to provide some more specific suggestions.
发布评论
评论(3)
这是一个阅读清单。不确定它对您来说是否太基础:
编写科学软件:基本“学习 C++ 编程”或其他内容的良好后续内容。
C++ 和 MPI 中的并行科学计算:如果您不打算并行化您的应用程序,那么您应该这样做。
工程和科学 C++:一本很好的、针对特定领域的 C++ 编程介绍。语言细节有点过时,但整体方法并没有过时。
我建议您通读诸如“我应该如何设计大型 C++ 程序?”等问题的 SO 答案。有关其他可能感兴趣的书籍的建议。
至于最佳实践,这里有一些建议。再说一遍,我不确定您的出发点,因此其中一些内容可能太基础了:
Here's something of a reading list. Not sure if it's too basic for you:
Writing Scientific Software: a good follow-on to a basic 'Learn to Program in C++' or whatever.
Parallel Scientific Computing in C++ and MPI: if you are not planning to parallelise your application, you should be.
Engineering and Scientific C++: a good, domain-specific, introduction to programming in C++. A bit dated in language details, but the overall approach hasn't aged.
I suggest that you read through the SO answers to questions such as 'How should I design a large C++ program ?' for advice on other books which may be of interest.
As to best practices, here are some suggestions. Again, I'm not sure of your starting point so some of this may be too basic:
从数值秘诀:科学计算的艺术开始。一本相当全面的书。但是,请记住两件事:
尽管如此,如果您出于教育目的需要它,强烈推荐阅读这本书。
Start with Numerical recipes: the art of scientific computing. A pretty comprehensive tome. However, keep in mind two things:
Still, if you need it for educational purposes, this book is a highly recommended reading.
看看 OpenModelica。
Have a look at OpenModelica.