> ....I had supposed that making use of C++, especially using features like > templates and STL tend to make the program slow.......I wonder if any > thought has been given to this...and if anyone has done a comparison > between two similar codes, one written in C++ using Dealii and other using > FORTRAN90?
I am unsure why you would think that templates and the STL would make programs slow -- generally, the opposite is assumed: templates are slow to compile but execute fast because the compiler has a lot of information. And the STL is a set of algorithms and data structures where a lot of people have spent a lot of time optimizing. They have certainly spent more time on it than we could ever have spent on it if we had tried to implement the corresponding algorithms and data structures ourselves (or than one would spend if one tried to implement them in F90, for example). But by and large I find the question uninteresting. Clearly, if I had to write, say, a Stokes solver with a particular linear solver, a particular time stepping scheme, on a piecewise polygonal domain, and Q2/Q1 elements, I can write a code that is 20% or 30% faster than what you would get when using deal.II because you know the building blocks, shape functions, mappings, etc. But it'll take you 6 months to do so. On the other hand, when using deal.II, I can do it in 1 month. In other words, which approach is better really depends on your metrics: If your goal is to get the absolute maximal efficiency and you have a lot of time to spare, write a code in Fortran 77. For everyone else, you are most likely better off using what's there in a library like deal.II. This all, by the way, does not mean that we don't care about speed: We've spend a lot of effort profiling the library and working on the hot spots to make codes fast. As for concrete comparisons with other codes: That boils down to the same question. You can compare with a hand-written code for a particular application and deal.II is more than likely to lose in terms of speed. But it's going to win in terms of time to develop the code. Or you could compare with Fortran 90 libraries that offer the same functionality -- though, thinking about that, this is going to be hard: deal.II is by far the largest and most comprehensive finite element library available as Open Source, irrespective of the programming language. W. ------------------------------------------------------------------------- Wolfgang Bangerth email: [email protected] www: http://www.math.tamu.edu/~bangerth/ _______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
