Overriden Function<dim>::value not being called

33 views
Skip to first unread message

Javier Almonacid

unread,
Nov 18, 2023, 8:01:35 PM11/18/23
to deal.II User Group
Hi everyone,

I am trying to implement a Dirichlet boundary condition for a problem very similar to step-44. The boundary condition is just a displacement in the +x direction on the +x face of a cube. However, when I call VectorTools::interpolate_boundary_values, it seems it's calling a default (zero?) version of Function<dim>::value rather than IncrementalDisplacement<dim>::value, which should override the default value function. 

Any help on how to solve this issue would be appreciated.

Attached is a minimal working example. In my opinion, if my overridden function is being called, then the cout statement inside of it ("Overridden value function called") should be displayed, right? 

Some things I've tried:
  • Removing the "override" keyword and see if deal.II would raise an exception. The program runs entirely and nothing is displayed on the terminal.
  • Calling the function IncrementalDisplacement<dim>::value directly. This works fine.
  • Overloading vector_value and vector_value_list. Same thing, these functions are not being called either.
  • Stepping into the VectorTools::interpolate_boundary_values function using gdb, but the output is the following:
(gdb) step
dealii::VectorTools::interpolate_boundary_values<3, 3, double> (dof=..., boundary_component=1, boundary_function=..., constraints=..., component_mask=...)
    at /home/javier/dealii-9.3/tmp/unpack/deal.II-v9.3.2/include/deal.II/numerics/vector_tools_boundary.templates.h:603
603     /home/javier/dealii-9.3/tmp/unpack/deal.II-v9.3.2/include/deal.II/numerics/vector_tools_boundary.templates.h: No such file or directory.

Thanks!
Javier
test_bc.cc

Praveen C

unread,
Nov 18, 2023, 11:26:30 PM11/18/23
to Deal. II Googlegroup
Hello

You have specified boundary_indicator=1 when you call interpolate_boundary_values, but all boundaries are marked with indicator 0.

You did not specify colorize=True option when creating the mesh, so all boundaries are marked as 0.

So your function is fine, you just never called it.

best
praveen



--
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 dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/b88e509a-8535-47f2-b49e-54ac8f1fa16bn%40googlegroups.com.
<test_bc.cc>

Reply all
Reply to author
Forward
0 new messages