16 #ifndef dealii_time_dependent_h 17 # define dealii_time_dependent_h 23 # include <deal.II/base/config.h> 25 # include <deal.II/base/exceptions.h> 26 # include <deal.II/base/smartpointer.h> 27 # include <deal.II/base/subscriptor.h> 32 DEAL_II_NAMESPACE_OPEN
36 template <
typename number>
38 template <
int dim,
int spacedim>
555 template <
typename InitFunctionObject,
typename LoopFunctionObject>
557 do_loop(InitFunctionObject init_function,
558 LoopFunctionObject loop_function,
610 "You cannot insert a time step at the specified position.");
618 std::vector<SmartPointer<TimeStepBase, TimeDependent>>
timesteps;
650 end_sweep(
const unsigned int begin_timestep,
const unsigned int end_timestep);
675 primal_problem = 0x0,
725 wake_up(
const unsigned int);
737 sleep(
const unsigned int);
773 init_for_primal_problem();
779 init_for_dual_problem();
785 init_for_postprocessing();
819 postprocess_timestep();
832 get_timestep_no()
const;
848 get_backward_timestep()
const;
856 get_forward_timestep()
const;
933 set_timestep_no(
const unsigned int step_no);
940 set_sweep_no(
const unsigned int sweep_no);
977 Flags(
const bool delete_and_rebuild_tria,
978 const unsigned int wakeup_level_to_build_grid,
979 const unsigned int sleep_level_to_delete_grid);
1140 std::vector<std::vector<std::pair<unsigned int, double>>>;
1152 const unsigned int first_sweep_with_correction = 0,
1153 const unsigned int min_cells_for_correction = 0,
1154 const double cell_number_corridor_top = (1 << dim),
1155 const double cell_number_corridor_bottom = 1,
1158 const unsigned int cell_number_correction_steps = 0,
1159 const bool mirror_flags_to_previous_grid =
false,
1160 const bool adapt_grids =
false);
1201 const std::vector<std::vector<std::pair<unsigned int, double>>>
1239 <<
"The value " << arg1
1240 <<
" for the cell number corridor does not fulfill " 1241 "its natural requirements.");
1259 const double coarsening_threshold = 0);
1280 <<
"The value " << arg1
1281 <<
" for the cell refinement thresholds does not fulfill " 1282 "its natural requirements.");
1316 using RefinementFlags =
1330 grid_refinement = 0x1000
1359 const Flags & flags,
1360 const RefinementFlags & refinement_flags = RefinementFlags());
1389 wake_up(
const unsigned int wakeup_level)
override;
1405 sleep(
const unsigned int)
override;
1422 refine_grid(
const RefinementData data);
1430 init_for_refinement();
1440 get_tria_refinement_criteria(Vector<float> &criteria)
const = 0;
1447 save_refine_flags();
1464 "When calling restore_grid(), you must have previously " 1465 "deleted the triangulation.");
1522 template <
typename InitFunctionObject,
typename LoopFunctionObject>
1525 LoopFunctionObject loop_function,
1540 const unsigned int n_timesteps =
timesteps.size();
1544 for (
unsigned int step = 0; step < n_timesteps; ++step)
1551 init_function((&*
timesteps[n_timesteps - step - 1]));
1557 for (
int step = -static_cast<int>(timestepping_data.
look_ahead); step < 0;
1560 look_ahead <= static_cast<int>(timestepping_data.
look_ahead);
1569 if (n_timesteps - (step +
look_ahead) < n_timesteps)
1575 for (
unsigned int step = 0; step < n_timesteps; ++step)
1603 loop_function((&*
timesteps[n_timesteps - step - 1]));
1617 if (n_timesteps - (step -
look_back) <= n_timesteps)
1625 for (
int step = n_timesteps;
1626 step < static_cast<int>(n_timesteps + timestepping_data.
look_back);
1629 look_back <= static_cast<int>(timestepping_data.
look_back);
1635 (step - look_back < static_cast<int>(n_timesteps)))
1640 (step - look_back < static_cast<int>(n_timesteps)))
1646 DEAL_II_NAMESPACE_CLOSE
const unsigned int look_back
const std::vector< std::vector< std::pair< unsigned int, double > > > correction_relaxations
TimeDependent(const TimeSteppingData &data_primal, const TimeSteppingData &data_dual, const TimeSteppingData &data_postprocess)
void solve_primal_problem()
void add_timestep(TimeStepBase *new_timestep)
void solve_dual_problem()
const TimeStepBase * next_timestep
const TimeSteppingData timestepping_data_postprocess
const unsigned int wakeup_level_to_build_grid
const TimeStepBase * previous_timestep
const TimeSteppingData timestepping_data_dual
const unsigned int cell_number_correction_steps
const unsigned int max_refinement_level
LinearAlgebra::distributed::Vector< Number > Vector
SmartPointer< const Triangulation< dim, dim >, TimeStepBase_Tria< dim > > coarse_grid
const double cell_number_corridor_top
void do_loop(InitFunctionObject init_function, LoopFunctionObject loop_function, const TimeSteppingData ×tepping_data, const Direction direction)
const RefinementFlags refinement_flags
std::vector< std::vector< std::pair< unsigned int, double > >> CorrectionRelaxations
#define DeclException1(Exception1, type1, outsequence)
std::size_t memory_consumption() const
std::vector< SmartPointer< TimeStepBase, TimeDependent > > timesteps
#define DeclExceptionMsg(Exception, defaulttext)
const TimeSteppingData timestepping_data_primal
static ::ExceptionBase & ExcInvalidPosition()
virtual void start_sweep(const unsigned int sweep_no)
static CorrectionRelaxations default_correction_relaxations
const unsigned int first_sweep_with_correction
const unsigned int sleep_level_to_delete_grid
const double coarsening_threshold
void delete_timestep(const unsigned int position)
typename TimeStepBase_Tria_Flags::Flags< dim > Flags
const double cell_number_corridor_bottom
const unsigned int look_ahead
const bool mirror_flags_to_previous_grid
const unsigned int min_cells_for_correction
void insert_timestep(const TimeStepBase *position, TimeStepBase *new_timestep)
std::vector< std::vector< bool > > refine_flags
const double refinement_threshold
SmartPointer< Triangulation< dim, dim >, TimeStepBase_Tria< dim > > tria
std::vector< std::vector< bool > > coarsen_flags
const bool delete_and_rebuild_tria
TimeSteppingData(const unsigned int look_ahead, const unsigned int look_back)