tmodify debug output - 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 e4516a4cde0fcf1ea1f1eee8ad48c172e681f2f3
 (DIR) parent 638eff0cb9e3f20a3b9888b99ed7656ac7aaee19
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Wed, 22 Oct 2014 11:47:19 +0200
       
       modify debug output
       
       Diffstat:
         M src/debug.h                         |       6 +++---
         M src/navierstokes.cuh                |      17 +++++++++--------
         M tests/cfd_tests_neumann.py          |       1 +
       
       3 files changed, 13 insertions(+), 11 deletions(-)
       ---
 (DIR) diff --git a/src/debug.h b/src/debug.h
       t@@ -21,8 +21,8 @@ const unsigned int nijacnorm = 10;
        const int write_res_log = 0;
        
        // Report epsilon values during Jacobi iterations to stdout
       -//#define REPORT_EPSILON
       -//#define REPORT_MORE_EPSILON
       +#define REPORT_EPSILON
       +#define REPORT_MORE_EPSILON
        
        // Report the number of iterations it took before convergence to logfile
        // 'output/<sid>-conv.dat'
       t@@ -47,7 +47,7 @@ const int conv_log_interval = 1;
        #define REPORT_V_C_COMPONENTS
        
        // Enable reporting of forcing function terms to stdout
       -//#define REPORT_FORCING_TERMS
       +#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.
 (DIR) diff --git a/src/navierstokes.cuh b/src/navierstokes.cuh
       t@@ -2322,6 +2322,7 @@ __global__ void findPredNSvelocities(
                    dev_ns_v_x[fidx],
                    dev_ns_v_y[fidx],
                    dev_ns_v_z[fidx]);
       +        //printf("v in v* [%d,%d,%d] = %f, %f, %f\n", x,y,z, v.x, v.y, v.z);
        
                Float3 div_tau = MAKE_FLOAT3(0.0, 0.0, 0.0);
                if (devC_params.mu > 0.0) {
       t@@ -2451,7 +2452,7 @@ __global__ void findPredNSvelocities(
        
        #ifdef REPORT_V_P_COMPONENTS
                // Report velocity components to stdout for debugging
       -        printf("\n[%d,%d,%d]"
       +        printf("\n[%d,%d,%d] REPORT_V_P_COMPONENTS\n"
                       "\tv_p      = %+e %+e %+e\n"
                       "\tv_old    = %+e %+e %+e\n"
                       "\tpres     = %+e %+e %+e\n"
       t@@ -2461,8 +2462,8 @@ __global__ void findPredNSvelocities(
                       "\tporos    = %+e %+e %+e\n"
                       "\tadv      = %+e %+e %+e\n",
                       x, y, z,
       -               v.x, v.y, v.z,
                       v_p.x, v_p.y, v_p.z,
       +               v.x, v.y, v.z,
                       pressure_term.x, pressure_term.y, pressure_term.z, 
                       interaction_term.x, interaction_term.y, interaction_term.z, 
                       diffusion_term.x, diffusion_term.y, diffusion_term.z, 
       t@@ -2581,8 +2582,8 @@ __global__ void findNSforcing(
        
        #ifdef REPORT_FORCING_TERMS
                    // Report values terms in the forcing function for debugging
       -            printf("[%d,%d,%d]\tt1 = %f\tt2 = %f\tt4 = %f\n",
       -                   x,y,z, t1, t2, t4);
       +            printf("[%d,%d,%d] REPORT_FORCING_TERMS\t"
       +                    "t1 = %f\tt2 = %f\tt4 = %f\n", x,y,z, t1, t2, t4);
        #endif
        
                    // Save values
       t@@ -2608,7 +2609,7 @@ __global__ void findNSforcing(
        #ifdef REPORT_FORCING_TERMS
                const Float t3 = -dot(f2, grad_epsilon);
                if (z >= nz-3)
       -            printf("[%d,%d,%d]\tf = %f\tf1 = %f\tt3 = %f\n",
       +            printf("[%d,%d,%d] REPORT_FORCING_TERMS\tf= %f\tf1 = %f\tt3 = %f\n",
                           x,y,z, f, f1, t3);
        #endif
        
       t@@ -3038,7 +3039,7 @@ __global__ void updateNSvelocity(
                    v = MAKE_FLOAT3(0.0, 0.0, 0.0);
        
        #ifdef REPORT_V_C_COMPONENTS
       -        printf("[%d,%d,%d]\n"
       +        printf("[%d,%d,%d] REPORT_V_C_COMPONENTS\n"
                        "\tv_p           = % f\t% f\t% f\n"
                        "\tv_c           = % f\t% f\t% f\n"
                        "\tv             = % f\t% f\t% f\n"
       t@@ -3395,7 +3396,7 @@ __global__ void interpolateCenterToFace(
                const Float z_val = amean(center.z, zn.z);
        
                __syncthreads();
       -        //printf("c2f [%d,%d,%d] = %f,%f,%f\n", x,y,z, x_val, y_val, z_val);
       +        printf("c2f [%d,%d,%d] = %f,%f,%f\n", x,y,z, x_val, y_val, z_val);
                dev_out_x[faceidx] = x_val;
                dev_out_y[faceidx] = y_val;
                dev_out_z[faceidx] = z_val;
       t@@ -3437,7 +3438,7 @@ __global__ void interpolateFaceToCenter(
                    amean(z_n, z_p));
        
                __syncthreads();
       -        //printf("[%d,%d,%d] = %f, %f, %f\n", x,y,z, val.x, val.y, val.z);
       +        printf("f2c [%d,%d,%d] = %f, %f, %f\n", x,y,z, val.x, val.y, val.z);
                dev_out[idx(x,y,z)] = val;
            }
        }
 (DIR) diff --git a/tests/cfd_tests_neumann.py b/tests/cfd_tests_neumann.py
       t@@ -51,6 +51,7 @@ orig.initFluid(mu = 8.9e-4)
        #orig.initTemporal(total = 0.05, file_dt = 0.005, dt = 1.0e-4)
        #orig.initTemporal(total = 1.0e-2, file_dt = 1.0e-4, dt = 1.0e-4)
        orig.initTemporal(total = 1.0e-3, file_dt = 1.0e-4, dt = 1.0e-4)
       +orig.v_f[:,:,:,2] = 0.0
        #print(orig.largestFluidTimeStep())
        #orig.initTemporal(total = orig.largestFluidTimeStep()*10.0,
                #file_dt = orig.largestFluidTimeStep(),