# [deal.II] Adding rows on system matrix connecting to dof

```Hi, all

I have a question on using deal.ii for solving unknown boundary condition
problem.
I have thought the most minimized related to my question. ```
```
where I consider a navies slip boundary condition, and I have tried to
solve this with finite difference.
For more demonstration please see following screenshot.

Finite Difference Formulation might be...

where the last raw of matrix is added to show boundary condition at lower
plate.

and I think problem is generally well posed so that I can solve this with

Now, I am trying to solve same problem using finite element method...

The description of same boundary condition in weak form will look like

has on the boundary

for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell;
++face)

{ if (cell->face(face)->boundary_id() == 2)

{  for (unsigned int q=0; q<n_face_q_points; ++q)

{ for (unsigned int i=0; i<dofs_per_cell; ++i)

{for (unsigned int j=0; j<dofs_per_cell; ++j)

{cell_matrix(i,j) += (1/beta)*fe_values.shape_value
(i, q_index)*

fe_values.shape_value (j,
q_index)

* fe_face_values.JxW(q);}

cell_rhs(i) += 0;

}//i cycle

}

}//end of face cycle

and I think I should add this cell_matrix(i,j) and cell_rhs(i) to my system
matrix.

but not overlapping the rows that describe weakform of original poisson
equation.. so I think i should not use them...

for (unsigned int i=0; i<dofs_per_cell; ++i)

{

for (unsigned int j=0; j<dofs_per_cell; ++j)

local_dof_indices[j],

cell_matrix(i,j));

system_rhs(local_dof_indices[i]) += cell_rhs(i);

}

In this situation, how should I expand (to add rows) my system matrix and
connect to it boundary dof ?

Thanks...

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