Strong dirichlet with FE_RaviartThomasNodal

22 views
Skip to first unread message

Praveen C

unread,
Sep 15, 2025, 7:34:08 AM (8 days ago) Sep 15
to Deal. II Googlegroup
Hello

To test how to implement 

u.n = 0

in step-20 which uses FE_RaviartThomas for u, I know from here


that we cannot do this.

But if I change to FE_RaviartThomasNodal, 

  template <int dim>
  MixedLaplaceProblem<dim>::MixedLaplaceProblem(const unsigned int degree)
    : degree(degree)
    , fe(FE_RaviartThomasNodal<dim>(degree), 1, FE_DGQ<dim>(degree), 1)
    , dof_handler(triangulation)
  {}


I thought following should work

      std::map<types::global_dof_index, double> vel_boundary_values;
      ComponentMask vel_mask = fe.component_mask(velocities);
      VectorTools::interpolate_boundary_values(dof_handler,
                                               types::boundary_id(0),
                                               Functions::ZeroFunction<2>(3),
                                               vel_boundary_values,
                                               vel_mask);

but it does not

--------------------------------------------------------
An error occurred in line <263> of file </Users/praveen/Applications/deal.II/9.6.0/include/deal.II/numerics/vector_tools_boundary.templates.h> in function
    void dealii::VectorTools::internal::do_interpolate_boundary_values(const M_or_MC<dim, spacedim> &, const DoFHandler<dim, spacedim> &, const std::map<types::boundary_id, const Function<spacedim, number> *> &, std::map<types::global_dof_index, number> &, const ComponentMask &) [dim = 2, spacedim = 2, number = double, M_or_MC = dealii::Mapping]
The violated condition was:      fe.is_primitive(i)
Additional information:      This function can only deal with requested boundary values that
    correspond to primitive (scalar) base elements. You may want to look
    up in the deal.II glossary what the term 'primitive' means.
         There are alternative boundary value interpolation functions in
    namespace 'VectorTools' that you can use for non-primitive finite
    elements.

But FE_RaviartThomasNodal actually has nodal dofs on the boundary which fix u.n.

Is this not working because it is not implemented, or it is not possible to do this at all ?

thanks
praveen

Wolfgang Bangerth

unread,
Sep 15, 2025, 6:39:59 PM (7 days ago) Sep 15
to dea...@googlegroups.com

On 9/15/25 05:33, Praveen C wrote:
> The violated condition was:      fe.is_primitive(i)
> Additional information:      This function can only deal with requested
> boundary values that
>     correspond to primitive (scalar) base elements. You may want to look
>     up in the deal.II glossary what the term 'primitive' means.
>          There are alternative boundary value interpolation functions in
>     namespace 'VectorTools' that you can use for non-primitive finite
>     elements.
>
> But FE_RaviartThomasNodal actually has nodal dofs on the boundary which
> fix u.n.
>
> Is this not working because it is not implemented, or it is not possible
> to do this at all ?

Praveen:
the issue is with this part of the error message:
This function can only deal with requested boundary values that
correspond to primitive (scalar) base elements.
The issue is that the function you're trying to call is trying to
evaluate the boundary values at the node points, and then assign that
value to the corresponding degree of freedom (=element in the solution
vector). But in the case you're considering here, the degree of freedom
value isn't supposed to be f(x_j), but f(x_j).n(x_j). The function just
doesn't know that because it's specific to the finite element what node
functionals are supposed to represent.

I believe that there are other functions that can deal with boundary
values for H_div conforming elements. There would also be ways to
implement computing the boundary values that make use of the concept of
"generalized support points" (see the glossary) but I don't recall
whether any of the functions for boundary values make use of this concept.

Best
W.
Reply all
Reply to author
Forward
0 new messages