Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Monitor
Incidents
Analyze
Value stream analytics
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
tbgl
tools
arbd
Commits
49ec7262
Commit
49ec7262
authored
9 years ago
by
cmaffeo2
Browse files
Options
Downloads
Patches
Plain Diff
improved RBGrid->getPosition by eschewing modulo; now performance on par with 3D kernel
parent
f3b002a1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ComputeGridGrid.cuh
+1
-1
1 addition, 1 deletion
ComputeGridGrid.cuh
RigidBodyGrid.cu
+10
-4
10 additions, 4 deletions
RigidBodyGrid.cu
with
11 additions
and
5 deletions
ComputeGridGrid.cuh
+
1
−
1
View file @
49ec7262
...
@@ -34,7 +34,7 @@ void computeGridGridForce(const RigidBodyGrid* rho, const RigidBodyGrid* u,
...
@@ -34,7 +34,7 @@ void computeGridGridForce(const RigidBodyGrid* rho, const RigidBodyGrid* u,
/* Vector3 tmpf = Vector3(0.0f); */
/* Vector3 tmpf = Vector3(0.0f); */
/* float tmpe = 0.0f; */
/* float tmpe = 0.0f; */
/* const ForceEnergy fe = ForceEnergy( tmpf, tmpe); */
/* const ForceEnergy fe = ForceEnergy( tmpf, tmpe); */
const
ForceEnergy
fe
=
u
->
interpolateForceD
(
u_ijk_float
);
/* in coord frame of u */
const
ForceEnergy
fe
=
u
->
interpolateForceD
Linearly
(
u_ijk_float
);
/* in coord frame of u */
force
[
tid
]
=
fe
.
f
;
force
[
tid
]
=
fe
.
f
;
const
float
r_val
=
rho
->
val
[
r_id
];
/* maybe move to beginning of function? */
const
float
r_val
=
rho
->
val
[
r_id
];
/* maybe move to beginning of function? */
...
...
This diff is collapsed.
Click to expand it.
RigidBodyGrid.cu
+
10
−
4
View file @
49ec7262
...
@@ -178,11 +178,17 @@ float RigidBodyGrid::getValue(int ix, int iy, int iz) const {
...
@@ -178,11 +178,17 @@ float RigidBodyGrid::getValue(int ix, int iy, int iz) const {
}
}
Vector3
RigidBodyGrid
::
getPosition
(
const
int
j
)
const
{
Vector3
RigidBodyGrid
::
getPosition
(
const
int
j
)
const
{
const
int
iz
=
j
%
nz
;
/* const int iz = j%nz; */
const
int
iy
=
(
j
/
nz
)
%
ny
;
/* const int iy = (j/nz)%ny; */
const
int
ix
=
j
/
(
nz
*
ny
);
/* const int ix = j/(nz*ny); */
const
int
jy
=
j
/
nz
;
const
int
jx
=
jy
/
ny
;
return
Vector3
(
ix
,
iy
,
iz
);
const
int
iz
=
j
-
jy
*
nz
;
const
int
iy
=
jy
-
jx
*
ny
;
// const int ix = jx;
return
Vector3
(
jx
,
iy
,
iz
);
}
}
Vector3
RigidBodyGrid
::
getPosition
(
int
j
,
Matrix3
basis
,
Vector3
origin
)
const
{
Vector3
RigidBodyGrid
::
getPosition
(
int
j
,
Matrix3
basis
,
Vector3
origin
)
const
{
...
...
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