# [deal.II] Re: increment Dirichlet boundary condition

```Hi IIiya,

On Thursday, February 22, 2018 at 11:55:33 AM UTC+1, Bryukhanov Ilya wrote:
>
> Denis, thanks a lot for the answer!
>
> I think that on the first step I can use usual
> "interpolate_boundary_values + apply_boundary_values" functions,
>```
```
the outline I gave above is agnostic to "first step"/"other steps", you
would call VectorTools::interpolate_boundary_values() regardless
stage to get constraints into the ConstraintMatrix object. If you do
Newton-Raphson and solve for increments, at the first non-linear step you
should have all constraints (hanging nodes + non-zero Dirichlet for a given
nodes plus zero Dirichlet.

https://www.dealii.org/developer/doxygen/deal.II/group__constraints.html

This code-gallery may help in figuring out how to do
this:
https://www.dealii.org/developer/doxygen/deal.II/code_gallery_Quasi_static_Finite_strain_Compressible_Elasticity.html

> that transform the global matrix: columns of the constrained nodes become
> zero columns with diagonal non-zero entries.
>
> In a time loop I have to account boundary condition without modifing
> global matrix. While looping over dirichlet constrained cells
> I call the function
> "hanging_node_constraints.distribute_local_to_global(cell_rhs,
> local_dof_indices, system_rhs, cell_matrix)"
> which modifies the system_rhs vector by adding columns from constrained
> nodes, which are actually zero in global matrix.
>

Nope, if your "hanging_node_constraints" indeed contains only constraints
from hanging nodes, you won't see any contribution to the RHS
from it as constraints are homogeneous (ie. you wont' have  u_{123} = 456
from hanging nodes).

>
> Also I need to add components to rhs vector from the force boundary
> conditions.
>

that's a different story, just do integration over faces and distribute as
usual.

>
> However, I have to somehow account Dirichlet boundary conditions as in
> previous step I didn't use any boundary values. The function
>

use ConstraintMatrix which has non-zero Dirichlet BC constraints.

> "interpolate_boundary_values(dof_handler, boundary_id, DirichletHandler,
> boundary_values)"
> gives me "boundary_values" variables that maps node numbers to dirichle
> boundary.
>
> But I don't know how should I use it. What should I do with that variable
> to account boundary conditions together with "distribute_local_to_global"?
>
> Thanks a lot in advance. Sorry for my misunderstanding.
>

Regards,
Denis.

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see