Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

totally remove NEP2 #687

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/force/nep3.cu
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ void NEP3::construct_table(float* parameters)
parameters +
(annmb.dim + 2) * annmb.num_neurons1 * (paramb.version == 4 ? paramb.num_types : 1) + 1;
construct_table_radial_or_angular(
paramb.version,
paramb.num_types,
paramb.num_types_sq,
paramb.n_max_radial,
Expand All @@ -405,7 +404,6 @@ void NEP3::construct_table(float* parameters)
gn_radial.data(),
gnp_radial.data());
construct_table_radial_or_angular(
paramb.version,
paramb.num_types,
paramb.num_types_sq,
paramb.n_max_angular,
Expand Down
2 changes: 0 additions & 2 deletions src/force/nep3_multigpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ NEP3_MULTIGPU::NEP3_MULTIGPU(
(paramb.version == 4 ? paramb.num_types : 1) +
1;
construct_table_radial_or_angular(
paramb.version,
paramb.num_types,
paramb.num_types_sq,
paramb.n_max_radial,
Expand All @@ -365,7 +364,6 @@ NEP3_MULTIGPU::NEP3_MULTIGPU(
gn_radial.data(),
gnp_radial.data());
construct_table_radial_or_angular(
paramb.version,
paramb.num_types,
paramb.num_types_sq,
paramb.n_max_angular,
Expand Down
30 changes: 10 additions & 20 deletions src/utilities/nep_utilities.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,6 @@ __device__ void find_index_and_weight(
}

static void construct_table_radial_or_angular(
const int version,
const int num_types,
const int num_types_sq,
const int n_max,
Expand All @@ -873,26 +872,17 @@ static void construct_table_radial_or_angular(
int t12 = t1 * num_types + t2;
float fn12[MAX_NUM_N];
float fnp12[MAX_NUM_N];
if (version == 2) {
find_fn_and_fnp(n_max, rcinv, d12, fc12, fcp12, fn12, fnp12);
for (int n = 0; n <= n_max; ++n) {
int index_all = (table_index * num_types_sq + t12) * (n_max + 1) + n;
gn[index_all] = fn12[n] * ((num_types == 1) ? 1.0f : c[n * num_types_sq + t12]);
gnp[index_all] = fnp12[n] * ((num_types == 1) ? 1.0f : c[n * num_types_sq + t12]);
}
} else {
find_fn_and_fnp(basis_size, rcinv, d12, fc12, fcp12, fn12, fnp12);
for (int n = 0; n <= n_max; ++n) {
float gn12 = 0.0f;
float gnp12 = 0.0f;
for (int k = 0; k <= basis_size; ++k) {
gn12 += fn12[k] * c[(n * (basis_size + 1) + k) * num_types_sq + t12];
gnp12 += fnp12[k] * c[(n * (basis_size + 1) + k) * num_types_sq + t12];
}
int index_all = (table_index * num_types_sq + t12) * (n_max + 1) + n;
gn[index_all] = gn12;
gnp[index_all] = gnp12;
find_fn_and_fnp(basis_size, rcinv, d12, fc12, fcp12, fn12, fnp12);
for (int n = 0; n <= n_max; ++n) {
float gn12 = 0.0f;
float gnp12 = 0.0f;
for (int k = 0; k <= basis_size; ++k) {
gn12 += fn12[k] * c[(n * (basis_size + 1) + k) * num_types_sq + t12];
gnp12 += fnp12[k] * c[(n * (basis_size + 1) + k) * num_types_sq + t12];
}
int index_all = (table_index * num_types_sq + t12) * (n_max + 1) + n;
gn[index_all] = gn12;
gnp[index_all] = gnp12;
}
}
}
Expand Down
Loading