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,
712 wake_up(
const unsigned int);
724 sleep(
const unsigned int);
760 init_for_primal_problem();
766 init_for_dual_problem();
772 init_for_postprocessing();
806 postprocess_timestep();
819 get_timestep_no()
const;
835 get_backward_timestep()
const;
843 get_forward_timestep()
const;
920 set_timestep_no(
const unsigned int step_no);
927 set_sweep_no(
const unsigned int sweep_no);
982 Flags(
const bool delete_and_rebuild_tria,
983 const unsigned int wakeup_level_to_build_grid,
984 const unsigned int sleep_level_to_delete_grid);
1145 std::vector<std::vector<std::pair<unsigned int, double>>>;
1157 const unsigned int first_sweep_with_correction = 0,
1158 const unsigned int min_cells_for_correction = 0,
1159 const double cell_number_corridor_top = (1 << dim),
1160 const double cell_number_corridor_bottom = 1,
1163 const unsigned int cell_number_correction_steps = 0,
1164 const bool mirror_flags_to_previous_grid =
false,
1165 const bool adapt_grids =
false);
1206 const std::vector<std::vector<std::pair<unsigned int, double>>>
1244 <<
"The value " << arg1
1245 <<
" for the cell number corridor does not fulfill " 1246 "its natural requirements.");
1264 const double coarsening_threshold = 0);
1285 <<
"The value " << arg1
1286 <<
" for the cell refinement thresholds does not fulfill " 1287 "its natural requirements.");
1321 using RefinementFlags =
1335 grid_refinement = 0x1000
1364 const Flags & flags,
1365 const RefinementFlags & refinement_flags = RefinementFlags());
1394 wake_up(
const unsigned int wakeup_level)
override;
1410 sleep(
const unsigned int)
override;
1427 refine_grid(
const RefinementData data);
1435 init_for_refinement();
1445 get_tria_refinement_criteria(Vector<float> &criteria)
const = 0;
1452 save_refine_flags();
1469 "When calling restore_grid(), you must have previously " 1470 "deleted the triangulation.");
1527 template <
typename InitFunctionObject,
typename LoopFunctionObject>
1530 LoopFunctionObject loop_function,
1545 const unsigned int n_timesteps =
timesteps.size();
1549 for (
unsigned int step = 0; step < n_timesteps; ++step)
1556 init_function((&*
timesteps[n_timesteps - step - 1]));
1562 for (
int step = -timestepping_data.
look_ahead; step < 0; ++step)
1564 look_ahead <= static_cast<int>(timestepping_data.
look_ahead);
1573 if (n_timesteps - (step +
look_ahead) < n_timesteps)
1579 for (
unsigned int step = 0; step < n_timesteps; ++step)
1607 loop_function((&*
timesteps[n_timesteps - step - 1]));
1621 if (n_timesteps - (step -
look_back) <= n_timesteps)
1629 for (
int step = n_timesteps;
1630 step < static_cast<int>(n_timesteps + timestepping_data.
look_back);
1633 look_back <= static_cast<int>(timestepping_data.
look_back);
1639 (step - look_back < static_cast<int>(n_timesteps)))
1644 (step - look_back < static_cast<int>(n_timesteps)))
1650 DEAL_II_NAMESPACE_CLOSE
const unsigned int look_back
std::size_t memory_consumption() const
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
std::vector< std::vector< std::pair< unsigned int, double >>> CorrectionRelaxations
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
#define DeclException1(Exception1, type1, outsequence)
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)