]> https://gitweb.dealii.org/ - dealii.git/commit
Refactor identity_operator and null_operator for non-trivial payloads
authorJean-Paul Pelteret <jppelteret@gmail.com>
Wed, 1 Feb 2017 09:52:38 +0000 (10:52 +0100)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Wed, 1 Feb 2017 09:52:38 +0000 (10:52 +0100)
commitca103e81cd6956debce03641324042329dbf3811
tree47e66feb6f06570f6e61e3c6800d8a45390d63fb
parentf1284e9788a0ec0f33bb4afe09b17cde15d5bbaa
Refactor identity_operator and null_operator for non-trivial payloads

When performing compound operations with LinearOperators, it is
necessary for the Payload type of all operations to be the same.
identity_operator did not take in a operator, so we used to define a
variant of it in the TrilinosWrappers namespace in order to set up the
underlying Payload. This lead to some compiler confusion as it could not
deduce which version of the function to call unless the namespace was
used to explicitly remove this ambiguity.

We've now removed the second identity_operator in TrilinosWrappers, and
have instead defined an alternative identity_operator that takes in an
exemplar LinearOperator. This version of the function will automatically
extract the range of operations from the exemplar, deduce the Payload
type AND initialise it correctly (this would not have been done
correctly before). This required the introduction of the inverse_payload
function to the Payload classes.

In anticipation of similar problems with null_operator, this
LinearOperator is also slightly refactored as to ensure that the payload
is correctly configured. This required the introduction of the
null_payload function to the Payload classes.

Fixes #3846
include/deal.II/lac/linear_operator.h
include/deal.II/lac/trilinos_linear_operator.h
include/deal.II/lac/trilinos_sparse_matrix.h
source/lac/trilinos_sparse_matrix.cc
tests/lac/linear_operator_15.cc [new file with mode: 0644]
tests/lac/linear_operator_15.with_cxx11=on.with_trilinos=on.output [new file with mode: 0644]
tests/lac/linear_operator_16.cc [new file with mode: 0644]
tests/lac/linear_operator_16.with_cxx11=on.with_trilinos=on.output [new file with mode: 0644]

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.