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/