deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+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: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2010 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13
14#include <deal.II/base/config.h>
15
16#include <deal.II/base/event.h>
17
18#include <algorithm>
19#include <string>
20#include <vector>
21
22
24
25// TODO: Thread safety
26
27namespace Algorithms
28{
29 std::vector<std::string> Event::names;
30
31 Event
32 Event::assign(const std::string &name)
33 {
34 unsigned int index = names.size();
35 names.emplace_back(name);
36
37 Event result;
38 // The constructor generated an
39 // object with all flags equal
40 // zero. Now we set the new one.
41 result.flags[index] = true;
42
43 return result;
44 }
45
46
48 : all_true(false)
49 , flags(names.size(), false)
50 {}
51
52
53 void
55 {
56 all_true = false;
57 std::fill(flags.begin(), flags.end(), false);
58 }
59
60
61 void
63 {
64 all_true = true;
65 }
66
67 namespace Events
68 {
69 const Event initial = Event::assign("Initial");
70 const Event remesh = Event::assign("Remesh");
71 const Event bad_derivative = Event::assign("Bad Derivative");
72 const Event new_time = Event::assign("New Time");
73 const Event new_timestep_size = Event::assign("New Time Step Size");
74 } // namespace Events
75} // namespace Algorithms
76
static std::vector< std::string > names
Definition event.h:135
std::vector< bool > flags
Definition event.h:129
static Event assign(const std::string &name)
Definition event.cc:32
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
std::size_t size
Definition mpi.cc:733
const Event initial
Definition event.cc:69
const Event new_time
Definition event.cc:72
const Event new_timestep_size
Definition event.cc:73
const Event remesh
Definition event.cc:70
const Event bad_derivative
Definition event.cc:71