From 59ad7235d80dffd85608dbd8c0b3e20ba16e82d2 Mon Sep 17 00:00:00 2001 From: khaors Date: Wed, 22 May 2019 10:19:44 -0500 Subject: [PATCH] index out of bound in boulton_solution_space (cpp code) fixed. --- .travis.yml | 4 ++-- src/pumpingtest.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 05ccdfc..12b6152 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,10 @@ language: R sudo: false cache: packages -r_build_args: "--no-manual --no-resave-data" +r_build_args: "--no-manual --no-resave-data" r_check_args: "--no-build-vignettes --no-manual --timings" before_install: - - sudo apt-get install libgslcblas0 + - sudo apt-get install libgslcblas0 - sudo add-apt-repository -y ppa:texlive-backports/ppa - Rscript -e 'update.packages(ask = FALSE)' diff --git a/src/pumpingtest.cpp b/src/pumpingtest.cpp index 37ca185..8e919ab 100644 --- a/src/pumpingtest.cpp +++ b/src/pumpingtest.cpp @@ -739,17 +739,18 @@ NumericVector boulton_solution_space(const double& Q, const double& x0, const double& ymax){ NumericVector dist(nx*ny), u(nx*ny), td(nx*ny), drawdown(nx*ny); dist = calculate_distance_well(x0,y0,nx,ny,xmin,xmax,ymin,ymax); + //std::cout << dist << std::endl; double Tr, Ss, Sy, alpha1; NumericVector W(nx*ny), phi(nx*ny), sigma(1), par3(1); Tr = hydrpar[0]; Ss = hydrpar[1]; Sy = hydrpar[2]; alpha1 = hydrpar[3]; - sigma(1) = Ss/Sy; + sigma[0] = Ss/Sy; phi = (alpha1*dist*dist*Ss)/(Tr); u = (Ss*dist*dist)/(4.0*Tr*t); td = 1.0/u; - par3(1)=0.0; + par3[0]=0.0; W = boulton_well_function_vector_cpp(td, phi, sigma, par3); drawdown = (Q/(4.0*M_PI*Tr))*W; return(drawdown);