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
ad86ad30
Commit
ad86ad30
authored
5 years ago
by
cmaffeo2
Browse files
Options
Downloads
Patches
Plain Diff
computPartGridForce wraps about RB center, not about grid origin; may result in performance loss
parent
cad8781f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/ComputeGridGrid.cu
+2
-4
2 additions, 4 deletions
src/ComputeGridGrid.cu
src/ComputeGridGrid.cuh
+1
-1
1 addition, 1 deletion
src/ComputeGridGrid.cuh
src/RigidBody.cu
+1
-1
1 addition, 1 deletion
src/RigidBody.cu
with
4 additions
and
6 deletions
src/ComputeGridGrid.cu
+
2
−
4
View file @
ad86ad30
...
@@ -76,7 +76,7 @@ __global__
...
@@ -76,7 +76,7 @@ __global__
void
computePartGridForce
(
const
Vector3
*
__restrict__
pos
,
Vector3
*
particleForce
,
void
computePartGridForce
(
const
Vector3
*
__restrict__
pos
,
Vector3
*
particleForce
,
const
int
num
,
const
int
*
__restrict__
particleIds
,
const
int
num
,
const
int
*
__restrict__
particleIds
,
const
RigidBodyGrid
*
__restrict__
u
,
const
RigidBodyGrid
*
__restrict__
u
,
const
Matrix3
basis_u_inv
,
const
Vector3
origin_u
,
const
Matrix3
basis_u_inv
,
const
Vector3
center_u
,
const
Vector3
origin_u
,
ForceEnergy
*
__restrict__
retForceTorque
,
float
*
__restrict__
energy
,
bool
get_energy
,
int
scheme
,
BaseGrid
*
sys_d
)
{
ForceEnergy
*
__restrict__
retForceTorque
,
float
*
__restrict__
energy
,
bool
get_energy
,
int
scheme
,
BaseGrid
*
sys_d
)
{
extern
__shared__
ForceEnergy
s
[];
extern
__shared__
ForceEnergy
s
[];
...
@@ -90,9 +90,7 @@ void computePartGridForce(const Vector3* __restrict__ pos, Vector3* particleForc
...
@@ -90,9 +90,7 @@ void computePartGridForce(const Vector3* __restrict__ pos, Vector3* particleForc
torque
[
tid
]
=
ForceEnergy
(
0.
f
,
0.
f
);
torque
[
tid
]
=
ForceEnergy
(
0.
f
,
0.
f
);
if
(
i
<
num
)
{
if
(
i
<
num
)
{
const
int
id
=
particleIds
[
i
];
const
int
id
=
particleIds
[
i
];
//Vector3 p = pos[id] - origin_u;
Vector3
p
=
sys_d
->
wrapDiff
(
pos
[
id
]
-
center_u
)
+
center_u
-
origin_u
Vector3
p
=
sys_d
->
wrapDiff
(
pos
[
id
]
-
origin_u
);
/* TODO: wrap about RB center, not origin */
// TODO: wrap to center of u
const
Vector3
u_ijk_float
=
basis_u_inv
.
transform
(
p
);
const
Vector3
u_ijk_float
=
basis_u_inv
.
transform
(
p
);
ForceEnergy
fe
;
ForceEnergy
fe
;
...
...
This diff is collapsed.
Click to expand it.
src/ComputeGridGrid.cuh
+
1
−
1
View file @
ad86ad30
...
@@ -17,7 +17,7 @@ extern __global__
...
@@ -17,7 +17,7 @@ extern __global__
void
computePartGridForce
(
const
Vector3
*
__restrict__
pos
,
Vector3
*
particleForce
,
void
computePartGridForce
(
const
Vector3
*
__restrict__
pos
,
Vector3
*
particleForce
,
const
int
num
,
const
int
*
__restrict__
particleIds
,
const
int
num
,
const
int
*
__restrict__
particleIds
,
const
RigidBodyGrid
*
__restrict__
u
,
const
RigidBodyGrid
*
__restrict__
u
,
const
Matrix3
basis_u_inv
,
const
Vector3
origin_u
,
const
Matrix3
basis_u_inv
,
const
Vector3
center_u
,
const
Vector3
origin_u
,
ForceEnergy
*
__restrict__
retForceTorque
,
float
*
energy
,
bool
get_energy
,
int
scheme
,
BaseGrid
*
sys_d
);
ForceEnergy
*
__restrict__
retForceTorque
,
float
*
energy
,
bool
get_energy
,
int
scheme
,
BaseGrid
*
sys_d
);
extern
__global__
extern
__global__
...
...
This diff is collapsed.
Click to expand it.
src/RigidBody.cu
+
1
−
1
View file @
ad86ad30
...
@@ -184,7 +184,7 @@ void RigidBody::callGridParticleForceKernel(Vector3* pos_d, Vector3* force_d, in
...
@@ -184,7 +184,7 @@ void RigidBody::callGridParticleForceKernel(Vector3* pos_d, Vector3* force_d, in
computePartGridForce
<<<
nb
,
NUMTHREADS
,
NUMTHREADS
*
2
*
sizeof
(
ForceEnergy
),
stream
>>>
(
computePartGridForce
<<<
nb
,
NUMTHREADS
,
NUMTHREADS
*
2
*
sizeof
(
ForceEnergy
),
stream
>>>
(
pos_d
,
force_d
,
numParticles
[
i
],
particles_d
[
i
],
pos_d
,
force_d
,
numParticles
[
i
],
particles_d
[
i
],
t
->
RBC
->
grids_d
+
idx
,
t
->
RBC
->
grids_d
+
idx
,
B
,
c
,
forcestorques_d
+
forcestorques_offset
[
fto_idx
++
],
energy
,
get_energy
,
scheme
,
sys_d
);
B
,
getPosition
(),
c
,
forcestorques_d
+
forcestorques_offset
[
fto_idx
++
],
energy
,
get_energy
,
scheme
,
sys_d
);
}
}
}
}
...
...
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