17 #ifndef __deal2__time_dependent_h 18 #define __deal2__time_dependent_h 24 #include <deal.II/base/config.h> 26 #include <deal.II/base/subscriptor.h> 27 #include <deal.II/base/smartpointer.h> 36 template <
typename number>
class Vector;
612 template <
typename InitFunctionObject,
typename LoopFunctionObject>
613 void do_loop (InitFunctionObject init_function,
614 LoopFunctionObject loop_function,
704 std::vector<SmartPointer<TimeStepBase,TimeDependent> >
timesteps;
744 void end_sweep (
const unsigned int begin_timestep,
745 const unsigned int end_timestep);
768 primal_problem = 0x0,
811 virtual void wake_up (
const unsigned int);
830 virtual void sleep (
const unsigned int);
879 virtual void init_for_primal_problem ();
885 virtual void init_for_dual_problem ();
891 virtual void init_for_postprocessing ();
943 virtual void postprocess_timestep ();
949 double get_time ()
const;
957 unsigned int get_timestep_no ()
const;
983 double get_backward_timestep ()
const;
992 double get_forward_timestep ()
const;
1071 void set_previous_timestep (
const TimeStepBase *previous);
1094 void set_timestep_no (
const unsigned int step_no);
1103 void set_sweep_no (
const unsigned int sweep_no);
1167 Flags (
const bool delete_and_rebuild_tria,
1168 const unsigned int wakeup_level_to_build_grid,
1169 const unsigned int sleep_level_to_delete_grid);
1227 <<
"The parameter " << arg1 <<
" has an invalid value.");
1378 const unsigned int first_sweep_with_correction = 0,
1379 const unsigned int min_cells_for_correction = 0,
1380 const double cell_number_corridor_top = (1<<dim),
1381 const double cell_number_corridor_bottom = 1,
1382 const CorrectionRelaxations &correction_relaxations = CorrectionRelaxations(),
1383 const unsigned int cell_number_correction_steps = 0,
1384 const bool mirror_flags_to_previous_grid =
false,
1385 const bool adapt_grids =
false);
1502 <<
"The following value does not fulfill the requirements: " << arg1);
1520 const double coarsening_threshold=0);
1548 <<
"The following value does not fulfill the requirements: " << arg1);
1593 grid_refinement = 0x1000
1637 const RefinementFlags &refinement_flags = RefinementFlags());
1681 virtual void wake_up (
const unsigned int wakeup_level);
1708 virtual void sleep (
const unsigned int);
1732 void refine_grid (
const RefinementData data);
1742 virtual void init_for_refinement ();
1755 virtual void get_tria_refinement_criteria (
Vector<float> &criteria)
const = 0;
1764 void save_refine_flags ();
1852 void restore_grid ();
1861 template <
typename InitFunctionObject,
typename LoopFunctionObject>
1863 LoopFunctionObject loop_function,
1878 const unsigned int n_timesteps =
timesteps.size();
1882 for (
unsigned int step=0; step<n_timesteps; ++step)
1886 init_function (static_cast<typename InitFunctionObject::argument_type>
1890 init_function (static_cast<typename InitFunctionObject::argument_type>
1891 (&*
timesteps[n_timesteps-@ref step_1
"step-1"]));
1897 for (
int step=-timestepping_data.
look_ahead; step<0; ++step)
1907 if (n_timesteps-(step+
look_ahead) < n_timesteps)
1913 for (
unsigned int step=0; step<n_timesteps; ++step)
1936 loop_function (static_cast<typename LoopFunctionObject::argument_type>
1940 loop_function (static_cast<typename LoopFunctionObject::argument_type>
1941 (&*
timesteps[n_timesteps-@ref step_1
"step-1"]));
1955 if (n_timesteps-(step-
look_back) <= n_timesteps)
1962 for (
int step=n_timesteps;
1963 step<static_cast<int>(n_timesteps+timestepping_data.
look_back); ++step)
1971 (step-look_back < static_cast<int>(n_timesteps)))
1977 (step-look_back < static_cast<int>(n_timesteps)))
1983 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
static CorrectionRelaxations default_correction_relaxations
const unsigned int cell_number_correction_steps
DeclException0(ExcInvalidPosition)
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
const TimeSteppingData timestepping_data_primal
BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED
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
virtual void start_sweep(const unsigned int sweep_no)
TimeSteppingData(const unsigned int look_ahead, const unsigned int look_back)
SmartPointer< Triangulation< dim, dim >, TimeStepBase_Tria< dim > > tria