16 #ifndef dealii__time_dependent_h 17 #define dealii__time_dependent_h 23 #include <deal.II/base/config.h> 24 #include <deal.II/base/exceptions.h> 25 #include <deal.II/base/subscriptor.h> 26 #include <deal.II/base/smartpointer.h> 31 DEAL_II_NAMESPACE_OPEN
35 template <
typename number>
class Vector;
539 template <
typename InitFunctionObject,
typename LoopFunctionObject>
540 void do_loop (InitFunctionObject init_function,
541 LoopFunctionObject loop_function,
590 "You cannot insert a time step at the specified position.");
598 std::vector<SmartPointer<TimeStepBase,TimeDependent> >
timesteps;
630 void end_sweep (
const unsigned int begin_timestep,
631 const unsigned int end_timestep);
656 primal_problem = 0x0,
692 virtual void wake_up (
const unsigned int);
703 virtual void sleep (
const unsigned int);
736 virtual void init_for_primal_problem ();
741 virtual void init_for_dual_problem ();
746 virtual void init_for_postprocessing ();
777 virtual void postprocess_timestep ();
782 double get_time ()
const;
788 unsigned int get_timestep_no ()
const;
803 double get_backward_timestep ()
const;
810 double get_forward_timestep ()
const;
866 void set_previous_timestep (
const TimeStepBase *previous);
883 void set_timestep_no (
const unsigned int step_no);
889 void set_sweep_no (
const unsigned int sweep_no);
944 Flags (
const bool delete_and_rebuild_tria,
945 const unsigned int wakeup_level_to_build_grid,
946 const unsigned int sleep_level_to_delete_grid);
1118 const unsigned int first_sweep_with_correction = 0,
1119 const unsigned int min_cells_for_correction = 0,
1120 const double cell_number_corridor_top = (1<<dim),
1121 const double cell_number_corridor_bottom = 1,
1122 const CorrectionRelaxations &correction_relaxations = CorrectionRelaxations(),
1123 const unsigned int cell_number_correction_steps = 0,
1124 const bool mirror_flags_to_previous_grid =
false,
1125 const bool adapt_grids =
false);
1203 <<
"The value " << arg1
1204 <<
" for the cell number corridor does not fulfill " 1205 "its natural requirements.");
1223 const double coarsening_threshold=0);
1244 <<
"The value " << arg1
1245 <<
" for the cell refinement thresholds does not fulfill " 1246 "its natural requirements.");
1294 grid_refinement = 0x1000
1323 const RefinementFlags &refinement_flags = RefinementFlags());
1351 virtual void wake_up (
const unsigned int wakeup_level);
1366 virtual void sleep (
const unsigned int);
1382 void refine_grid (
const RefinementData data);
1389 virtual void init_for_refinement ();
1398 virtual void get_tria_refinement_criteria (
Vector<float> &criteria)
const = 0;
1404 void save_refine_flags ();
1420 "When calling restore_grid(), you must have previously " 1421 "deleted the triangulation.");
1470 void restore_grid ();
1479 template <
typename InitFunctionObject,
typename LoopFunctionObject>
1481 LoopFunctionObject loop_function,
1496 const unsigned int n_timesteps =
timesteps.size();
1500 for (
unsigned int step=0; step<n_timesteps; ++step)
1507 init_function ((&*
timesteps[n_timesteps-@ref step_1
"step-1"]));
1513 for (
int step=-timestepping_data.
look_ahead; step<0; ++step)
1523 if (n_timesteps-(step+
look_ahead) < n_timesteps)
1529 for (
unsigned int step=0; step<n_timesteps; ++step)
1555 loop_function ((&*
timesteps[n_timesteps-@ref step_1
"step-1"]));
1569 if (n_timesteps-(step-
look_back) <= n_timesteps)
1576 for (
int step=n_timesteps;
1577 step<static_cast<int>(n_timesteps+timestepping_data.
look_back); ++step)
1585 (step-look_back < static_cast<int>(n_timesteps)))
1591 (step-look_back < static_cast<int>(n_timesteps)))
1597 DEAL_II_NAMESPACE_CLOSE
const unsigned int look_back
std::size_t memory_consumption() const
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
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
const std::vector< std::vector< std::pair< unsigned int, double > > > correction_relaxations
#define DeclException1(Exception1, type1, outsequence)
SmartPointer< const Triangulation< dim, dim >, TimeStepBase_Tria< dim > > coarse_grid
#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)
TimeStepBase_Tria_Flags::Flags< dim > Flags
std::vector< SmartPointer< TimeStepBase, TimeDependent > > timesteps
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
std::vector< std::vector< bool > > coarsen_flags
std::vector< std::vector< std::pair< unsigned int, double > > > CorrectionRelaxations
const bool delete_and_rebuild_tria
TimeSteppingData(const unsigned int look_ahead, const unsigned int look_back)
SmartPointer< Triangulation< dim, dim >, TimeStepBase_Tria< dim > > tria