Skip to content

Commit

Permalink
Remove temporary ulist variable
Browse files Browse the repository at this point in the history
  • Loading branch information
stanmoore1 committed Jul 1, 2019
1 parent b05c3c5 commit 04a6664
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
19 changes: 8 additions & 11 deletions src/SNAP/sna.cpp
Expand Up @@ -341,7 +341,7 @@ void SNA::compute_ui(int jnum)
// theta0 = (r - rmin0) * rscale0;
z0 = r / tan(theta0);

compute_uarray(x, y, z, z0, r);
compute_uarray(x, y, z, z0, r, j);
add_uarraytot(r, wj[j], rcutij[j], j);
}

Expand Down Expand Up @@ -895,8 +895,8 @@ void SNA::add_uarraytot(double r, double wj, double rcut, int jj)

sfac *= wj;

double* ulist_r_j = ulist_r_ij[jj];
double* ulist_i_j = ulist_i_ij[jj];
double* ulist_r = ulist_r_ij[jj];
double* ulist_i = ulist_i_ij[jj];

for (int j = 0; j <= twojmax; j++) {
int jju = idxu_block[j];
Expand All @@ -906,9 +906,6 @@ void SNA::add_uarraytot(double r, double wj, double rcut, int jj)
sfac * ulist_r[jju];
ulisttot_i[jju] +=
sfac * ulist_i[jju];

ulist_r_j[jju] = ulist_r[jju];
ulist_i_j[jju] = ulist_i[jju];
jju++;
}
}
Expand All @@ -919,7 +916,7 @@ void SNA::add_uarraytot(double r, double wj, double rcut, int jj)
------------------------------------------------------------------------- */

void SNA::compute_uarray(double x, double y, double z,
double z0, double r)
double z0, double r, int jj)
{
double r0inv;
double a_r, b_r, a_i, b_i;
Expand All @@ -935,6 +932,10 @@ void SNA::compute_uarray(double x, double y, double z,

// VMK Section 4.8.2


double* ulist_r = ulist_r_ij[jj];
double* ulist_i = ulist_i_ij[jj];

ulist_r[0] = 1.0;
ulist_i[0] = 0.0;

Expand Down Expand Up @@ -1208,8 +1209,6 @@ void SNA::create_twojmax_arrays()
memory->create(rootpqarray, jdimpq, jdimpq,
"sna:rootpqarray");
memory->create(cglist, idxcg_max, "sna:cglist");
memory->create(ulist_r, idxu_max, "sna:ulist");
memory->create(ulist_i, idxu_max, "sna:ulist");
memory->create(ulisttot_r, idxu_max, "sna:ulisttot");
memory->create(ulisttot_i, idxu_max, "sna:ulisttot");
memory->create(dulist_r, idxu_max, 3, "sna:dulist");
Expand All @@ -1234,8 +1233,6 @@ void SNA::destroy_twojmax_arrays()
{
memory->destroy(rootpqarray);
memory->destroy(cglist);
memory->destroy(ulist_r);
memory->destroy(ulist_i);
memory->destroy(ulisttot_r);
memory->destroy(ulisttot_i);
memory->destroy(dulist_r);
Expand Down
3 changes: 1 addition & 2 deletions src/SNAP/sna.h
Expand Up @@ -85,7 +85,6 @@ class SNA : protected Pointers {
int*** idxcg_block;

double* ulisttot_r, * ulisttot_i;
double* ulist_r, * ulist_i;
double** ulist_r_ij, ** ulist_i_ij;
int* idxu_block;

Expand All @@ -109,7 +108,7 @@ class SNA : protected Pointers {
void addself_uarraytot(double);
void add_uarraytot(double, double, double, int);
void compute_uarray(double, double, double,
double, double);
double, double, int);
double deltacg(int, int, int);
int compute_ncoeff();
void compute_duarray(double, double, double,
Expand Down

0 comments on commit 04a6664

Please sign in to comment.