multigrid and multiple boundary id's

104 views
Skip to first unread message

bou...@gmail.com

unread,
Mar 15, 2013, 12:33:07 PM3/15/13
to dea...@googlegroups.com
Hello everyone!

I'm trying to use multigrid preconditioner in conjunction with adaptive mesh refinement for a laplace problem as described in step-16. However, the boundary domain comprises of several boundary id's, at each of which a different non-homogeneous dirichlet condition holds. I don't know how to implement these conditions in the code, as in the step-16 tutorial only the homogeneous case of only one boundary id is presented. I suppose the only difference will be in the "interpolate_boundary_values" function in the "setup_system" function. But I don't know how to make a "dirichlet_boundary" object that will describe the boundary that I need.

Thanks in advance!

George

Fan Bai

unread,
Mar 15, 2013, 4:47:31 PM3/15/13
to dea...@googlegroups.com
Hi George,

I think in the function "interpolate_boundary_values", there is a parameter "component_mask" in it can identify how to interpolate Dirichlet BVs, you can set a pointer before this function (in the part of assembly). 

Best,
Fan


--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

bou...@gmail.com

unread,
Mar 16, 2013, 9:21:20 AM3/16/13
to dea...@googlegroups.com
As I read in the documentation, the first thing that I need to do is create a map of boundary ID's and functions. Therefore, each (constant in my case) function will be attached to a boundary id. So, the question now becomes, how do I create such a map that can be used as argument in the "interpolate_boundary_values" function?

And the next question will be, do I need to change anything else in the code of step-16 in order to implement the multiple boundary id's - nonhomogeneous dirichlet bcs?

Thanks again,

George

bou...@gmail.com

unread,
Mar 18, 2013, 6:36:42 AM3/18/13
to dea...@googlegroups.com
Guys please for any help! I must solve it by tomorrow!

Martin Steigemann

unread,
Mar 18, 2013, 6:46:39 AM3/18/13
to dea...@googlegroups.com
Hi George,

do you mea something like this:

    constraints.clear ();
    constraints.reinit (locally_relevant_dofs);
    DoFTools::make_hanging_node_constraints (dof_handler, constraints);

    typename FunctionMap<dim>::type  dirichlet_boundary;

    ZeroFunction<dim>  homogeneous_dirichlet_bc (dim);

    dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
    dirichlet_boundary[1] = &homogeneous_dirichlet_bc;
    dirichlet_boundary[2] = &homogeneous_dirichlet_bc;

    VectorTools::interpolate_boundary_values (dof_handler,
                                              dirichlet_boundary,
                                              constraints);
    constraints.close ();


Best,
Martin

Jean-Paul Pelteret

unread,
Mar 18, 2013, 6:55:21 AM3/18/13
to dea...@googlegroups.com
Hi George,

If you look at step-18, you will see an example of the creation of non-trivial BC's for multiple boundaries. The map to which you refer is initially empty and is filled by the VectorTools::interpolate_boundary_values calls. You then use the MatrixTools::apply_boundary_values function to apply the constraints to your system.

Regards,
J-P

bou...@gmail.com

unread,
Mar 22, 2013, 9:41:50 AM3/22/13
to dea...@googlegroups.com
Guys thanks for your help!

Finally I did what Martin suggested and it worked.

Thanks again!

G.
Reply all
Reply to author
Forward
0 new messages