tset v_p components to sensible values in ghost nodes - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
 (HTM) git clone git://src.adamsgaard.dk/sphere
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit b5c9bbf0de831d1dd2237fdc47ab53f5c9319018
 (DIR) parent 3ff1e9afe86667d4638dfd5b9776bb7d821c1b72
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Thu,  5 Jun 2014 09:32:54 +0200
       
       set v_p components to sensible values in ghost nodes
       
       Diffstat:
         M src/debug.h                         |       6 +++---
         M src/navierstokes.cuh                |      18 ++++++++++++++++++
       
       2 files changed, 21 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/src/debug.h b/src/debug.h
       t@@ -39,12 +39,12 @@ const int conv_log_interval = 4;
        // Check for nan/inf values in fluid solver kernels
        #define CHECK_NS_FINITE
        
       -// Enable reporting of forcing function terms to stdout
       -//#define REPORT_FORCING_TERMS
       -
        // Enable reporting of velocity prediction components to stdout
        //#define REPORT_V_P_COMPONENTS
        
       +// Enable reporting of forcing function terms to stdout
       +//#define REPORT_FORCING_TERMS
       +
        // Choose solver model (see Zhou et al. 2010 "Discrete particle simulation of
        // particle-fluid flow: model formulations and their applicability", table. 1.
        // SET_1 corresponds exactly to Model B in Zhu et al. 2007 "Discrete particle
 (DIR) diff --git a/src/navierstokes.cuh b/src/navierstokes.cuh
       t@@ -1816,6 +1816,9 @@ __global__ void findNSdivphiviv(
                __syncthreads();
                dev_ns_div_phi_vi_v[cellidx] = div_phi_vi_v;
        
       +        //printf("div(phi*v*v) [%d,%d,%d] = %f, %f, %f\n", x,y,z,
       +                //div_phi_vi_v.x, div_phi_vi_v.y, div_phi_vi_v.z);
       +
        #ifdef CHECK_NS_FINITE
                (void)checkFiniteFloat3("div_phi_vi_v", x, y, z, div_phi_vi_v);
        #endif
       t@@ -2092,6 +2095,7 @@ __global__ void findPredNSvelocities(
        
            // Check that we are not outside the fluid grid
            if (x <= nx && y <= ny && z <= nz) {
       +    //if (x < nx && y < ny && z < nz) {
        
                // Values that are needed for calculating the predicted velocity
                __syncthreads();
       t@@ -2230,6 +2234,20 @@ __global__ void findPredNSvelocities(
                    v_p.z = v.z;
                    //v_p.z = 0.0;
        
       +        // Do not set components placed in ghost node cells
       +        if (x == nx) {
       +            v_p.y = 0.0;
       +            v_p.z = 0.0;
       +        }
       +        if (y == ny) {
       +            v_p.x = 0.0;
       +            v_p.z = 0.0;
       +        }
       +        if (z == nz) {
       +            v_p.x = 0.0;
       +            v_p.y = 0.0;
       +        }
       +
                // Save the predicted velocity
                __syncthreads();
                dev_ns_v_p_x[fidx] = v_p.x;