Reference documentation for deal.II version GIT relicensing-224-gc660c0d696 2024-03-28 18:40:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
discrete_time.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2020 - 2022 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_discrete_time_h
16#define dealii_discrete_time_h
17
18#include <deal.II/base/config.h>
19
21
232{
233public:
254 DiscreteTime(const double start_time,
255 const double end_time,
256 const double desired_start_step_size = 0.);
257
261 double
262 get_current_time() const;
263
271 double
272 get_next_time() const;
273
280 double
281 get_previous_time() const;
282
286 double
287 get_start_time() const;
288
296 double
297 get_end_time() const;
298
302 bool
303 is_at_start() const;
304
308 bool
309 is_at_end() const;
310
320 double
321 get_next_step_size() const;
322
328 double
330
335 unsigned int
336 get_step_number() const;
337
349 void
350 set_desired_next_step_size(const double time_step_size);
351
365 void
366 set_next_step_size(const double time_step_size);
367
386 void
387 advance_time();
388
393 void
394 restart();
395
396private:
401
405 double end_time;
406
411
424 double next_time;
425
430
435
440 unsigned int step_number;
441};
442
443
444/*---------------------- Inline functions ------------------------------*/
445
446
447inline double
449{
450 return start_time;
451}
452
453
454
455inline double
457{
458 return end_time;
459}
460
461
462
463inline bool
465{
466 return step_number == 0;
467}
468
469
470
471inline bool
473{
474 return current_time == end_time;
475}
476
477
478
479inline double
484
485
486
487inline double
492
493
494
495inline double
497{
498 return current_time;
499}
500
501
502
503inline double
505{
506 return next_time;
507}
508
509
510
511inline double
513{
514 return previous_time;
515}
516
517
518
519inline unsigned int
521{
522 return step_number;
523}
524
525
527
528#endif
double get_previous_time() const
double get_next_step_size() const
void set_desired_next_step_size(const double time_step_size)
unsigned int get_step_number() const
double previous_time
bool is_at_end() const
double get_current_time() const
bool is_at_start() const
void set_next_step_size(const double time_step_size)
double get_next_time() const
double get_previous_step_size() const
void advance_time()
double current_time
double start_step_size
unsigned int step_number
double get_start_time() const
double get_end_time() const
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503