How to set up constraints for several different variables at the boundary?

30 views
Skip to first unread message

Lex Lee

unread,
Mar 27, 2020, 7:08:25 AM3/27/20
to deal.II User Group
Hello all, 


In order to handle the constraint : (v-v_s) \times n=\phi (v_f -v_s) \times n at the boundary in my research problem, I designed the following test problem to play with ConstraintsMatrix in deal.ii.
 (n is the normal vector, and v, v_s, v_f are the velocities of three phases. They and their test functions satisfy the constraints mentioned above at the boundary)

Back to the designed problem below. My question is how to set up constraints on both u and v at the boundary form Gamma_1 to Gamma_4 in the picture? Can someone give me some hints? 

Many thanks in advance.

elohllkbicdofljg.png



Best,

Lex


Wolfgang Bangerth

unread,
Mar 29, 2020, 1:24:49 PM3/29/20
to dea...@googlegroups.com

Alex,

> In order to handle the constraint : (v-v_s) \times n=\phi (v_f -v_s) \times n
> at the boundary in my research problem, I designed the following test problem
> to play with ConstraintsMatrix in deal.ii.
>  (n is the normal vector, and v, v_s, v_f are the velocities of three phases.
> They and their test functions satisfy the constraints mentioned above at the
> boundary)
>
> Back to the designed problem below. My question is how to set up constraints
> on both u and v at the boundary form Gamma_1 to Gamma_4 in the picture? Can
> someone give me some hints?

In essence, you will have to go do something like this:

std::vector<types::global_dof_index> face_dof_indices (fe.dofs_per_face);
for (auto &cell : ...)
for (auto &face : cell->face_iterators())
if (face->at_boundary() &&
(face->boundary_indicator() is interesting))
{
face->get_dof_indices(face_dof_indices);

...
}

In "...", you then need to identify pairs of DoFs that are co-lated and
correspond to the components that you want to tie together. If you have
several components and they all use the same finite element, then that's easy,
because face_dof_indices will contain indices in the order
u1, v1, w1, u2, v2, w2, u3, v3, w3, ...
and you can then constrain ui against vi, etc. It gets a bit more complicated
if you have multiple components in your FESystem, but only some of these are
of interest and/or there are different elements involved.

Best
W.


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

Reply all
Reply to author
Forward
0 new messages