Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonas Schmitt
waLBerla
Commits
bfc5f97d
Commit
bfc5f97d
authored
Apr 10, 2017
by
Sebastian Eibl
Browse files
added assert to check if StaticTypeIDs are initialized
parent
def096c5
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/pe/rigidbody/BoxFactory.cpp
View file @
bfc5f97d
...
...
@@ -34,6 +34,8 @@ BoxID createBox( BodyStorage& globalStorage, BlockStorage& blocks, BlockDa
MaterialID
material
,
bool
global
,
bool
communicating
,
bool
infiniteMass
)
{
WALBERLA_ASSERT_UNEQUAL
(
Box
::
getStaticTypeID
(),
std
::
numeric_limits
<
id_t
>::
max
(),
"Box TypeID not initalized!"
);
// Checking the side lengths
if
(
lengths
[
0
]
<=
real_t
(
0
)
||
lengths
[
1
]
<=
real_t
(
0
)
||
lengths
[
2
]
<=
real_t
(
0
)
)
throw
std
::
invalid_argument
(
"Invalid side length"
);
...
...
src/pe/rigidbody/CapsuleFactory.cpp
View file @
bfc5f97d
...
...
@@ -34,6 +34,8 @@ CapsuleID createCapsule( BodyStorage& globalStorage, BlockStorage& blocks, Blo
MaterialID
material
,
bool
global
,
bool
communicating
,
bool
infiniteMass
)
{
WALBERLA_ASSERT_UNEQUAL
(
Capsule
::
getStaticTypeID
(),
std
::
numeric_limits
<
id_t
>::
max
(),
"Capsule TypeID not initalized!"
);
// Checking the radius and the length
WALBERLA_ASSERT_GREATER
(
radius
,
real_t
(
0
),
"Invalid capsule radius"
);
WALBERLA_ASSERT_GREATER
(
length
,
real_t
(
0
),
"Invalid capsule length"
);
...
...
src/pe/rigidbody/PlaneFactory.cpp
View file @
bfc5f97d
...
...
@@ -33,6 +33,8 @@ namespace pe {
PlaneID
createPlane
(
BodyStorage
&
globalStorage
,
id_t
uid
,
Vec3
normal
,
const
Vec3
&
gpos
,
MaterialID
material
)
{
WALBERLA_ASSERT_UNEQUAL
(
Plane
::
getStaticTypeID
(),
std
::
numeric_limits
<
id_t
>::
max
(),
"Plane TypeID not initalized!"
);
// Checking the normal of the plane
if
(
floatIsEqual
(
normal
.
sqrLength
(),
real_c
(
0
)
)
)
throw
std
::
invalid_argument
(
"Invalid plane normal!"
);
...
...
src/pe/rigidbody/SphereFactory.cpp
View file @
bfc5f97d
...
...
@@ -34,6 +34,7 @@ SphereID createSphere( BodyStorage& globalStorage, BlockStorage& blocks, BlockDa
MaterialID
material
,
bool
global
,
bool
communicating
,
bool
infiniteMass
)
{
WALBERLA_ASSERT_UNEQUAL
(
Sphere
::
getStaticTypeID
(),
std
::
numeric_limits
<
id_t
>::
max
(),
"Sphere TypeID not initalized!"
);
// Checking the radius
if
(
radius
<=
real_c
(
0
)
)
throw
std
::
invalid_argument
(
"Invalid sphere radius"
);
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment