Reference documentation for deal.II version GIT relicensing-216-gcda843ca70 2024-03-28 12:20: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
event.cc
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2010 - 2018 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
16#include <deal.II/base/event.h>
17
19
20// TODO: Thread safety
21
22namespace Algorithms
23{
24 std::vector<std::string> Event::names;
25
26 Event
27 Event::assign(const std::string &name)
28 {
29 unsigned int index = names.size();
30 names.emplace_back(name);
31
32 Event result;
33 // The constructor generated an
34 // object with all flags equal
35 // zero. Now we set the new one.
36 result.flags[index] = true;
37
38 return result;
39 }
40
41
43 : all_true(false)
44 , flags(names.size(), false)
45 {}
46
47
48 void
50 {
51 all_true = false;
52 std::fill(flags.begin(), flags.end(), false);
53 }
54
55
56 void
58 {
59 all_true = true;
60 }
61
62 namespace Events
63 {
64 const Event initial = Event::assign("Initial");
65 const Event remesh = Event::assign("Remesh");
66 const Event bad_derivative = Event::assign("Bad Derivative");
67 const Event new_time = Event::assign("New Time");
68 const Event new_timestep_size = Event::assign("New Time Step Size");
69 } // namespace Events
70} // namespace Algorithms
71
static std::vector< std::string > names
Definition event.h:137
std::vector< bool > flags
Definition event.h:131
static Event assign(const std::string &name)
Definition event.cc:27
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
const Event initial
Definition event.cc:64
const Event new_time
Definition event.cc:67
const Event new_timestep_size
Definition event.cc:68
const Event remesh
Definition event.cc:65
const Event bad_derivative
Definition event.cc:66