Reference documentation for deal.II version 9.4.1
\(\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
source
base
event.cc
Go to the documentation of this file.
1
// ---------------------------------------------------------------------
2
//
3
// Copyright (C) 2010 - 2018 by the deal.II authors
4
//
5
// This file is part of the deal.II library.
6
//
7
// The deal.II library is free software; you can use it, redistribute
8
// it, and/or modify it under the terms of the GNU Lesser General
9
// Public License as published by the Free Software Foundation; either
10
// version 2.1 of the License, or (at your option) any later version.
11
// The full text of the license can be found in the file LICENSE.md at
12
// the top level directory of deal.II.
13
//
14
// ---------------------------------------------------------------------
15
16
17
#include <
deal.II/base/event.h
>
18
19
DEAL_II_NAMESPACE_OPEN
20
21
// TODO: Thread safety
22
23
namespace
Algorithms
24
{
25
std::vector<std::string>
Event::names
;
26
27
Event
28
Event::assign
(
const
std::string &name)
29
{
30
unsigned
int
index =
names
.size();
31
names
.emplace_back(name);
32
33
Event
result;
34
// The constructor generated an
35
// object with all flags equal
36
// zero. Now we set the new one.
37
result.
flags
[index] =
true
;
38
39
return
result;
40
}
41
42
43
Event::Event
()
44
: all_true(false)
45
, flags(names.size(), false)
46
{}
47
48
49
void
50
Event::clear
()
51
{
52
all_true
=
false
;
53
std::fill(
flags
.begin(),
flags
.end(),
false
);
54
}
55
56
57
void
58
Event::all
()
59
{
60
all_true
=
true
;
61
}
62
63
namespace
Events
64
{
65
const
Event
initial
=
Event::assign
(
"Initial"
);
66
const
Event
remesh
=
Event::assign
(
"Remesh"
);
67
const
Event
bad_derivative
=
Event::assign
(
"Bad Derivative"
);
68
const
Event
new_time
=
Event::assign
(
"New Time"
);
69
const
Event
new_timestep_size
=
Event::assign
(
"New Time Step Size"
);
70
}
// namespace Events
71
}
// namespace Algorithms
72
73
DEAL_II_NAMESPACE_CLOSE
Algorithms::Event
Definition:
event.h:50
Algorithms::Event::all_true
bool all_true
Definition:
event.h:127
Algorithms::Event::names
static std::vector< std::string > names
Definition:
event.h:138
Algorithms::Event::clear
void clear()
Definition:
event.cc:50
Algorithms::Event::Event
Event()
Definition:
event.cc:43
Algorithms::Event::flags
std::vector< bool > flags
Definition:
event.h:132
Algorithms::Event::assign
static Event assign(const std::string &name)
Definition:
event.cc:28
Algorithms::Event::all
void all()
Definition:
event.cc:58
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition:
config.h:442
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition:
config.h:443
event.h
Algorithms::Events::initial
const Event initial
Definition:
event.cc:65
Algorithms::Events::new_time
const Event new_time
Definition:
event.cc:68
Algorithms::Events::new_timestep_size
const Event new_timestep_size
Definition:
event.cc:69
Algorithms::Events::remesh
const Event remesh
Definition:
event.cc:66
Algorithms::Events::bad_derivative
const Event bad_derivative
Definition:
event.cc:67
Algorithms
Definition:
newton.h:37
Generated by
1.9.5