The delightful conciseness of Julia

The code does the same thing: Integrate the conductivity matrix and the heat load.
The deal.ii code on the right is in C++. The Julia is I think easier to read, and, at least in my test, it runs (slightly) faster.

EDIT: Second measurement: deal.ii code is ~6% faster. Not sure why the first measurement indicated the opposite. Sorry about the misinformation.

EDIT 2: To satisfy a request for references: https://github.com/PetrKryslUCSD/Elfel.jl (examples/heat/heat_poisson_q4.jl), http://dealii.org/ (step 3).

EDIT: Third measurement on a laptop with no load other than the calculation: codes run at the same speed.

9 Likes

Please post quoted code — screenshots are difficult to read.

You’re right, one has to click to enlarge the images to read the code. But even when one looks at the code from afar, when the code can no longer be read, I believe my point can be made.

3 Likes