Hello everyone,
I am working on a multi-physics problem (fluid and solid domains) using an hp::FECollection similar to the layout in step-46. My collection is defined as:
fluid_fe(FE_Q<dim>(degree), FE_RaviartThomasNodal<dim>(degree), FE_DGQ<dim>(degree)),
wall_fe(FE_Nothing<dim>(), FE_RaviartThomasNodal<dim>(degree), FE_DGQ<dim>(degree)),
I want to constrain the first finite element (FE_Q, component 0) to zero along the fluid-solid interface. Because my system contains a non-primitive vector element (FE_RaviartThomasNodal), standard primitive functions like face_system_to_component_index cause assertion crashes if called directly on all face DoFs.I have thought of two potential strategies to isolate and constrain only the primitive FE_Q dofs on the interface face.
First approach is to use is_primitive to safely filter out the non-primitive Raviart-Thomas face shape functions before querying the components:
// ... [Interface detection loops from step-46] ... if(face_is_on_solid_boundary)
{
// v = 0 on boundary condition
cell->face(face_no)->get_dof_indices(local_face_dof_indices,0);
for(unsigned int i = 0; i < local_face_dof_indices.size();++i)
{
if(fluid_fe.is_primitive(fluid_fe.face_to_cell_index(i, face_no)))
{
if(fluid_fe.face_system_to_component_index(i).first == 0)
constraints.constrain_dof_to_zero(local_face_dof_indices[i]);
}
}
}
Second approach is to utilize system_to_block_index() to target the first block directly, which circumvents checking component indices:
// ... [Interface detection loops from step-46] ...if(face_is_on_solid_boundary)
{
// v = 0 on boundary condition
cell->face(face_no)->get_dof_indices(local_face_dof_indices,0);
for(unsigned int i = 0; i < local_face_dof_indices.size();++i)
{
if(fluid_fe.system_to_block_index(fluid_fe.face_to_cell_index(i, face_no) ).first == 0)
constraints.constrain_dof_to_zero(local_face_dof_indices[i]);
}
}
My questions are
1. Which of these two approaches is considered the correct or safest way in deal.II when handling a mix of primitive and non-primitive elements in an hp context?
2. I am also aware of face_system_to_base_index(i). How does this function differ from the 2 functions used above in this context and would it be a better alternative?
Any advice or feedback would be greatly appreciated!
Regards,
Devansh Sonigra.