Skip to content

Commit

Permalink
Accidentally left squared norm in places.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-petersen committed Aug 19, 2023
1 parent 05360b6 commit 18d4acc
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/CBrockDisk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -593,13 +593,13 @@ void CBrockDisk::determine_fields_at_point_polar

get_dens_coefs(l,expcoef->row(2*l - 1), pc);
get_dens_coefs(l,expcoef->row(2*l ), ps);
dens += (pc*cosm[0][l] + ps*sinm[0][l]) * M_SQRT2 / sqnorm(l,n);
dens += (pc*cosm[0][l] + ps*sinm[0][l]) * M_SQRT2;

get_pot_coefs(l,expcoef->row(2*l - 1), pc, dpc);
get_pot_coefs(l,expcoef->row(2*l ), ps, dps);
potl += (pc *cosm[0][l] + ps *sinm[0][l]) * M_SQRT2 / sqnorm(l,n);
potr += (dpc*cosm[0][l] + dps*sinm[0][l]) * M_SQRT2 / sqnorm(l,n);
potp += (-pc*sinm[0][l] + ps *cosm[0][l]) * M_SQRT2 * l / sqnorm(l,n);
potl += (pc *cosm[0][l] + ps *sinm[0][l]) * M_SQRT2;
potr += (dpc*cosm[0][l] + dps*sinm[0][l]) * M_SQRT2;
potp += (-pc*sinm[0][l] + ps *cosm[0][l]) * M_SQRT2 * l;
}

*tdens0 /= scale*scale*scale;
Expand All @@ -620,8 +620,8 @@ void CBrockDisk::get_pot_coefs(int l, const Eigen::VectorXd& coef,
pp = dpp = 0.0;

for (int i=0; i<nmax; i++) {
pp += potd[0](l, i) * coef[i] / sqnorm(l,n);
dpp += dpot[0](l, i) * coef[i] / sqnorm(l,n);
pp += potd[0](l, i) * coef[i] / sqnorm(l,i);
dpp += dpot[0](l, i) * coef[i] / sqnorm(l,i);
}

p = -pp;
Expand All @@ -638,8 +638,8 @@ void CBrockDisk::get_pot_coefs_safe
pp = dpp = 0.0;

for (int i=0; i<nmax; i++) {
pp += potd1(l, i) * coef[i] / sqnorm(l,n);
dpp += dpot1(l, i) * coef[i] / sqnorm(l,n);
pp += potd1(l, i) * coef[i] / sqnorm(l,i);
dpp += dpot1(l, i) * coef[i] / sqnorm(l,i);
}

p = -pp;
Expand All @@ -653,7 +653,7 @@ void CBrockDisk::get_dens_coefs
double pp = 0.0;

for (int i=0; i<nmax; i++)
pp += dend(l, i) * coef[i] / sqnorm(l,n);
pp += dend(l, i) * coef[i] / sqnorm(l,i);

p = pp;
}
Expand Down

0 comments on commit 18d4acc

Please sign in to comment.