]> https://gitweb.dealii.org/ - dealii.git/commit
Avoid a couple FP subtractions. 8574/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 14 Aug 2019 23:26:10 +0000 (17:26 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 19 Aug 2019 17:56:45 +0000 (11:56 -0600)
commitb0edf302ac768feded941239848e97818eb0ae61
tree34d8631ed27976c9fa0403a44ceff854346e5549
parent28e0ebee34f98f0aabc2ff53e3837e1e531cfcc4
Avoid a couple FP subtractions.

By noting that the existing code performs dim subtractions of
terms that are each a product of two values, we can reorder
things in such a way that we first accumulate the products
(which is a dot product) and then subtract the result. This
should allow for some vectorization.

The performance gain is almost certainly completely negligible,
but it makes the code marginally easier to read. The reason
why the indices involved here allow for this is because
'jacobian_pushed_forward_grads[i]' happens to be a
Tensor<3,dim> and 'shape_gradients[k][i]' is a
Tensor<1,dim>. So the types are so that their product
is in fact equivalent to the summation of the last index
as was written before.
include/deal.II/fe/fe_poly.templates.h

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.