Hello all,
I designed a coupled Laplace problem to play with ConstraintMatrix for
coupled components. On face \Gamma_4 and \Gamma_2, I let u=0.5v-0.5,
v=2u+1, respectively .
[image: Screen Shot 2020-04-05 at 4.14.41 PM.png]
Both u and v use the same finite element: FE_Q<*dim*>(1), 1, and
'block_component (2, 0)' is used to store the relevant scalar values.
Below is the pieces of incompleted codes for my trying to identify pairs of
DoFs that are coupled and correspond to u and v components.
However, this part doesn't work.
Could you kindly help me check some lines? Thanks!
*for* (*const* *auto* &cell : dof_handler.active_cell_iterators())
{
*for* (*unsigned* *int* face_number = 0; face_number < GeometryInfo<
*dim*>::faces_per_cell; ++face_number)
{
*if* (cell->face(face_number)->at_boundary() &&
( cell->face(face_number)->boundary_id() == 4 ) )
{
std::vector<*unsigned* *int*> local_face_dof_indices (fe.dofs_per_face
);
//unsigned int n_nodes=fe.dofs_per_face/2.0;//n_node=1 dofs=u,v
{
cell->face(face_number)->get_dof_indices (local_face_dof_indices);
std::vector<*unsigned* *int*> u_i(fe.dofs_per_face),v_i(fe.
dofs_per_face);
*unsigned* *int* component;
{
*for* (*unsigned* *int* i=0; i<local_face_dof_indices.size(); ++i)
{
component=fe.face_system_to_component_index(i).first;
*if*(component==0)
{
u_i[i]=local_face_dof_indices[i];
}
*else*
{
v_i[i]=local_face_dof_indices[i];
}
constraints.add_line(u_i[i]);
constraints.add_line(v_i[i]);
constraints.add_entry(u_i[i],v_i[i],0.5);
constraints.set_inhomogeneity(u_i[i],-0.5);
Lex
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/1d7faba0-ae5b-428a-8b40-4701551732cc%40googlegroups.com.