Loading [MathJax]/extensions/TeX/newcommand.js
 deal.II version GIT relicensing-3100-ge7ea9d1e3f 2025-04-21 17:40:00+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\}}
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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
18#include <string>
19#include <vector>
20
21
23
24// TODO: Thread safety
25
26namespace Algorithms
27{
28 std::vector<std::string> Event::names;
29
30 Event
31 Event::assign(const std::string &name)
32 {
33 unsigned int index = names.size();
34 names.emplace_back(name);
35
37 // The constructor generated an
38 // object with all flags equal
39 // zero. Now we set the new one.
40 result.flags[index] = true;
41
42 return result;
43 }
44
45
47 : all_true(false)
48 , flags(names.size(), false)
49 {}
50
51
52 void
54 {
55 all_true = false;
56 std::fill(flags.begin(), flags.end(), false);
57 }
58
59
60 void
62 {
63 all_true = true;
64 }
65
66 namespace Events
67 {
68 const Event initial = Event::assign("Initial");
69 const Event remesh = Event::assign("Remesh");
70 const Event bad_derivative = Event::assign("Bad Derivative");
71 const Event new_time = Event::assign("New Time");
72 const Event new_timestep_size = Event::assign("New Time Step Size");
73 } // namespace Events
74} // namespace Algorithms
75
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:31
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:35
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:36
std::size_t size
Definition mpi.cc:745
const Event initial
Definition event.cc:68
const Event new_time
Definition event.cc:71
const Event new_timestep_size
Definition event.cc:72
const Event remesh
Definition event.cc:69
const Event bad_derivative
Definition event.cc:70