Skip to content

Commit 40b1b7f

Browse files
giacomofiorinjhenin
authored andcommitted
refactor: Add back function parameters lost during rebase
1 parent f4e0408 commit 40b1b7f

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

src/colvarcomp_coordnums.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,13 @@ void inline colvar::coordnum::main_loop()
232232
compute_pair_coordnum<flags | ef_use_internal_pbc>(inv_r0_vec, inv_r0sq_vec, en, ed,
233233
x1, y1, z1, x2, y2, z2,
234234
gx1, gy1, gz1, gx2, gy2, gz2,
235-
tolerance, tolerance_l2_max) :
235+
tolerance, tolerance_l2_max,
236+
cvmodule) :
236237
compute_pair_coordnum<flags>(inv_r0_vec, inv_r0sq_vec, en, ed,
237238
x1, y1, z1, x2, y2, z2,
238239
gx1, gy1, gz1, gx2, gy2, gz2,
239-
tolerance, tolerance_l2_max) ) :
240+
tolerance, tolerance_l2_max,
241+
cvmodule) ) :
240242
0.0;
241243

242244
if ((flags & ef_use_pairlist) && (flags & ef_rebuild_pairlist)) {
@@ -444,7 +446,8 @@ void colvar::h_bond::calc_value()
444446
atom_groups[0]->grad_x(1),
445447
atom_groups[0]->grad_y(1),
446448
atom_groups[0]->grad_z(1),
447-
0.0, 1.0e20);
449+
0.0, 1.0e20,
450+
cvmodule);
448451
// Skip the gradient
449452
}
450453

@@ -475,7 +478,8 @@ void colvar::h_bond::calc_gradients()
475478
atom_groups[0]->grad_x(1),
476479
atom_groups[0]->grad_y(1),
477480
atom_groups[0]->grad_z(1),
478-
0.0, 1.0e20);
481+
0.0, 1.0e20,
482+
cvmodule);
479483
}
480484

481485

@@ -517,11 +521,13 @@ template <int flags> inline void colvar::selfcoordnum::selfcoordnum_sequential_l
517521
compute_pair_coordnum<flags | ef_use_internal_pbc>(inv_r0_vec, inv_r0sq_vec, en, ed,
518522
x1, y1, z1, x2, y2, z2,
519523
gx1, gy1, gz1, gx2, gy2, gz2,
520-
tolerance, tolerance_l2_max) :
524+
tolerance, tolerance_l2_max,
525+
cvmodule) :
521526
compute_pair_coordnum<flags>(inv_r0_vec, inv_r0sq_vec, en, ed,
522527
x1, y1, z1, x2, y2, z2,
523528
gx1, gy1, gz1, gx2, gy2, gz2,
524-
tolerance, tolerance_l2_max) ) :
529+
tolerance, tolerance_l2_max,
530+
cvmodule) ) :
525531
0.0;
526532

527533
if ((flags & ef_use_pairlist) && (flags & ef_rebuild_pairlist)) {

src/colvarcomp_coordnums.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ class colvar::coordnum : public colvar::cvc {
5555
const cvm::real a2x, const cvm::real a2y, const cvm::real a2z,
5656
cvm::real &g1x, cvm::real &g1y, cvm::real &g1z,
5757
cvm::real &g2x, cvm::real &g2y, cvm::real &g2z,
58-
cvm::real pairlist_tol, cvm::real pairlist_tol_l2_max);
58+
cvm::real pairlist_tol, cvm::real pairlist_tol_l2_max,
59+
colvarmodule *cvmodule);
5960

6061
/// Workhorse function
6162
template <bool use_group1_com, bool use_group2_com, int flags> int compute_coordnum();
@@ -245,13 +246,14 @@ inline cvm::real colvar::coordnum::compute_pair_coordnum(cvm::rvector const &inv
245246
cvm::real& g2y,
246247
cvm::real& g2z,
247248
cvm::real pairlist_tol,
248-
cvm::real pairlist_tol_l2_max)
249+
cvm::real pairlist_tol_l2_max,
250+
colvarmodule *cvmodule_in)
249251
{
250252
const cvm::atom_pos pos1{a1x, a1y, a1z};
251253
const cvm::atom_pos pos2{a2x, a2y, a2z};
252254
cvm::rvector const diff = (flags & ef_use_internal_pbc)
253-
? cvm::main()->proxy->position_distance_internal(pos1, pos2)
254-
: cvm::main()->proxy->position_distance(pos1, pos2);
255+
? cvmodule_in->proxy->position_distance_internal(pos1, pos2)
256+
: cvmodule_in->proxy->position_distance(pos1, pos2);
255257

256258
cvm::rvector const scal_diff(diff.x * inv_r0_vec.x,
257259
diff.y * inv_r0_vec.y,

0 commit comments

Comments
 (0)