Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
openfpm_pdata
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
argupta
openfpm_pdata
Commits
3f886c2d
Commit
3f886c2d
authored
Jan 09, 2019
by
Pietro Incardona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Example modified
parent
856eec94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
9 deletions
+22
-9
example/Vector/7_SPH_dlb_gpu_opt/Makefile
example/Vector/7_SPH_dlb_gpu_opt/Makefile
+11
-0
example/Vector/7_SPH_dlb_gpu_opt/main.cu
example/Vector/7_SPH_dlb_gpu_opt/main.cu
+11
-9
No files found.
example/Vector/7_SPH_dlb_gpu_opt/Makefile
View file @
3f886c2d
...
...
@@ -14,6 +14,14 @@ else
endif
ifeq
($(PROFILE),ON)
CUDA_CC
=
scorep
--nocompiler
--cuda
--mpp
=
mpi nvcc
CUDA_CC_LINK
=
scorep
--nocompiler
--cuda
--mpp
=
mpi nvcc
else
CUDA_CC
=
nvcc
CUDA_CC_LINK
=
nvcc
endif
CC
=
mpic++
LDIR
=
...
...
@@ -34,6 +42,9 @@ sph_dlb_test: sph_dlb
sph_dlb
:
$(OBJ)
$(CUDA_CC_LINK)
-o
$@
$^
$(CFLAGS)
$(LIBS_PATH)
$(LIBS)
sph_dlb2
:
$(OBJ)
$(CUDA_CC_LINK)
-o
$@
$^
$(CFLAGS)
$(LIBS_PATH)
$(LIBS)
all
:
sph_dlb
run
:
sph_dlb_test
...
...
example/Vector/7_SPH_dlb_gpu_opt/main.cu
View file @
3f886c2d
...
...
@@ -52,7 +52,7 @@ typedef float real_number;
#define FLUID 1
// initial spacing between particles dp in the formulas
const
real_number
dp
=
0.00425
;
const
real_number
dp
=
0.00425
/
2.0
;
// Maximum height of the fluid water
// is going to be calculated and filled later on
real_number
h_swl
=
0.0
;
...
...
@@ -64,7 +64,7 @@ const real_number coeff_sound = 20.0;
const
real_number
gamma_
=
7.0
;
// sqrt(3.0*dp*dp) support of the kernel
const
real_number
H
=
0.00736121593217
;
const
real_number
H
=
0.00736121593217
/
2.0
;
// Eta in the formulas
const
real_number
Eta2
=
0.01
*
H
*
H
;
...
...
@@ -78,10 +78,10 @@ const real_number visco = 0.1;
real_number
cbar
=
0.0
;
// Mass of the fluid particles
const
real_number
MassFluid
=
0.0000767656
;
const
real_number
MassFluid
=
0.0000767656
/
8.0
;
// Mass of the boundary particles
const
real_number
MassBound
=
0.0000767656
;
const
real_number
MassBound
=
0.0000767656
/
8.0
;
//
...
...
@@ -89,7 +89,7 @@ const real_number MassBound = 0.0000767656;
#ifdef TEST_RUN
const
real_number
t_end
=
0.001
;
#else
const
real_number
t_end
=
1.50
;
const
real_number
t_end
=
0.001
;
#endif
// Gravity acceleration
...
...
@@ -348,7 +348,7 @@ __global__ void calc_forces_gpu(particles_type vd, NN_type NN, real_number W_dap
real_number
r2
=
norm2
(
dr
);
// if they interact
if
(
r2
<
FourH2
)
if
(
r2
<
FourH2
&&
r2
>=
1e-16
)
{
real_number
r
=
sqrt
(
r2
);
...
...
@@ -703,7 +703,7 @@ int main(int argc, char* argv[])
// Here we define our domain a 2D box with internals from 0 to 1.0 for x and y
Box
<
3
,
real_number
>
domain
({
-
0.05
,
-
0.05
,
-
0.05
},{
1.7010
,
0.7065
,
0.511
});
size_t
sz
[
3
]
=
{
413
,
179
,
133
};
size_t
sz
[
3
]
=
{
2
*
(
413
-
1
)
+
1
,
2
*
(
179
-
1
)
+
1
,
2
*
(
133
-
1
)
+
1
};
// Fill W_dap
W_dap
=
1.0
/
Wab
(
H
/
1.5
);
...
...
@@ -909,7 +909,7 @@ int main(int argc, char* argv[])
t
+=
dt
;
if
(
write
<
t
*
10
0
)
if
(
write
<
t
*
10
)
{
// Sensor pressure require update ghost, so we ensure that particles are distributed correctly
// and ghost are updated
...
...
@@ -942,6 +942,8 @@ int main(int argc, char* argv[])
vd_out
.
getLastPos
()[
1
]
=
vd
.
getPos
(
p
)[
1
];
vd_out
.
getLastPos
()[
2
]
=
vd
.
getPos
(
p
)[
2
];
vd_out
.
template
getLastProp
<
0
>()
=
vd
.
template
getProp
<
type
>(
p
);
vd_out
.
template
getLastProp
<
1
>()[
0
]
=
vd
.
template
getProp
<
velocity
>(
p
)[
0
];
vd_out
.
template
getLastProp
<
1
>()[
1
]
=
vd
.
template
getProp
<
velocity
>(
p
)[
1
];
vd_out
.
template
getLastProp
<
1
>()[
2
]
=
vd
.
template
getProp
<
velocity
>(
p
)[
2
];
...
...
@@ -949,7 +951,7 @@ int main(int argc, char* argv[])
++
ito
;
}
vd_out
.
write_frame
(
"Particles"
,
write
,
VTK_WRITER
|
FORMAT_BINARY
);
vd_out
.
write_frame
(
"Particles
_s
"
,
write
,
VTK_WRITER
|
FORMAT_BINARY
);
write
++
;
if
(
v_cl
.
getProcessUnitID
()
==
0
)
...
...
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