Dirichlet boundary condition (homogeneous) on selected dofs

49 views
Skip to first unread message

Krishanu Sen

unread,
Jan 25, 2020, 6:10:07 PM1/25/20
to deal.II User Group
I am trying to use the BlockSparseMatrix setup following step - 22.

I am able to understand that step-22 has Dirichlet boundary condition on all the degrees of freedom corresponding to displacement components. But I am trying to have the Dirichlet boundary conditions on only some of the degrees of freedom (e. g. all x dofs on the boundary and only one (this one is to prevent rigid body motion) of the y dofs). To do that, I think some modifications are needed in the BoundaryValues<dim>() function and the part where 'interpolate_boundary_values' is used in the 'setup_dofs'. But I am not able to figure out what the modifications would actually be.

I would be glad if I could get some suggestions/reference.

Thanks,
Krishanu

Wolfgang Bangerth

unread,
Jan 26, 2020, 10:12:24 AM1/26/20
to dea...@googlegroups.com
On 1/25/20 4:10 PM, Krishanu Sen wrote:
>
> I am able to understand that step-22 has Dirichlet boundary condition on all
> the degrees of freedom corresponding to displacement components. But I am
> trying to have the Dirichlet boundary conditions on only some of the degrees
> of freedom (e. g. all x dofs on the boundary and only one (this one is to
> prevent rigid body motion) of the y dofs). To do that, I think some
> modifications are needed in the BoundaryValues<dim>() function and the part
> where 'interpolate_boundary_values' is used in the 'setup_dofs'. But I am not
> able to figure out what the modifications would actually be.

step-22 actually only uses Dirichlet boundary conditions on the top surface.
This is done by setting different boundary indicators for the different parts
of the boundary, and interpolating Dirichlet boundary conditions for only one
of these boundary indicators.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Krishanu Sen

unread,
Jan 26, 2020, 5:33:34 PM1/26/20
to deal.II User Group
Thanks, Prof. Bangerth for your response.

I understood that the the Dirichlet boundary condition in this problem was being applied on only the top surface. But what I am trying to implement seems a little different to me. I will try to explain in a little more detail with an example in the following part.

I have a a part of boundary with boundary indicator 2 which has two nodes. Each node has 3 degrees of freedom: displacements along x and y, and pressure.

I am trying to implement x displacement to be 0 on both the nodes on this part of the boundary, and y displacement to be 0 on only one of these nodes. I felt that this is a little different from step-22 as in that case all the degrees of freedom corresponding to displacements on the part of the boundary (top surface) were constrained.

I would be happy to learn about your thoughts on this.

Thanks,
Krishanu

Wolfgang Bangerth

unread,
Jan 28, 2020, 8:24:15 AM1/28/20
to dea...@googlegroups.com, Krishanu Sen

Krishanu,

> I understood that the the Dirichlet boundary condition in this problem was
> being applied on only the top surface. But what I am trying to implement seems
> a little different to me. I will try to explain in a little more detail with
> an example in the following part.
>
> I have a a part of boundary with boundary indicator 2 which has two nodes.
> Each node has 3 degrees of freedom: displacements along x and y, and pressure.
>
> I am trying to implement x displacement to be 0 on both the nodes on this part
> of the boundary, and y displacement to be 0 on only one of these nodes. I felt
> that this is a little different from step-22 as in that case all the degrees
> of freedom corresponding to displacements on the part of the boundary (top
> surface) were constrained.

Yes, that should not be too difficult to do if you get the semantics right.

First, VectorTools::interpolate_boundary_values() has an additional argument
that lets you specify which vector components you want to constrain. So if you
mark a part of the boundary as, say, boundary_id=1, then you can call
VectorTools::interpolate_boundary_values() with an argument that makes sure
that both x and y displacement are set to something. If a different part of
the boundary, say with boundary_id=2, should have only the x-component
constrained, then you just call VectorTools::interpolate_boundary_values() for
that boundary but with a different optional argument that specifies that you
only want to select the x-component.

Regarding semantics: When you say "I have a a part of boundary with boundary
indicator 2 which has two nodes", then this is the wrong way to approach the
problem. Boundary conditions are posed on *parts of the boundary* (i.e.,
faces!), not at individual nodes. You should really think about this in terms
of the domain boundary, not in terms of the mesh you use to discretize the
domain. This also ensures that the right thing happens upon mesh refinement.
Reply all
Reply to author
Forward
0 new messages