Commit 3f886c2d authored by Pietro Incardona's avatar Pietro Incardona

Example modified

parent 856eec94
......@@ -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
......
......@@ -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*100)
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment