From 81fe63c8c832f9778cd6ec29f8a5ee392de10ecd Mon Sep 17 00:00:00 2001 From: brucefan1983 Date: Sat, 21 Sep 2024 23:41:00 +0800 Subject: [PATCH] fix typewise bug --- src/main_nep/dataset.cu | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main_nep/dataset.cu b/src/main_nep/dataset.cu index 3e250609..4a33849c 100644 --- a/src/main_nep/dataset.cu +++ b/src/main_nep/dataset.cu @@ -191,6 +191,8 @@ static __global__ void gpu_find_neighbor_number( const int* Na, const int* Na_sum, const bool use_typewise_cutoff, + const float typewise_cutoff_radial_factor, + const float typewise_cutoff_angular_factor, const int* g_type, const int* g_atomic_numbers, const float g_rc_radial, @@ -237,8 +239,8 @@ static __global__ void gpu_find_neighbor_number( if (use_typewise_cutoff) { int z1 = g_atomic_numbers[t1]; int z2 = g_atomic_numbers[t2]; - rc_radial = min((COVALENT_RADIUS[z1] + COVALENT_RADIUS[z2]) * 2.5f, rc_radial); - rc_angular = min((COVALENT_RADIUS[z1] + COVALENT_RADIUS[z2]) * 2.0f, rc_angular); + rc_radial = min((COVALENT_RADIUS[z1] + COVALENT_RADIUS[z2]) * typewise_cutoff_radial_factor, rc_radial); + rc_angular = min((COVALENT_RADIUS[z1] + COVALENT_RADIUS[z2]) * typewise_cutoff_angular_factor, rc_angular); } if (distance_square < rc_radial * rc_radial) { count_radial++; @@ -274,6 +276,8 @@ void Dataset::find_neighbor(Parameters& para) Na.data(), Na_sum.data(), para.use_typewise_cutoff, + para.typewise_cutoff_radial_factor, + para.typewise_cutoff_angular_factor, type.data(), atomic_numbers.data(), para.rc_radial,