Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
7b608514
"platforms/cuda/tests/TestCudaHarmonicAngleForce.cpp" did not exist on "a5288d55a4b8fb58ceb2ca43a456ef344f062723"
Commit
7b608514
authored
Nov 04, 2013
by
peastman
Browse files
Bug fixes
parent
be61ee5b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
platforms/cpu/src/CpuNeighborList.cpp
platforms/cpu/src/CpuNeighborList.cpp
+9
-3
No files found.
platforms/cpu/src/CpuNeighborList.cpp
View file @
7b608514
...
...
@@ -164,8 +164,12 @@ public:
float
refineCutoff
=
maxDistance
-
max
(
max
(
blockWidth
[
0
],
blockWidth
[
1
]),
blockWidth
[
2
]);
float
refineCutoffSquared
=
refineCutoff
*
refineCutoff
;
int
dIndexX
=
min
(
nx
/
2
,
int
((
maxDistance
+
blockWidth
[
0
])
/
voxelSizeX
)
+
1
);
// How may voxels away do we have to look?
int
dIndexY
=
min
(
ny
/
2
,
int
((
maxDistance
+
blockWidth
[
1
])
/
voxelSizeY
)
+
1
);
int
dIndexX
=
int
((
maxDistance
+
blockWidth
[
0
])
/
voxelSizeX
)
+
1
;
// How may voxels away do we have to look?
int
dIndexY
=
int
((
maxDistance
+
blockWidth
[
1
])
/
voxelSizeY
)
+
1
;
if
(
usePeriodic
)
{
dIndexX
=
min
(
nx
/
2
,
dIndexX
);
dIndexY
=
min
(
ny
/
2
,
dIndexY
);
}
float
centerPos
[
4
];
blockCenter
.
store
(
centerPos
);
VoxelIndex
centerVoxelIndex
=
getVoxelIndex
(
centerPos
);
...
...
@@ -202,7 +206,9 @@ public:
float
dz
=
maxDistance
+
blockWidth
[
2
];
dz
=
sqrtf
(
max
(
0.0
f
,
dz
*
dz
-
dx
*
dx
-
dy
*
dy
));
bool
needPeriodic
=
(
voxelIndex
.
x
!=
x
||
voxelIndex
.
y
!=
y
||
centerPos
[
2
]
-
dz
<
0.0
f
||
centerPos
[
2
]
+
dz
>
periodicBoxSize
[
2
]);
bool
needPeriodic
=
(
centerPos
[
0
]
-
blockWidth
[
0
]
<
maxDistance
||
centerPos
[
0
]
+
blockWidth
[
0
]
>
periodicBoxSize
[
0
]
-
maxDistance
||
centerPos
[
1
]
-
blockWidth
[
1
]
<
maxDistance
||
centerPos
[
1
]
+
blockWidth
[
1
]
>
periodicBoxSize
[
1
]
-
maxDistance
||
centerPos
[
2
]
-
dz
<
0.0
f
||
centerPos
[
2
]
+
dz
>
periodicBoxSize
[
2
]);
int
rangeStart
[
2
];
int
rangeEnd
[
2
];
rangeStart
[
0
]
=
findLowerBound
(
voxelIndex
.
x
,
voxelIndex
.
y
,
centerPos
[
2
]
-
dz
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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