Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arbor-sim
arbor
Commits
954f0b76
Unverified
Commit
954f0b76
authored
3 years ago
by
Thorsten Hater
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Users may not give dt < 0. (#1821)
* Users may not give dt < 0 to simulation.run() * Add and throw domain_error.
parent
2bf54047
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
arbor/arbexcept.cpp
+2
-0
2 additions, 0 deletions
arbor/arbexcept.cpp
arbor/include/arbor/arbexcept.hpp
+7
-0
7 additions, 0 deletions
arbor/include/arbor/arbexcept.hpp
arbor/simulation.cpp
+3
-0
3 additions, 0 deletions
arbor/simulation.cpp
with
12 additions
and
0 deletions
arbor/arbexcept.cpp
+
2
−
0
View file @
954f0b76
...
...
@@ -10,6 +10,8 @@ namespace arb {
using
arb
::
util
::
pprintf
;
domain_error
::
domain_error
(
const
std
::
string
&
w
)
:
arbor_exception
(
w
)
{}
bad_cell_probe
::
bad_cell_probe
(
cell_kind
kind
,
cell_gid_type
gid
)
:
arbor_exception
(
pprintf
(
"recipe::get_grobe() is not supported for cell with gid {} of kind {})"
,
gid
,
kind
)),
gid
(
gid
),
...
...
This diff is collapsed.
Click to expand it.
arbor/include/arbor/arbexcept.hpp
+
7
−
0
View file @
954f0b76
...
...
@@ -28,6 +28,13 @@ struct arbor_exception: std::runtime_error {
{}
};
// Logic errors
// Argument violates domain constraints, eg ln(-1)
struct
domain_error
:
arbor_exception
{
domain_error
(
const
std
::
string
&
);
};
// Recipe errors:
struct
bad_cell_probe
:
arbor_exception
{
...
...
This diff is collapsed.
Click to expand it.
arbor/simulation.cpp
+
3
−
0
View file @
954f0b76
...
...
@@ -514,6 +514,9 @@ void simulation::reset() {
}
time_type
simulation
::
run
(
time_type
tfinal
,
time_type
dt
)
{
if
(
dt
<=
0.0
)
{
throw
domain_error
(
"Finite time-step must be supplied."
);
}
return
impl_
->
run
(
tfinal
,
dt
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment