Changing time step

34 views
Skip to first unread message

BBah

unread,
Jul 18, 2022, 5:00:56 AM7/18/22
to deal.II User Group
Hello everybody,

i am trying to change my timestep after few simulations steps but i am getting a kink into my solution once i reduce my timestep.
I did this actually simple by adjusting my timestep once a certain time is reached when i apply the dirichlet boundary conditions:

          if(time.current() > trans*first_loading)
          {
          time.adjust_timestep_size(0);
          const double delta_length = parameters.stretch1;
          const unsigned int n_stretch_steps = static_cast<unsigned int>(parameters.load_time_first/time.get_delta_t());
          const double delta_u_x = delta_length/n_stretch_steps;      
          VectorTools::interpolate_boundary_values(dof_handler_ref,
                                                  boundary_id,
                                                  ConstantFunction<dim>(-delta_u_x,n_components),
                                                  constraints,
                                                  fe.component_mask(x_displacement));    
          // Fix z displacement to avoid rotation
          VectorTools::interpolate_boundary_values(dof_handler_ref,
                                                  boundary_id,
                                                  ZeroFunction<dim>(n_components),
                                                  constraints,
                                                  fe.component_mask(z_displacement));                                                              
          }

The adjust_timestep_size() void just does change delta_t to a new delta_t but i cannot find my error.

BBah

unread,
Jul 18, 2022, 7:06:50 AM7/18/22
to deal.II User Group
Alright guys i was able to solve this. Thanks
Reply all
Reply to author
Forward
0 new messages