From 0aa8e013e271c1e7b0093fb06d462ae0e7fe2472 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 14 Apr 2015 10:16:02 +0200 Subject: [PATCH] Big renaming --- include/deal.II/lac/linear_operator.h | 84 ++++++++++--------- tests/lac/linear_operator_01.cc | 4 +- tests/lac/linear_operator_02.cc | 22 ++--- .../linear_operator_02.with_cxx11=on.output | 10 +-- tests/lac/linear_operator_03.cc | 22 ++--- .../linear_operator_03.with_cxx11=on.output | 10 +-- tests/lac/linear_operator_04.cc | 8 +- tests/lac/linear_operator_05.cc | 22 ++--- tests/lac/linear_operator_06.cc | 60 ++++++------- tests/lac/linear_operator_07.cc | 18 ++-- tests/lac/linear_operator_08.cc | 4 +- 11 files changed, 135 insertions(+), 129 deletions(-) diff --git a/include/deal.II/lac/linear_operator.h b/include/deal.II/lac/linear_operator.h index c83813aa9f..ccab84ea6a 100644 --- a/include/deal.II/lac/linear_operator.h +++ b/include/deal.II/lac/linear_operator.h @@ -36,14 +36,15 @@ template class LinearOperator; template , typename Domain = Range, - typename Exemplar, + typename OperatorExemplar, typename Matrix> -LinearOperator linop (const Exemplar &, const Matrix &); +LinearOperator linear_operator (const OperatorExemplar &, + const Matrix &); template , typename Domain = Range, typename Matrix> -LinearOperator linop (const Matrix &); +LinearOperator linear_operator (const Matrix &); /** * A class to store the abstract concept of a linear operator. @@ -84,9 +85,9 @@ LinearOperator linop (const Matrix &); * * // Setup and assembly of matrices * - * const auto op_a = linop(A); - * const auto op_b = linop(B); - * const auto op_c = linop(C); + * const auto op_a = linear_operator(A); + * const auto op_b = linear_operator(B); + * const auto op_c = linear_operator(C); * * const auto op = (op_a + k * op_b) * op_c; * @endcode @@ -152,28 +153,30 @@ public: /** * Templated copy constructor that creates a LinearOperator object from - * an object @p op for which the conversion function linop + * an object @p op for which the conversion function + * linear_operator * is defined. */ template LinearOperator (const Op &op) { - *this = linop(op); + *this = linear_operator(op); } /** * Default copy assignment operator. */ - LinearOperator &operator=(const LinearOperator &) = default; + LinearOperator & + operator=(const LinearOperator &) = default; /** * Templated copy assignment operator for an object @p op for which the - * conversion function linop is defined. + * conversion function linear_operator is defined. */ template LinearOperator &operator=(const Op &op) { - return *this = linop(op); + return *this = linear_operator(op); } /** @@ -489,7 +492,7 @@ operator*(const LinearOperator &op, */ template LinearOperator -transpose_linop(const LinearOperator &op) +transpose_operator(const LinearOperator &op) { LinearOperator return_op; @@ -518,7 +521,7 @@ transpose_linop(const LinearOperator &op) */ template LinearOperator -identity_linop(const std::function &reinit_vector) +identity_operator(const std::function &reinit_vector) { LinearOperator return_op; @@ -567,9 +570,9 @@ identity_linop(const std::function &reinit_vector) */ template LinearOperator -inverse_linop(const LinearOperator &op, - Solver &solver, - const Preconditioner &preconditioner) +inverse_operator(const LinearOperator &op, + Solver &solver, + const Preconditioner &preconditioner) { typedef typename Solver::vector_type Vector; @@ -603,7 +606,7 @@ inverse_linop(const LinearOperator>({op_a00, op_a01, op_a10, op_a11}); + * block_operator<2, 2, BlockVector>({op_a00, op_a01, op_a10, op_a11}); * @endcode */ template , typename Domain = Range> LinearOperator -block_linop(const std::array, n>, m> &ops) +block_operator(const std::array, n>, m> &ops) { static_assert(m > 0 && n > 0, "a blocked LinearOperator must consist of at least one block"); @@ -739,16 +742,16 @@ block_linop(const std::array) * diag(op_a0, op_a1, ..., op_am). The coresponding - * block_linop invocation takes the form + * block_operator invocation takes the form * @code - * blockdiagonal_linop>({op_00, op_a1, ..., op_am}); + * block_diagonal_operator>({op_00, op_a1, ..., op_am}); * @endcode */ template , typename Domain = Range> LinearOperator -blockdiag_linop(const std::array, m> &ops) +block_diagonal_operator(const std::array, m> &ops) { static_assert(m > 0, "a blockdiagonal LinearOperator must consist of at least one block"); @@ -830,7 +833,7 @@ template , typename Domain = Range> LinearOperator -blockdiag_linop(const LinearOperator &op) +block_diagonal_operator(const LinearOperator &op) { static_assert(m > 0, @@ -1133,20 +1136,21 @@ namespace template , typename Domain = Range, typename Matrix> -LinearOperator linop(const Matrix &matrix) +LinearOperator linear_operator(const Matrix &matrix) { // implement with the more generic variant below... - return linop(matrix, matrix); + return linear_operator(matrix, matrix); } /** * \relates LinearOperator * - * Variant of above function that takes an Exemplar object @p exemplar as - * an additional reference. This object is used to populate the - * reinit_domain_vector and reinit_range_vector function objects. The - * reference @p matrix is used to construct vmult, Tvmult, etc. + * Variant of above function that takes an operator object @p + * operator_exemplar as an additional reference. This object is used to + * populate the reinit_domain_vector and reinit_range_vector function + * objects. The reference @p matrix is used to construct vmult, Tvmult, + * etc. * * This variant can, for example, be used to encapsulate preconditioners * (that typically do not expose any information about the underlying @@ -1156,23 +1160,25 @@ LinearOperator linop(const Matrix &matrix) */ template , typename Domain = Range, - typename Exemplar, + typename OperatorExemplar, typename Matrix> -LinearOperator linop(const Exemplar &exemplar, - const Matrix &matrix) -{ +LinearOperator +linear_operator(const OperatorExemplar &operator_exemplar, + const Matrix &matrix) { LinearOperator return_op; - // Always store a reference to matrix and exemplar in the lambda + // Always store a reference to matrix and operator_exemplar in the lambda // functions. This ensures that a modification of the matrix after the // creation of a LinearOperator wrapper is respected - further a matrix - // or an exemplar cannot usually be copied... + // or an operator_exemplar cannot usually be copied... return_op.reinit_range_vector = - internal::LinearOperator::ReinitRangeFactory().operator()(exemplar); + internal::LinearOperator::ReinitRangeFactory().operator()( + operator_exemplar); return_op.reinit_domain_vector = - internal::LinearOperator::ReinitDomainFactory().operator()(exemplar); + internal::LinearOperator::ReinitDomainFactory().operator()( + operator_exemplar); typename std::conditional< has_vmult_add::type::value, diff --git a/tests/lac/linear_operator_01.cc b/tests/lac/linear_operator_01.cc index 1d486c4fdf..f227822c66 100644 --- a/tests/lac/linear_operator_01.cc +++ b/tests/lac/linear_operator_01.cc @@ -200,14 +200,14 @@ int main() // operator* and transpose - auto test2 = transpose_linop(multiply2) * multiply4; + auto test2 = transpose_operator(multiply2) * multiply4; RightVector w = { 0. }; test2.vmult(w, u); deallog << "(2 * 4) * " << u.value << " = " << w.value << std::endl; // identity - auto test3 = identity_linop(test2.reinit_range_vector) + test2; + auto test3 = identity_operator(test2.reinit_range_vector) + test2; test3.vmult(w, u); deallog << "(1 + 2 * 4) * " << u.value << " = " << w.value << std::endl; } diff --git a/tests/lac/linear_operator_02.cc b/tests/lac/linear_operator_02.cc index 1620746cd0..3fd0491463 100644 --- a/tests/lac/linear_operator_02.cc +++ b/tests/lac/linear_operator_02.cc @@ -70,8 +70,8 @@ int main() // Constructors and assignment: - auto op_a = linop(a); - auto op_b = linop(b); + auto op_a = linear_operator(a); + auto op_b = linear_operator(b); { LinearOperator, dealii::Vector> op_x (a); @@ -153,33 +153,33 @@ int main() deallog << "solve(B, v, u): " << v << std::endl; deallog.depth_file(0); - inverse_linop(op_b, solver, PreconditionIdentity()).vmult(v, u); + inverse_operator(op_b, solver, PreconditionIdentity()).vmult(v, u); deallog.depth_file(3); - deallog << "inverse_linop(B)u: " << v << std::endl; + deallog << "inverse_operator(B)u: " << v << std::endl; deallog.depth_file(0); op_b.vmult(w, v); deallog.depth_file(3); - deallog << "B(inverse_linop(B)u): " << w << std::endl; + deallog << "B(inverse_operator(B)u): " << w << std::endl; deallog.depth_file(0); - (op_b * inverse_linop(op_b, solver, PreconditionIdentity())).vmult(w, u); + (op_b * inverse_operator(op_b, solver, PreconditionIdentity())).vmult(w, u); deallog.depth_file(3); - deallog << "(B*inverse_linop(B))u: " << w << std::endl; + deallog << "(B*inverse_operator(B))u: " << w << std::endl; deallog.depth_file(0); - (inverse_linop(op_b, solver, PreconditionIdentity()) * op_b).vmult(w, u); + (inverse_operator(op_b, solver, PreconditionIdentity()) * op_b).vmult(w, u); deallog.depth_file(3); - deallog << "(inverse_linop(B)*B)u: " << w << std::endl; + deallog << "(inverse_operator(B)*B)u: " << w << std::endl; SolverControl inner_solver_control (1000, 1e-12); SolverCG<> inner_solver (solver_control); deallog.depth_file(0); - solver.solve(inverse_linop(op_b, inner_solver, PreconditionIdentity()), v, u, + solver.solve(inverse_operator(op_b, inner_solver, PreconditionIdentity()), v, u, PreconditionIdentity()); deallog.depth_file(3); - deallog << "solve(inverse_linop(B), v, u) == Bu: " << v << std::endl; + deallog << "solve(inverse_operator(B), v, u) == Bu: " << v << std::endl; deallog.depth_file(0); solver.solve(op_b + 0.005 * op_a, v, u, PreconditionIdentity()); diff --git a/tests/lac/linear_operator_02.with_cxx11=on.output b/tests/lac/linear_operator_02.with_cxx11=on.output index f9f16141e6..a1c91305e1 100644 --- a/tests/lac/linear_operator_02.with_cxx11=on.output +++ b/tests/lac/linear_operator_02.with_cxx11=on.output @@ -25,15 +25,15 @@ DEAL::(A*=B)u: -0.1073495370 -0.1866319444 -0.2039930556 -0.02199074074 -0.28935 DEAL:: DEAL::solve(B, v, u): 80.16326531 28.24489796 86.53061224 25.79591837 259.4285714 57.14285714 328.0000000 88.00000000 184.0000000 226.6122449 40.48979592 1446.693878 315.7551020 160.0000000 760.0000000 387.7551020 81.63265306 190.8571429 2286.693878 470.0408163 1140.571429 108.0816327 569.9591837 539.1020408 3018.448980 DEAL:: -DEAL::inverse_linop(B)u: 80.16326531 28.24489796 86.53061224 25.79591837 259.4285714 57.14285714 328.0000000 88.00000000 184.0000000 226.6122449 40.48979592 1446.693878 315.7551020 160.0000000 760.0000000 387.7551020 81.63265306 190.8571429 2286.693878 470.0408163 1140.571429 108.0816327 569.9591837 539.1020408 3018.448980 +DEAL::inverse_operator(B)u: 80.16326531 28.24489796 86.53061224 25.79591837 259.4285714 57.14285714 328.0000000 88.00000000 184.0000000 226.6122449 40.48979592 1446.693878 315.7551020 160.0000000 760.0000000 387.7551020 81.63265306 190.8571429 2286.693878 470.0408163 1140.571429 108.0816327 569.9591837 539.1020408 3018.448980 DEAL:: -DEAL::B(inverse_linop(B)u): 1.000000000 2.000000000 3.000000000 4.000000000 5.000000000 6.000000000 7.000000000 8.000000000 9.000000000 10.00000000 11.00000000 12.00000000 13.00000000 14.00000000 15.00000000 16.00000000 17.00000000 18.00000000 19.00000000 20.00000000 21.00000000 22.00000000 23.00000000 24.00000000 25.00000000 +DEAL::B(inverse_operator(B)u): 1.000000000 2.000000000 3.000000000 4.000000000 5.000000000 6.000000000 7.000000000 8.000000000 9.000000000 10.00000000 11.00000000 12.00000000 13.00000000 14.00000000 15.00000000 16.00000000 17.00000000 18.00000000 19.00000000 20.00000000 21.00000000 22.00000000 23.00000000 24.00000000 25.00000000 DEAL:: -DEAL::(B*inverse_linop(B))u: 1.000000000 2.000000000 3.000000000 4.000000000 5.000000000 6.000000000 7.000000000 8.000000000 9.000000000 10.00000000 11.00000000 12.00000000 13.00000000 14.00000000 15.00000000 16.00000000 17.00000000 18.00000000 19.00000000 20.00000000 21.00000000 22.00000000 23.00000000 24.00000000 25.00000000 +DEAL::(B*inverse_operator(B))u: 1.000000000 2.000000000 3.000000000 4.000000000 5.000000000 6.000000000 7.000000000 8.000000000 9.000000000 10.00000000 11.00000000 12.00000000 13.00000000 14.00000000 15.00000000 16.00000000 17.00000000 18.00000000 19.00000000 20.00000000 21.00000000 22.00000000 23.00000000 24.00000000 25.00000000 DEAL:: -DEAL::(inverse_linop(B)*B)u: 1.000000000 2.000000000 3.000000000 4.000000000 5.000000000 6.000000000 7.000000000 8.000000000 9.000000000 10.00000000 11.00000000 12.00000000 13.00000000 14.00000000 15.00000000 16.00000000 17.00000000 18.00000000 19.00000000 20.00000000 21.00000000 22.00000000 23.00000000 24.00000000 25.00000000 +DEAL::(inverse_operator(B)*B)u: 1.000000000 2.000000000 3.000000000 4.000000000 5.000000000 6.000000000 7.000000000 8.000000000 9.000000000 10.00000000 11.00000000 12.00000000 13.00000000 14.00000000 15.00000000 16.00000000 17.00000000 18.00000000 19.00000000 20.00000000 21.00000000 22.00000000 23.00000000 24.00000000 25.00000000 DEAL:: -DEAL::solve(inverse_linop(B), v, u) == Bu: 0.03125000000 0.09201388889 0.1145833333 0.2812500000 0.1788194444 0.4270833333 0.2552083333 0.5538194444 0.6631944444 0.3072916667 0.6753472222 0.1822916667 0.3923611111 0.8888888889 0.4878472222 0.4791666667 1.000000000 1.093750000 0.2864583333 0.5937500000 0.6371527778 1.281250000 0.6770833333 0.7170138889 0.3750000000 +DEAL::solve(inverse_operator(B), v, u) == Bu: 0.03125000000 0.09201388889 0.1145833333 0.2812500000 0.1788194444 0.4270833333 0.2552083333 0.5538194444 0.6631944444 0.3072916667 0.6753472222 0.1822916667 0.3923611111 0.8888888889 0.4878472222 0.4791666667 1.000000000 1.093750000 0.2864583333 0.5937500000 0.6371527778 1.281250000 0.6770833333 0.7170138889 0.3750000000 DEAL:: DEAL::solve(B+0.5*0.01*A, v, u): 59.31059595 52.77843700 93.77361796 53.05371114 176.7862626 80.04635988 236.6925420 110.0293599 135.7027276 299.7370750 139.0997515 987.0719769 399.5852319 197.1836670 535.4087997 487.8703686 221.2510235 251.7282805 1564.703948 612.1971228 783.5848738 287.5180747 708.4784200 725.1386389 2062.398876 DEAL:: diff --git a/tests/lac/linear_operator_03.cc b/tests/lac/linear_operator_03.cc index f65717ccf9..3fd25df0f3 100644 --- a/tests/lac/linear_operator_03.cc +++ b/tests/lac/linear_operator_03.cc @@ -90,8 +90,8 @@ int main() // Constructors and assignment: - auto op_a = linop>(a); - auto op_b = linop>(b); + auto op_a = linear_operator>(a); + auto op_b = linear_operator>(b); { decltype(op_a) op_x (a); @@ -173,33 +173,33 @@ int main() PRINTME("solve(B, v, u)", v); deallog.depth_file(0); - inverse_linop(op_b, solver, PreconditionIdentity()).vmult(v, u); + inverse_operator(op_b, solver, PreconditionIdentity()).vmult(v, u); deallog.depth_file(3); - PRINTME("inverse_linop(B)u", v); + PRINTME("inverse_operator(B)u", v); deallog.depth_file(0); op_b.vmult(w, v); deallog.depth_file(3); - PRINTME("B(inverse_linop(B)u)", w); + PRINTME("B(inverse_operator(B)u)", w); deallog.depth_file(0); - (op_b * inverse_linop(op_b, solver, PreconditionIdentity())).vmult(w, u); + (op_b * inverse_operator(op_b, solver, PreconditionIdentity())).vmult(w, u); deallog.depth_file(3); - PRINTME("(B*inverse_linop(B))u", w); + PRINTME("(B*inverse_operator(B))u", w); deallog.depth_file(0); - (inverse_linop(op_b, solver, PreconditionIdentity()) * op_b).vmult(w, u); + (inverse_operator(op_b, solver, PreconditionIdentity()) * op_b).vmult(w, u); deallog.depth_file(3); - PRINTME("(inverse_linop(B)*B)u", w); + PRINTME("(inverse_operator(B)*B)u", w); SolverControl inner_solver_control (1000, 1e-12); SolverCG> inner_solver (solver_control); deallog.depth_file(0); - solver.solve(inverse_linop(op_b, inner_solver, PreconditionIdentity()), v, u, + solver.solve(inverse_operator(op_b, inner_solver, PreconditionIdentity()), v, u, PreconditionIdentity()); deallog.depth_file(3); - PRINTME("solve(inverse_linop(B), v, u) == Bu", v); + PRINTME("solve(inverse_operator(B), v, u) == Bu", v); deallog.depth_file(0); solver.solve(op_b + 0.005 * op_a, v, u, PreconditionIdentity()); diff --git a/tests/lac/linear_operator_03.with_cxx11=on.output b/tests/lac/linear_operator_03.with_cxx11=on.output index 7d006da0c1..d87ee3a373 100644 --- a/tests/lac/linear_operator_03.with_cxx11=on.output +++ b/tests/lac/linear_operator_03.with_cxx11=on.output @@ -38,19 +38,19 @@ DEAL:: DEAL::solve(B, v, u): [block 0] 0.2000000000 0.4000000000 0.6000000000 0.8000000000 1.000000000 1.200000000 1.400000000 1.600000000 1.800000000 2.000000000 2.200000000 2.400000000 2.600000000 2.800000000 3.000000000 3.200000000 3.400000000 3.600000000 3.800000000 4.000000000 4.200000000 4.400000000 4.600000000 4.800000000 5.000000000 DEAL:: [block 1] 5.200000000 5.400000000 5.600000000 5.800000000 6.000000000 6.200000000 6.400000000 6.600000000 6.800000000 7.000000000 7.200000000 7.400000000 7.600000000 7.800000000 8.000000000 8.200000000 8.400000000 8.600000000 8.800000000 9.000000000 9.200000000 9.400000000 9.600000000 9.800000000 10.00000000 DEAL:: -DEAL::inverse_linop(B)u: [block 0] 0.2000000000 0.4000000000 0.6000000000 0.8000000000 1.000000000 1.200000000 1.400000000 1.600000000 1.800000000 2.000000000 2.200000000 2.400000000 2.600000000 2.800000000 3.000000000 3.200000000 3.400000000 3.600000000 3.800000000 4.000000000 4.200000000 4.400000000 4.600000000 4.800000000 5.000000000 +DEAL::inverse_operator(B)u: [block 0] 0.2000000000 0.4000000000 0.6000000000 0.8000000000 1.000000000 1.200000000 1.400000000 1.600000000 1.800000000 2.000000000 2.200000000 2.400000000 2.600000000 2.800000000 3.000000000 3.200000000 3.400000000 3.600000000 3.800000000 4.000000000 4.200000000 4.400000000 4.600000000 4.800000000 5.000000000 DEAL:: [block 1] 5.200000000 5.400000000 5.600000000 5.800000000 6.000000000 6.200000000 6.400000000 6.600000000 6.800000000 7.000000000 7.200000000 7.400000000 7.600000000 7.800000000 8.000000000 8.200000000 8.400000000 8.600000000 8.800000000 9.000000000 9.200000000 9.400000000 9.600000000 9.800000000 10.00000000 DEAL:: -DEAL::B(inverse_linop(B)u): [block 0] 1.000000000 2.000000000 3.000000000 4.000000000 5.000000000 6.000000000 7.000000000 8.000000000 9.000000000 10.00000000 11.00000000 12.00000000 13.00000000 14.00000000 15.00000000 16.00000000 17.00000000 18.00000000 19.00000000 20.00000000 21.00000000 22.00000000 23.00000000 24.00000000 25.00000000 +DEAL::B(inverse_operator(B)u): [block 0] 1.000000000 2.000000000 3.000000000 4.000000000 5.000000000 6.000000000 7.000000000 8.000000000 9.000000000 10.00000000 11.00000000 12.00000000 13.00000000 14.00000000 15.00000000 16.00000000 17.00000000 18.00000000 19.00000000 20.00000000 21.00000000 22.00000000 23.00000000 24.00000000 25.00000000 DEAL:: [block 1] 26.00000000 27.00000000 28.00000000 29.00000000 30.00000000 31.00000000 32.00000000 33.00000000 34.00000000 35.00000000 36.00000000 37.00000000 38.00000000 39.00000000 40.00000000 41.00000000 42.00000000 43.00000000 44.00000000 45.00000000 46.00000000 47.00000000 48.00000000 49.00000000 50.00000000 DEAL:: -DEAL::(B*inverse_linop(B))u: [block 0] 1.000000000 2.000000000 3.000000000 4.000000000 5.000000000 6.000000000 7.000000000 8.000000000 9.000000000 10.00000000 11.00000000 12.00000000 13.00000000 14.00000000 15.00000000 16.00000000 17.00000000 18.00000000 19.00000000 20.00000000 21.00000000 22.00000000 23.00000000 24.00000000 25.00000000 +DEAL::(B*inverse_operator(B))u: [block 0] 1.000000000 2.000000000 3.000000000 4.000000000 5.000000000 6.000000000 7.000000000 8.000000000 9.000000000 10.00000000 11.00000000 12.00000000 13.00000000 14.00000000 15.00000000 16.00000000 17.00000000 18.00000000 19.00000000 20.00000000 21.00000000 22.00000000 23.00000000 24.00000000 25.00000000 DEAL:: [block 1] 26.00000000 27.00000000 28.00000000 29.00000000 30.00000000 31.00000000 32.00000000 33.00000000 34.00000000 35.00000000 36.00000000 37.00000000 38.00000000 39.00000000 40.00000000 41.00000000 42.00000000 43.00000000 44.00000000 45.00000000 46.00000000 47.00000000 48.00000000 49.00000000 50.00000000 DEAL:: -DEAL::(inverse_linop(B)*B)u: [block 0] 1.000000000 2.000000000 3.000000000 4.000000000 5.000000000 6.000000000 7.000000000 8.000000000 9.000000000 10.00000000 11.00000000 12.00000000 13.00000000 14.00000000 15.00000000 16.00000000 17.00000000 18.00000000 19.00000000 20.00000000 21.00000000 22.00000000 23.00000000 24.00000000 25.00000000 +DEAL::(inverse_operator(B)*B)u: [block 0] 1.000000000 2.000000000 3.000000000 4.000000000 5.000000000 6.000000000 7.000000000 8.000000000 9.000000000 10.00000000 11.00000000 12.00000000 13.00000000 14.00000000 15.00000000 16.00000000 17.00000000 18.00000000 19.00000000 20.00000000 21.00000000 22.00000000 23.00000000 24.00000000 25.00000000 DEAL:: [block 1] 26.00000000 27.00000000 28.00000000 29.00000000 30.00000000 31.00000000 32.00000000 33.00000000 34.00000000 35.00000000 36.00000000 37.00000000 38.00000000 39.00000000 40.00000000 41.00000000 42.00000000 43.00000000 44.00000000 45.00000000 46.00000000 47.00000000 48.00000000 49.00000000 50.00000000 DEAL:: -DEAL::solve(inverse_linop(B), v, u) == Bu: [block 0] 5.000000000 10.00000000 15.00000000 20.00000000 25.00000000 30.00000000 35.00000000 40.00000000 45.00000000 50.00000000 55.00000000 60.00000000 65.00000000 70.00000000 75.00000000 80.00000000 85.00000000 90.00000000 95.00000000 100.0000000 105.0000000 110.0000000 115.0000000 120.0000000 125.0000000 +DEAL::solve(inverse_operator(B), v, u) == Bu: [block 0] 5.000000000 10.00000000 15.00000000 20.00000000 25.00000000 30.00000000 35.00000000 40.00000000 45.00000000 50.00000000 55.00000000 60.00000000 65.00000000 70.00000000 75.00000000 80.00000000 85.00000000 90.00000000 95.00000000 100.0000000 105.0000000 110.0000000 115.0000000 120.0000000 125.0000000 DEAL:: [block 1] 130.0000000 135.0000000 140.0000000 145.0000000 150.0000000 155.0000000 160.0000000 165.0000000 170.0000000 175.0000000 180.0000000 185.0000000 190.0000000 195.0000000 200.0000000 205.0000000 210.0000000 215.0000000 220.0000000 225.0000000 230.0000000 235.0000000 240.0000000 245.0000000 250.0000000 DEAL:: DEAL::solve(B+0.5*0.01*A, v, u): [block 0] 0.1998001998 0.3996003996 0.5994005994 0.7992007992 0.9990009990 1.198801199 1.398601399 1.598401598 1.798201798 1.998001998 2.197802198 2.397602398 2.597402597 2.797202797 2.997002997 3.196803197 3.396603397 3.596403596 3.796203796 3.996003996 4.195804196 4.395604396 4.595404595 4.795204795 4.995004995 diff --git a/tests/lac/linear_operator_04.cc b/tests/lac/linear_operator_04.cc index 2a4e4f4216..6a492275e3 100644 --- a/tests/lac/linear_operator_04.cc +++ b/tests/lac/linear_operator_04.cc @@ -35,13 +35,13 @@ int main(int argc, char *argv[]) TrilinosWrappers::SparseMatrix a; - auto op_a = linop(a); - auto op_a2 = linop(a); + auto op_a = linear_operator(a); + auto op_a2 = linear_operator(a); TrilinosWrappers::BlockSparseMatrix b; - auto op_b = linop(b); - auto op_b3 = linop(b); + auto op_b = linear_operator(b); + auto op_b3 = linear_operator(b); deallog << "OK" << std::endl; diff --git a/tests/lac/linear_operator_05.cc b/tests/lac/linear_operator_05.cc index 0a66e8903b..958df9fcf1 100644 --- a/tests/lac/linear_operator_05.cc +++ b/tests/lac/linear_operator_05.cc @@ -13,7 +13,7 @@ // // --------------------------------------------------------------------- -// Tests for block_linop +// Tests for block_operator #include "../tests.h" @@ -98,15 +98,15 @@ int main() a.block(1, 0).set(i, i, 1.); - auto op_a = linop>(a); + auto op_a = linear_operator>(a); - auto op_b00 = linop(a.block(0, 0)); - auto op_b01 = linop(a.block(0, 1)); - auto op_b10 = linop(a.block(1, 0)); - auto op_b11 = linop(a.block(1, 1)); + auto op_b00 = linear_operator(a.block(0, 0)); + auto op_b01 = linear_operator(a.block(0, 1)); + auto op_b10 = linear_operator(a.block(1, 0)); + auto op_b11 = linear_operator(a.block(1, 1)); auto op_b = - block_linop<2, 2, BlockVector>({op_b00, op_b01, op_b10, op_b11}); + block_operator<2, 2, BlockVector>({op_b00, op_b01, op_b10, op_b11}); // vmult: @@ -173,7 +173,7 @@ int main() // And finally complicated block structures: - auto op_upp_x_upu = block_linop<3, 3, BlockVector>( + auto op_upp_x_upu = block_operator<3, 3, BlockVector>( {op_b00, op_b01, op_b00, op_b10, op_b11, op_b10, op_b10, op_b11, op_b10}); op_upp_x_upu.reinit_domain_vector(u, false); @@ -191,12 +191,12 @@ int main() PRINTME("v", v); auto op_upp_x_p = - block_linop<3, 1, BlockVector>({op_b01, op_b11, op_b11}); + block_operator<3, 1, BlockVector>({op_b01, op_b11, op_b11}); auto op_u_x_upu = - block_linop<1, 3, BlockVector>({op_b00, op_b01, op_b00}); + block_operator<1, 3, BlockVector>({op_b00, op_b01, op_b00}); - auto op_long = op_u_x_upu * transpose_linop(op_upp_x_upu) * op_upp_x_p; + auto op_long = op_u_x_upu * transpose_operator(op_upp_x_upu) * op_upp_x_p; op_long.reinit_domain_vector(u, false); for (unsigned int i = 0; i < u.size(); ++i) { diff --git a/tests/lac/linear_operator_06.cc b/tests/lac/linear_operator_06.cc index 393b548c61..0eab4f6f22 100644 --- a/tests/lac/linear_operator_06.cc +++ b/tests/lac/linear_operator_06.cc @@ -13,7 +13,7 @@ // // --------------------------------------------------------------------- -// Test linop constructor for full and reduced interface: +// Test linear_operator constructor for full and reduced interface: #include "../tests.h" @@ -207,33 +207,33 @@ int main() MyMatrix5 m5; MyMatrix6 m6; - linop(m1).vmult(v, u); - linop(m1).Tvmult(v, u); - linop(m1).vmult_add(v, u); - linop(m1).Tvmult_add(v, u); - - linop(m2).vmult(v, u); - linop(m2).Tvmult(v, u); - linop(m2).vmult_add(v, u); - linop(m2).Tvmult_add(v, u); - - linop(m3).vmult(v, u); - linop(m3).Tvmult(v, u); - linop(m3).vmult_add(v, u); - linop(m3).Tvmult_add(v, u); - - linop(m4).vmult(v, u); - linop(m4).Tvmult(v, u); - linop(m4).vmult_add(v, u); - linop(m4).Tvmult_add(v, u); - - linop(m5).vmult(v, u); - linop(m5).Tvmult(v, u); - linop(m5).vmult_add(v, u); - linop(m5).Tvmult_add(v, u); - - linop(m6).vmult(v, u); - linop(m6).Tvmult(v, u); - linop(m6).vmult_add(v, u); - linop(m6).Tvmult_add(v, u); + linear_operator(m1).vmult(v, u); + linear_operator(m1).Tvmult(v, u); + linear_operator(m1).vmult_add(v, u); + linear_operator(m1).Tvmult_add(v, u); + + linear_operator(m2).vmult(v, u); + linear_operator(m2).Tvmult(v, u); + linear_operator(m2).vmult_add(v, u); + linear_operator(m2).Tvmult_add(v, u); + + linear_operator(m3).vmult(v, u); + linear_operator(m3).Tvmult(v, u); + linear_operator(m3).vmult_add(v, u); + linear_operator(m3).Tvmult_add(v, u); + + linear_operator(m4).vmult(v, u); + linear_operator(m4).Tvmult(v, u); + linear_operator(m4).vmult_add(v, u); + linear_operator(m4).Tvmult_add(v, u); + + linear_operator(m5).vmult(v, u); + linear_operator(m5).Tvmult(v, u); + linear_operator(m5).vmult_add(v, u); + linear_operator(m5).Tvmult_add(v, u); + + linear_operator(m6).vmult(v, u); + linear_operator(m6).Tvmult(v, u); + linear_operator(m6).vmult_add(v, u); + linear_operator(m6).Tvmult_add(v, u); } diff --git a/tests/lac/linear_operator_07.cc b/tests/lac/linear_operator_07.cc index 75f92cb569..53711def2d 100644 --- a/tests/lac/linear_operator_07.cc +++ b/tests/lac/linear_operator_07.cc @@ -13,7 +13,7 @@ // // --------------------------------------------------------------------- -// Tests for blockdiagonal_linop +// Tests for block_diagonal_operator #include "../tests.h" @@ -78,14 +78,14 @@ int main() a.block(2, 2).set(i, i, 3.); - auto op_a = linop>(a); + auto op_a = linear_operator>(a); - auto op_b0 = linop(a.block(0, 0)); - auto op_b1 = linop(a.block(1, 1)); - auto op_b2 = linop(a.block(2, 2)); + auto op_b0 = linear_operator(a.block(0, 0)); + auto op_b1 = linear_operator(a.block(1, 1)); + auto op_b2 = linear_operator(a.block(2, 2)); auto op_b = - blockdiag_linop<3, BlockVector>({op_b0, op_b1, op_b2}); + block_diagonal_operator<3, BlockVector>({op_b0, op_b1, op_b2}); // vmult: @@ -150,11 +150,11 @@ int main() op_x.Tvmult_add(x, u); PRINTME("(B*B*B) Tvmult_add", x); - // And finally the other blockdiag_linop variant: + // And finally the other block_diagonal_operator variant: - auto op_c = blockdiag_linop<5, BlockVector>({op_b0, op_b0, op_b0, op_b0, op_b0}); + auto op_c = block_diagonal_operator<5, BlockVector>({op_b0, op_b0, op_b0, op_b0, op_b0}); - auto op_d = blockdiag_linop<5, BlockVector>(op_b0); + auto op_d = block_diagonal_operator<5, BlockVector>(op_b0); op_c.reinit_domain_vector(u, false); for (unsigned int i = 0; i < u.size(); ++i) { diff --git a/tests/lac/linear_operator_08.cc b/tests/lac/linear_operator_08.cc index a03cd8f91d..d15d626d53 100644 --- a/tests/lac/linear_operator_08.cc +++ b/tests/lac/linear_operator_08.cc @@ -44,7 +44,7 @@ int main() SparseMatrix a (sparsity_pattern); - auto op_a = linop(a); + auto op_a = linear_operator(a); Vector u; op_a.reinit_domain_vector(u, false); @@ -72,7 +72,7 @@ int main() BlockSparseMatrix a (sparsity_pattern); - auto op_a = linop>(a); + auto op_a = linear_operator>(a); BlockVector u; op_a.reinit_domain_vector(u, false); -- 2.39.5