apply powint() in a few more cases
This commit is contained in:
@ -318,10 +318,10 @@ double PairAIREBO::init_one(int i, int j)
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
lj1[ii][jj] = 48.0 * epsilon[ii][jj] * pow(sigma[ii][jj],12.0);
|
lj1[ii][jj] = 48.0 * epsilon[ii][jj] * powint(sigma[ii][jj],12);
|
||||||
lj2[ii][jj] = 24.0 * epsilon[ii][jj] * pow(sigma[ii][jj],6.0);
|
lj2[ii][jj] = 24.0 * epsilon[ii][jj] * powint(sigma[ii][jj],6);
|
||||||
lj3[ii][jj] = 4.0 * epsilon[ii][jj] * pow(sigma[ii][jj],12.0);
|
lj3[ii][jj] = 4.0 * epsilon[ii][jj] * powint(sigma[ii][jj],12);
|
||||||
lj4[ii][jj] = 4.0 * epsilon[ii][jj] * pow(sigma[ii][jj],6.0);
|
lj4[ii][jj] = 4.0 * epsilon[ii][jj] * powint(sigma[ii][jj],6);
|
||||||
}
|
}
|
||||||
|
|
||||||
cutghost[j][i] = cutghost[i][j];
|
cutghost[j][i] = cutghost[i][j];
|
||||||
@ -4038,8 +4038,7 @@ def output_matrix(n, k, A):
|
|||||||
tricubic spline coefficient calculation
|
tricubic spline coefficient calculation
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairAIREBO::Sptricubic_patch_adjust(double * dl, double wid, double lo,
|
void PairAIREBO::Sptricubic_patch_adjust(double *dl, double wid, double lo, char dir) {
|
||||||
char dir) {
|
|
||||||
int rowOuterL = 16, rowInnerL = 1, colL = 4;
|
int rowOuterL = 16, rowInnerL = 1, colL = 4;
|
||||||
if (dir == 'R') {
|
if (dir == 'R') {
|
||||||
rowOuterL = 4;
|
rowOuterL = 4;
|
||||||
@ -4057,7 +4056,7 @@ void PairAIREBO::Sptricubic_patch_adjust(double * dl, double wid, double lo,
|
|||||||
double acc = 0;
|
double acc = 0;
|
||||||
for (int k = col; k < 4; k++) {
|
for (int k = col; k < 4; k++) {
|
||||||
acc += dl[rowOuterL * rowOuter + rowInnerL * rowInner + colL * k]
|
acc += dl[rowOuterL * rowOuter + rowInnerL * rowInner + colL * k]
|
||||||
* pow(wid, -k) * pow(-lo, k - col) * binomial[k] / binomial[col]
|
* powint(wid, -k) * powint(-lo, k - col) * binomial[k] / binomial[col]
|
||||||
/ binomial[k - col];
|
/ binomial[k - col];
|
||||||
}
|
}
|
||||||
dl[rowOuterL * rowOuter + rowInnerL * rowInner + colL * col] = acc;
|
dl[rowOuterL * rowOuter + rowInnerL * rowInner + colL * col] = acc;
|
||||||
@ -4162,8 +4161,7 @@ void PairAIREBO::Sptricubic_patch_coeffs(
|
|||||||
bicubic spline coefficient calculation
|
bicubic spline coefficient calculation
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PairAIREBO::Spbicubic_patch_adjust(double * dl, double wid, double lo,
|
void PairAIREBO::Spbicubic_patch_adjust(double *dl, double wid, double lo, char dir) {
|
||||||
char dir) {
|
|
||||||
int rowL = dir == 'R' ? 1 : 4;
|
int rowL = dir == 'R' ? 1 : 4;
|
||||||
int colL = dir == 'L' ? 1 : 4;
|
int colL = dir == 'L' ? 1 : 4;
|
||||||
double binomial[5] = {1, 1, 2, 6};
|
double binomial[5] = {1, 1, 2, 6};
|
||||||
@ -4171,7 +4169,7 @@ void PairAIREBO::Spbicubic_patch_adjust(double * dl, double wid, double lo,
|
|||||||
for (int col = 0; col < 4; col++) {
|
for (int col = 0; col < 4; col++) {
|
||||||
double acc = 0;
|
double acc = 0;
|
||||||
for (int k = col; k < 4; k++) {
|
for (int k = col; k < 4; k++) {
|
||||||
acc += dl[rowL * row + colL * k] * pow(wid, -k) * pow(-lo, k - col)
|
acc += dl[rowL * row + colL * k] * powint(wid, -k) * powint(-lo, k - col)
|
||||||
* binomial[k] / binomial[col] / binomial[k - col];
|
* binomial[k] / binomial[col] / binomial[k - col];
|
||||||
}
|
}
|
||||||
dl[rowL * row + colL * col] = acc;
|
dl[rowL * row + colL * col] = acc;
|
||||||
|
|||||||
Reference in New Issue
Block a user