Problem in packin process

Submitted by ikoval3 on Mon, 05/20/2013 - 20:22

Dear all,

I tried to run in.packing process but an ERROR message appeared :
"The variable 'delta' is being used without being initialized". It refers to the file neighbor.cpp, line 1257.
------------------------------------------------------
int flag = 0;
if(radvary_flag == 0) {
for (int i = 0; i < nlocal; i++) {
delx = x[i][0] - xhold[i][0];
dely = x[i][1] - xhold[i][1];
delz = x[i][2] - xhold[i][2];
rsq = delx*delx + dely*dely + delz*delz;
if (rsq > deltasq) flag = 1; }}

else {
for (int i = 0; i < nlocal; i++) {
delx = x[i][0] - xhold[i][0];
dely = x[i][1] - xhold[i][1];
delz = x[i][2] - xhold[i][2];
delr = radius[i] - rhold[i];
rsq = delx*delx + dely*dely + delz*delz;
delrsq = delr*delr;

if (delrsq > deltasq || rsq > deltasq - 2.*delr*delta + delr*delr)
flag = 1; } }
--------------------------------------------------------

The 'delta' variable is in the penultimate line. However, it is initialized line 1199 as a double. Then, a value is given lines 1211 and 1224 : delta = 0.5 * (skin - (delta1+delta2)). In if(...) and else loops.
I tried to reinitialize delta but it didn't work.

Where should I (re)initialize 'delta'? And should I reinitialize it as equal to 0.5 * (skin - (delta1+delta2)) ?

Thank you in advance,
Igor.

ikoval3 | Mon, 05/20/2013 - 20:34

I'm sorry for the wrong report :
delta is also initialize line 1220 (Between the two others initialization) as delta = sqrt(delx*delx + dely*dely + delz*delz).
I'm really confused by the syntax of the code.

ikoval3 | Mon, 05/20/2013 - 22:22

I changed 'delta' to 'sqrt(deltasq)'. It seems to work, the software runs but I don't know if it physically matchs with the packing process, if I insert a mistake which makes the software running>
Is anyone has an answer?

Igor Koval