template <typename Range = Vector<double>,
typename Domain = Range,
- typename Exemplar,
+ typename OperatorExemplar,
typename Matrix>
-LinearOperator<Range, Domain> linop (const Exemplar &, const Matrix &);
+LinearOperator<Range, Domain> linear_operator (const OperatorExemplar &,
+ const Matrix &);
template <typename Range = Vector<double>,
typename Domain = Range,
typename Matrix>
-LinearOperator<Range, Domain> linop (const Matrix &);
+LinearOperator<Range, Domain> linear_operator (const Matrix &);
/**
* A class to store the abstract concept of a linear operator.
*
* // 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
/**
* Templated copy constructor that creates a LinearOperator object from
- * an object @p op for which the conversion function <code>linop</code>
+ * an object @p op for which the conversion function
+ * <code>linear_operator</code>
* is defined.
*/
template<typename Op>
LinearOperator (const Op &op)
{
- *this = linop<Range, Domain, Op>(op);
+ *this = linear_operator<Range, Domain, Op>(op);
}
/**
* Default copy assignment operator.
*/
- LinearOperator<Range, Domain> &operator=(const LinearOperator<Range, Domain> &) = default;
+ LinearOperator<Range, Domain> &
+ operator=(const LinearOperator<Range, Domain> &) = default;
/**
* Templated copy assignment operator for an object @p op for which the
- * conversion function <code>linop</code> is defined.
+ * conversion function <code>linear_operator</code> is defined.
*/
template <typename Op>
LinearOperator<Range, Domain> &operator=(const Op &op)
{
- return *this = linop<Range, Domain, Op>(op);
+ return *this = linear_operator<Range, Domain, Op>(op);
}
/**
*/
template <typename Range, typename Domain>
LinearOperator<Domain, Range>
-transpose_linop(const LinearOperator<Range, Domain> &op)
+transpose_operator(const LinearOperator<Range, Domain> &op)
{
LinearOperator<Domain, Range> return_op;
*/
template <typename Range>
LinearOperator<Range, Range>
-identity_linop(const std::function<void(Range &, bool)> &reinit_vector)
+identity_operator(const std::function<void(Range &, bool)> &reinit_vector)
{
LinearOperator<Range, Range> return_op;
*/
template <typename Solver, typename Preconditioner>
LinearOperator<typename Solver::vector_type, typename Solver::vector_type>
-inverse_linop(const LinearOperator<typename Solver::vector_type, typename Solver::vector_type> &op,
- Solver &solver,
- const Preconditioner &preconditioner)
+inverse_operator(const LinearOperator<typename Solver::vector_type, typename Solver::vector_type> &op,
+ Solver &solver,
+ const Preconditioner &preconditioner)
{
typedef typename Solver::vector_type Vector;
return_op.Tvmult = [op, &solver, &preconditioner]( Vector &v, const
Vector &u)
{
- solver.solve(transpose_linop(op), v, u, preconditioner);
+ solver.solve(transpose_operator(op), v, u, preconditioner);
};
return_op.Tvmult =
{
Vector *v2 = op.range_vector_memory.alloc();
op.reinit_range_vector(*v2, /*bool fast =*/ true);
- solver.solve(transpose_linop(op), *v2, u, preconditioner);
+ solver.solve(transpose_operator(op), *v2, u, preconditioner);
v += *v2;
op.range_vector_memory.free(v2);
};
* |
* op_a10 | op_a11
* @endcode
- * The coresponding block_linop invocation takes the form
+ * The coresponding block_operator invocation takes the form
* @code
- * block_linop<2, 2, BlockVector<double>>({op_a00, op_a01, op_a10, op_a11});
+ * block_operator<2, 2, BlockVector<double>>({op_a00, op_a01, op_a10, op_a11});
* @endcode
*/
template <unsigned int m, unsigned int n,
typename Range = BlockVector<double>,
typename Domain = Range>
LinearOperator<Range, Domain>
-block_linop(const std::array<std::array<LinearOperator<typename Range::BlockType, typename Domain::BlockType>, n>, m> &ops)
+block_operator(const std::array<std::array<LinearOperator<typename Range::BlockType, typename Domain::BlockType>, n>, m> &ops)
{
static_assert(m > 0 && n > 0,
"a blocked LinearOperator must consist of at least one block");
* The list @p ops is best passed as an initializer list. Consider for
* example a linear operator block (acting on Vector<double>)
* <code>diag(op_a0, op_a1, ..., op_am)</code>. The coresponding
- * block_linop invocation takes the form
+ * block_operator invocation takes the form
* @code
- * blockdiagonal_linop<m, BlockVector<double>>({op_00, op_a1, ..., op_am});
+ * block_diagonal_operator<m, BlockVector<double>>({op_00, op_a1, ..., op_am});
* @endcode
*/
template <unsigned int m,
typename Range = BlockVector<double>,
typename Domain = Range>
LinearOperator<Range, Domain>
-blockdiag_linop(const std::array<LinearOperator<typename Range::BlockType, typename Domain::BlockType>, m> &ops)
+block_diagonal_operator(const std::array<LinearOperator<typename Range::BlockType, typename Domain::BlockType>, m> &ops)
{
static_assert(m > 0,
"a blockdiagonal LinearOperator must consist of at least one block");
typename Range = BlockVector<double>,
typename Domain = Range>
LinearOperator<Range, Domain>
-blockdiag_linop(const LinearOperator<typename Range::BlockType, typename Domain::BlockType> &op)
+block_diagonal_operator(const LinearOperator<typename Range::BlockType, typename Domain::BlockType> &op)
{
static_assert(m > 0,
template <typename Range = Vector<double>,
typename Domain = Range,
typename Matrix>
-LinearOperator<Range, Domain> linop(const Matrix &matrix)
+LinearOperator<Range, Domain> linear_operator(const Matrix &matrix)
{
// implement with the more generic variant below...
- return linop<Range, Domain, Matrix, Matrix>(matrix, matrix);
+ return linear_operator<Range, Domain, Matrix, Matrix>(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
*/
template <typename Range = Vector<double>,
typename Domain = Range,
- typename Exemplar,
+ typename OperatorExemplar,
typename Matrix>
-LinearOperator<Range, Domain> linop(const Exemplar &exemplar,
- const Matrix &matrix)
-{
+LinearOperator<Range, Domain>
+linear_operator(const OperatorExemplar &operator_exemplar,
+ const Matrix &matrix) {
LinearOperator<Range, Domain> 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<Range>().operator()(exemplar);
+ internal::LinearOperator::ReinitRangeFactory<Range>().operator()(
+ operator_exemplar);
return_op.reinit_domain_vector =
- internal::LinearOperator::ReinitDomainFactory<Domain>().operator()(exemplar);
+ internal::LinearOperator::ReinitDomainFactory<Domain>().operator()(
+ operator_exemplar);
typename std::conditional<
has_vmult_add<Range, Domain, Matrix>::type::value,
// 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;
}
// 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<double>, dealii::Vector<double>> op_x (a);
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());
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::
// Constructors and assignment:
- auto op_a = linop<BlockVector<double>>(a);
- auto op_b = linop<BlockVector<double>>(b);
+ auto op_a = linear_operator<BlockVector<double>>(a);
+ auto op_b = linear_operator<BlockVector<double>>(b);
{
decltype(op_a) op_x (a);
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<BlockVector<double>> 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());
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
TrilinosWrappers::SparseMatrix a;
- auto op_a = linop<TrilinosWrappers::MPI::Vector>(a);
- auto op_a2 = linop<TrilinosWrappers::Vector>(a);
+ auto op_a = linear_operator<TrilinosWrappers::MPI::Vector>(a);
+ auto op_a2 = linear_operator<TrilinosWrappers::Vector>(a);
TrilinosWrappers::BlockSparseMatrix b;
- auto op_b = linop<TrilinosWrappers::MPI::BlockVector>(b);
- auto op_b3 = linop<TrilinosWrappers::BlockVector>(b);
+ auto op_b = linear_operator<TrilinosWrappers::MPI::BlockVector>(b);
+ auto op_b3 = linear_operator<TrilinosWrappers::BlockVector>(b);
deallog << "OK" << std::endl;
//
// ---------------------------------------------------------------------
-// Tests for block_linop
+// Tests for block_operator
#include "../tests.h"
a.block(1, 0).set(i, i, 1.);
- auto op_a = linop<BlockVector<double>>(a);
+ auto op_a = linear_operator<BlockVector<double>>(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<double>>({op_b00, op_b01, op_b10, op_b11});
+ block_operator<2, 2, BlockVector<double>>({op_b00, op_b01, op_b10, op_b11});
// vmult:
// And finally complicated block structures:
- auto op_upp_x_upu = block_linop<3, 3, BlockVector<double>>(
+ auto op_upp_x_upu = block_operator<3, 3, BlockVector<double>>(
{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);
PRINTME("v", v);
auto op_upp_x_p =
- block_linop<3, 1, BlockVector<double>>({op_b01, op_b11, op_b11});
+ block_operator<3, 1, BlockVector<double>>({op_b01, op_b11, op_b11});
auto op_u_x_upu =
- block_linop<1, 3, BlockVector<double>>({op_b00, op_b01, op_b00});
+ block_operator<1, 3, BlockVector<double>>({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) {
//
// ---------------------------------------------------------------------
-// Test linop constructor for full and reduced interface:
+// Test linear_operator constructor for full and reduced interface:
#include "../tests.h"
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);
}
//
// ---------------------------------------------------------------------
-// Tests for blockdiagonal_linop
+// Tests for block_diagonal_operator
#include "../tests.h"
a.block(2, 2).set(i, i, 3.);
- auto op_a = linop<BlockVector<double>>(a);
+ auto op_a = linear_operator<BlockVector<double>>(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<double>>({op_b0, op_b1, op_b2});
+ block_diagonal_operator<3, BlockVector<double>>({op_b0, op_b1, op_b2});
// vmult:
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<double>>({op_b0, op_b0, op_b0, op_b0, op_b0});
+ auto op_c = block_diagonal_operator<5, BlockVector<double>>({op_b0, op_b0, op_b0, op_b0, op_b0});
- auto op_d = blockdiag_linop<5, BlockVector<double>>(op_b0);
+ auto op_d = block_diagonal_operator<5, BlockVector<double>>(op_b0);
op_c.reinit_domain_vector(u, false);
for (unsigned int i = 0; i < u.size(); ++i) {
SparseMatrix<double> a (sparsity_pattern);
- auto op_a = linop(a);
+ auto op_a = linear_operator(a);
Vector<double> u;
op_a.reinit_domain_vector(u, false);
BlockSparseMatrix<double> a (sparsity_pattern);
- auto op_a = linop<BlockVector<double>>(a);
+ auto op_a = linear_operator<BlockVector<double>>(a);
BlockVector<double> u;
op_a.reinit_domain_vector(u, false);