Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuhao Liu
ogs
Commits
3736bf59
Commit
3736bf59
authored
10 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[MeL] Replace throw with assert in getNodeID, getElementID.
parent
e6304e56
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MeshLib/MeshSubset.h
+5
-10
5 additions, 10 deletions
MeshLib/MeshSubset.h
with
5 additions
and
10 deletions
MeshLib/MeshSubset.h
+
5
−
10
View file @
3736bf59
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#ifndef MESHSUBSET_H_
#ifndef MESHSUBSET_H_
#define MESHSUBSET_H_
#define MESHSUBSET_H_
#include
<cassert>
#include
<vector>
#include
<vector>
#include
"Mesh.h"
#include
"Mesh.h"
...
@@ -65,13 +66,10 @@ public:
...
@@ -65,13 +66,10 @@ public:
/// Returns the global node id Node::getID() of i-th node in the mesh
/// Returns the global node id Node::getID() of i-th node in the mesh
/// subset.
/// subset.
///
Throws std::out_of_range exception if there are no nodes available
.
///
\pre The _nodes must be a valid pointer to a vector of size > i
.
std
::
size_t
getNodeID
(
std
::
size_t
const
i
)
const
std
::
size_t
getNodeID
(
std
::
size_t
const
i
)
const
{
{
if
(
!
_nodes
)
assert
(
_nodes
&&
i
<
_nodes
->
size
());
throw
std
::
out_of_range
(
"In MeshSubset::getNodeID(): no nodes or nodes are empty."
);
return
(
*
_nodes
)[
i
]
->
getID
();
return
(
*
_nodes
)[
i
]
->
getID
();
}
}
...
@@ -83,13 +81,10 @@ public:
...
@@ -83,13 +81,10 @@ public:
/// Returns the global element id Element::getID() of i-th element in the
/// Returns the global element id Element::getID() of i-th element in the
/// mesh subset.
/// mesh subset.
///
Throws std::out_of_range exception if there are no nodes available
.
///
\pre The _eles must be a valid pointer to a vector of size > i
.
std
::
size_t
getElementID
(
std
::
size_t
const
i
)
const
std
::
size_t
getElementID
(
std
::
size_t
const
i
)
const
{
{
if
(
!
_eles
)
assert
(
_eles
&&
i
<
_eles
->
size
());
throw
std
::
out_of_range
(
"In MeshSubset::getElementID(): no elements or elements are empty."
);
return
(
*
_eles
)[
i
]
->
getID
();
return
(
*
_eles
)[
i
]
->
getID
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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