Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lammps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
multiscale
lammps
Commits
b0bba197
Commit
b0bba197
authored
7 years ago
by
Tim Mattox
Browse files
Options
Downloads
Patches
Plain Diff
USER-DPD: remove unused coord2bin() variants, and add ISFINITE checks
parent
f8f13d92
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
src/USER-DPD/nbin_ssa.h
+5
-68
5 additions, 68 deletions
src/USER-DPD/nbin_ssa.h
with
5 additions
and
68 deletions
src/USER-DPD/nbin_ssa.h
+
5
−
68
View file @
b0bba197
...
@@ -23,6 +23,8 @@ NBinStyle(ssa,
...
@@ -23,6 +23,8 @@ NBinStyle(ssa,
#define LMP_NBIN_SSA_H
#define LMP_NBIN_SSA_H
#include
"nbin_standard.h"
#include
"nbin_standard.h"
#include
"math.h"
#include
"error.h"
namespace
LAMMPS_NS
{
namespace
LAMMPS_NS
{
...
@@ -47,79 +49,14 @@ class NBinSSA : public NBinStandard {
...
@@ -47,79 +49,14 @@ class NBinSSA : public NBinStandard {
bigint
memory_usage
();
bigint
memory_usage
();
inline
int
coord2bin
(
const
double
&
x
,
const
double
&
y
,
const
double
&
z
)
const
{
int
ix
,
iy
,
iz
;
if
(
x
>=
bboxhi_
[
0
])
ix
=
static_cast
<
int
>
((
x
-
bboxhi_
[
0
])
*
bininvx
)
+
nbinx
;
else
if
(
x
>=
bboxlo_
[
0
])
{
ix
=
static_cast
<
int
>
((
x
-
bboxlo_
[
0
])
*
bininvx
);
ix
=
MIN
(
ix
,
nbinx
-
1
);
}
else
ix
=
static_cast
<
int
>
((
x
-
bboxlo_
[
0
])
*
bininvx
)
-
1
;
if
(
y
>=
bboxhi_
[
1
])
iy
=
static_cast
<
int
>
((
y
-
bboxhi_
[
1
])
*
bininvy
)
+
nbiny
;
else
if
(
y
>=
bboxlo_
[
1
])
{
iy
=
static_cast
<
int
>
((
y
-
bboxlo_
[
1
])
*
bininvy
);
iy
=
MIN
(
iy
,
nbiny
-
1
);
}
else
iy
=
static_cast
<
int
>
((
y
-
bboxlo_
[
1
])
*
bininvy
)
-
1
;
if
(
z
>=
bboxhi_
[
2
])
iz
=
static_cast
<
int
>
((
z
-
bboxhi_
[
2
])
*
bininvz
)
+
nbinz
;
else
if
(
z
>=
bboxlo_
[
2
])
{
iz
=
static_cast
<
int
>
((
z
-
bboxlo_
[
2
])
*
bininvz
);
iz
=
MIN
(
iz
,
nbinz
-
1
);
}
else
iz
=
static_cast
<
int
>
((
z
-
bboxlo_
[
2
])
*
bininvz
)
-
1
;
return
(
iz
-
mbinzlo
)
*
mbiny
*
mbinx
+
(
iy
-
mbinylo
)
*
mbinx
+
(
ix
-
mbinxlo
);
}
inline
int
coord2bin
(
const
double
&
x
,
const
double
&
y
,
const
double
&
z
,
int
*
i
)
const
{
int
ix
,
iy
,
iz
;
if
(
x
>=
bboxhi_
[
0
])
ix
=
static_cast
<
int
>
((
x
-
bboxhi_
[
0
])
*
bininvx
)
+
nbinx
;
else
if
(
x
>=
bboxlo_
[
0
])
{
ix
=
static_cast
<
int
>
((
x
-
bboxlo_
[
0
])
*
bininvx
);
ix
=
MIN
(
ix
,
nbinx
-
1
);
}
else
ix
=
static_cast
<
int
>
((
x
-
bboxlo_
[
0
])
*
bininvx
)
-
1
;
if
(
y
>=
bboxhi_
[
1
])
iy
=
static_cast
<
int
>
((
y
-
bboxhi_
[
1
])
*
bininvy
)
+
nbiny
;
else
if
(
y
>=
bboxlo_
[
1
])
{
iy
=
static_cast
<
int
>
((
y
-
bboxlo_
[
1
])
*
bininvy
);
iy
=
MIN
(
iy
,
nbiny
-
1
);
}
else
iy
=
static_cast
<
int
>
((
y
-
bboxlo_
[
1
])
*
bininvy
)
-
1
;
if
(
z
>=
bboxhi_
[
2
])
iz
=
static_cast
<
int
>
((
z
-
bboxhi_
[
2
])
*
bininvz
)
+
nbinz
;
else
if
(
z
>=
bboxlo_
[
2
])
{
iz
=
static_cast
<
int
>
((
z
-
bboxlo_
[
2
])
*
bininvz
);
iz
=
MIN
(
iz
,
nbinz
-
1
);
}
else
iz
=
static_cast
<
int
>
((
z
-
bboxlo_
[
2
])
*
bininvz
)
-
1
;
i
[
0
]
=
ix
-
mbinxlo
;
i
[
1
]
=
iy
-
mbinylo
;
i
[
2
]
=
iz
-
mbinzlo
;
return
(
iz
-
mbinzlo
)
*
mbiny
*
mbinx
+
(
iy
-
mbinylo
)
*
mbinx
+
(
ix
-
mbinxlo
);
}
inline
inline
int
coord2bin
(
const
double
&
x
,
const
double
&
y
,
const
double
&
z
,
int
&
ixo
,
int
&
iyo
,
int
&
izo
)
const
int
coord2bin
(
const
double
&
x
,
const
double
&
y
,
const
double
&
z
,
int
&
ixo
,
int
&
iyo
,
int
&
izo
)
const
{
{
int
ix
,
iy
,
iz
;
int
ix
,
iy
,
iz
;
if
(
!
ISFINITE
(
x
)
||
!
ISFINITE
(
y
)
||
!
ISFINITE
(
z
))
error
->
one
(
FLERR
,
"Non-numeric positions - simulation unstable"
);
if
(
x
>=
bboxhi_
[
0
])
if
(
x
>=
bboxhi_
[
0
])
ix
=
static_cast
<
int
>
((
x
-
bboxhi_
[
0
])
*
bininvx
)
+
nbinx
;
ix
=
static_cast
<
int
>
((
x
-
bboxhi_
[
0
])
*
bininvx
)
+
nbinx
;
else
if
(
x
>=
bboxlo_
[
0
])
{
else
if
(
x
>=
bboxlo_
[
0
])
{
...
...
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