From 38485c0eff99cfa79aeaa7352a341f3299794c88 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 25 Oct 2015 14:14:22 -0500 Subject: [PATCH] address comments --- doc/doxygen/headers/constraints.h | 18 +++++++++--------- doc/news/changes.h | 6 +++--- ...perator.h => constrained_linear_operator.h} | 15 ++++++++------- tests/lac/constraint_linear_operator_01.cc | 6 +++--- 4 files changed, 23 insertions(+), 22 deletions(-) rename include/deal.II/lac/{constraint_linear_operator.h => constrained_linear_operator.h} (94%) diff --git a/doc/doxygen/headers/constraints.h b/doc/doxygen/headers/constraints.h index 93f740e4ae..ab9c8179d6 100644 --- a/doc/doxygen/headers/constraints.h +++ b/doc/doxygen/headers/constraints.h @@ -437,8 +437,8 @@ *

Applying constraints indirectly with a LinearOperator

* * Sometimes it is either not desirable, or not possible to directly - * condensate, or eliminate constraints from a system of linear equations. - * In particular if there is no underlying matrix object that could be + * condense, or eliminate constraints from a system of linear equations. In + * particular if there is no underlying matrix object that could be * condensed (or taken care of constraints during assembly). This is * usually the case if the system is described by a LinearOperator. * @@ -446,8 +446,11 @@ * @f[ * (C^T A C + Id_c) \tilde x = C^T (b - A\,k) * @f] - * instead [1]. Here, $A$ is a given (unconstrained) system matrix $A$ and - * $b$ the corresponding right hand side of a system of linear equations + * instead [1] (M. S. Shephard: Linear multipoint constraints applied via + * transformation as part of a direct stiffness assembly process, 1985). + * + * Here, $A$ is a given (unconstrained) system matrix and $b$ + * the corresponding right hand side of a system of linear equations * $A\,x=b$. The matrix $C$ describes the homogeneous part of the linear * constraints stored in a ConstraintMatrix and the vector $k$ is the * vector of corresponding inhomogeneities. More precisely, the @@ -459,13 +462,13 @@ * And finally, $Id_c$ denotes the identity on the subspace of constrained * degrees of freedom. * - * The corresponding solution of $A\,x=b$ that obeys boundary conditions is + * The corresponding solution of $A\,x=b$ that obeys these constraints is * then recovered by distributing constraints: $x=C\tilde x+k$. * * The whole system can be set up and solved with the following snippet of * code: * @code - * #include + * #include * * // ... * @@ -484,7 +487,4 @@ * solver.solve(op_amod, solution, rhs_mod, preconditioner); * constraint_matrix.distribute(solution); * @endcode - * - * [1] M. S. Shephard: Linear multipoint constraints applied via - * transformation as part of a direct stiffness assembly process, 1985. */ diff --git a/doc/news/changes.h b/doc/news/changes.h index 41390297b7..7e03f5a700 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -184,9 +184,9 @@ inconvenience this causes.

General

  1. New: constrained_linear_operator() and constrained_right_hand_side() - implemented that provide a generic mechanism of applying constraints to a - LinearOperator. A detailed explanation with example code is given in the - @ref constraints module. + provide a generic mechanism of applying constraints to a LinearOperator. + A detailed explanation with example code is given in the @ref constraints + module.
    (Mauro Bardelloni, Matthias Maier, 2015/10/25 - 2015/12/27)
  2. diff --git a/include/deal.II/lac/constraint_linear_operator.h b/include/deal.II/lac/constrained_linear_operator.h similarity index 94% rename from include/deal.II/lac/constraint_linear_operator.h rename to include/deal.II/lac/constrained_linear_operator.h index 699d63a3b0..0597ae2baa 100644 --- a/include/deal.II/lac/constraint_linear_operator.h +++ b/include/deal.II/lac/constrained_linear_operator.h @@ -13,8 +13,8 @@ // // --------------------------------------------------------------------- -#ifndef dealii__constraint_linear_operator_h -#define dealii__constraint_linear_operator_h +#ifndef dealii__constrained_linear_operator_h +#define dealii__constrained_linear_operator_h #include #include @@ -32,15 +32,16 @@ DEAL_II_NAMESPACE_OPEN /** - * This function takes a ConstraintMatrix @p cm and an operator exemplar @p - * exemplar (this exemplar is usually a linear operator that describes the - * system matrix) and returns a LinearOperator object associated with the - * "homogeneous action" of the underlying ConstraintMatrix object: + * This function takes a ConstraintMatrix @p constraint_matrix and an + * operator exemplar @p exemplar (this exemplar is usually a linear + * operator that describes the system matrix) and returns a LinearOperator + * object associated with the "homogeneous action" of the underlying + * ConstraintMatrix object: * * Applying the LinearOperator object on a vector u results in * a vector v that stores the result of calling * ConstraintMatrix::distribute() on u - with one important - * difference; inhomogeneities are note applied, but always treated as 0 + * difference: inhomogeneities are note applied, but always treated as 0 * instead. * * The LinearOperator object created by this function is primarily used diff --git a/tests/lac/constraint_linear_operator_01.cc b/tests/lac/constraint_linear_operator_01.cc index 188f8baa4d..f0c6e4e5c7 100644 --- a/tests/lac/constraint_linear_operator_01.cc +++ b/tests/lac/constraint_linear_operator_01.cc @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include @@ -192,8 +192,8 @@ void Step6::solve () const auto A = linear_operator(system_matrix_lo); const auto M = constrained_linear_operator(constraints, A); - Vector rhs = - constrained_right_hand_side(constraints, A, system_rhs_lo); + const auto rhs = constrained_right_hand_side(constraints, A, + system_rhs_lo); check_solver_within_range( solver.solve(M, solution_lo, rhs, preconditioner), -- 2.39.5