Dear Lixing,
I think you are right. In Newton's method, the entries of the residual
vector which correspond to degrees of freedom that are constrained through
a Dirichlet boundary condition should vanish. In step-57, this is achieved
using the member variable AffineConstraints<double> zero_constraints and
the constraints are enforced during the assembly process by calling
AffineConstraints<double>::distribute_local_to_global. Since inhomogeneous
boundary conditions are applied in step-57, a switch between the
inhomogeneous and homogeneous constraints is necessary. The inhomogeneous
constraints are actually only used in the very first assembly of the linear
system (system matrix and right-hand side vector). In all subsequent
assemblies of the residual vector and the linear system, the homogeneous
constraints are used. This is achieved by
const AffineConstraints<double> &constraints_used =
initial_step ? nonzero_constraints : zero_constraints;
In step-15, Dirichlet boundary conditions and hanging node constraints are
not treated using a joint AffineConstraints<double> object. The hanging
node constraints are enforced through an explicit condensation after
assembling the system matrix and right-hand side vector by means of an
AffineConstraints<double> object. The Dirichlet boundary conditions are
then enforced by calling MatrixTools::apply_boundary_values and by
explicitly setting them to zero in the residual vector. In step-15, only
homogeneous constraints are applied because the solution automatically
satisfies them due to the call to the method set_boundary_values.
Both approaches are equivalent, but should not be confused or mixed. I
prefer the way of step-57, but this is a personal flavor. I hope my
comments are helpful.
Best wishes,
Sebastian
Lixing Zhu schrieb am Sonntag, 10. April 2022 um 20:00:14 UTC+2:
> Hi all,
>
> I am confused with Newton's method's residual computation (i.e., L2 norm
> of the system residual vector) in Step-15 and Step-57.
>
> In Step-15, to eliminate the residual component corresponding to the
> Dirichlet boundary condition, DOFTools::extract_boundary_dofs() is used to
> explicitly make those components zero.
>
> However, in Step-57, there seems no explicit treatment to eliminate the
> residual components on the Dirichlet boundary in the computation of
> residuals in each iteration within Newton's method. Is this because of the
> zero_constraints?
>
> Regards,
> Lixing
>
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/fc11dd66-76ad-4da7-b152-399c3ceda7bcn%40googlegroups.com.