Hello,

This is not how you should activate elements. Instead **before**  you call 
triangulation.prepare_coarsening_and_refinement(), you call your 
activate_FE function but instead of using set_active_fe_index() you call 
set_future_fe_index().

Best,

Bruno

On Wednesday, January 17, 2024 at 4:25:33 PM UTC-5 luis....@gmail.com wrote:

> Hello all,
>
> I am trying to add cells to the domain during a time-dependent calculation 
> using mesh refinement. To do so, I made an FE collection and set some cells 
> to FE_Nothing at the beggining and  then changed them back to FE_Q at a 
> given time step right after executing 
> triangulation.execute_coarsening_and_refinement();
>
> However, I get the following error that I am not able to fix when I 
> interpolate between meshes during the refinement:
>
> The violated condition was:
>     local_values_old[i] == number() || get_abs(local_values_old[i] - 
> local_values[i]) <= get_abs(local_values_old[i] + local_values[i]) * 
> 100000. * std::numeric_limits<typename numbers::NumberTraits< 
> number>::real_type>::epsilon()
> Additional information:
>     Called set_dof_values_by_interpolation(), but the element to be set,
>     value 0, does not match with the non-zero value 5.270338238394919e-05
>     already set before.
>
> This error does not happen if instead of activating, I deactivate cells 
> during the simulation. Anyone has any suggestions?
> I have attached my code.
>
> Thank you for your time,
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/2e2baf78-fd8d-4bba-820e-a68efb0907een%40googlegroups.com.

Reply via email to