[Dune] Yet another small question on FieldVectors
Jö Fahlke
jorrit at jorrit.de
Wed Jul 29 14:07:32 CEST 2009
Am Wed, 29. Jul 2009, 13:52:05 +0200 schrieb Aleksejs Fomins:
> I am trying to evaluate a complicated expression like
> M = A*b + C*d, where capital letters are vectors and small are scalars.
>
> The question was whether there was a way of writing this expression
> better than evaluating each component.
Ah, in that case you want FieldVector::axpy()
(http://www.dune-project.org/doc/doxygen/html/classDune_1_1FieldVector.html#61918bad19999b64425edcb668df24d6)
M = 0;
M.axpy(b, A);
M.axpy(d, C);
or
M = A;
M *= b;
M.axpy(d, C);
Bye,
Jö.
--
oil -- operation iraqi liberation
http://www.mo.tecsamples.de/mahnwache/index.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20090729/fa809563/attachment.sig>
More information about the Dune
mailing list