Re: [deal.II] Dirichlet boundary condition (homogeneous) on selected dofs

2020-01-28 Thread Wolfgang Bangerth


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.

Best
  W.

-- 

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

-- 
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/bc6e54ee-9d9e-6760-9653-db261ef7382c%40colostate.edu.


Re: [deal.II] Dirichlet boundary condition (homogeneous) on selected dofs

2020-01-26 Thread Krishanu Sen
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

On Sunday, 26 January 2020 09:12:24 UTC-6, Wolfgang Bangerth wrote:
>
> 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() 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/ 
>
>

-- 
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/7fec7938-57f5-4f09-984d-4673ff2e3351%40googlegroups.com.


Re: [deal.II] Dirichlet boundary condition (homogeneous) on selected dofs

2020-01-26 Thread Wolfgang Bangerth
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() 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: bange...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

-- 
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/1630c99d-2ff4-46c8-aced-89165a2878fc%40colostate.edu.