@@ -318,33 +318,15 @@ colvarbias_meta::~colvarbias_meta()
318
318
{
319
319
colvarbias_meta::clear_state_data ();
320
320
colvarproxy *proxy = cvm::main ()->proxy ;
321
-
322
321
proxy->close_output_stream (replica_hills_file);
323
-
324
322
proxy->close_output_stream (hills_traj_file_name ());
325
-
326
- if (target_dist) {
327
- delete target_dist;
328
- target_dist = NULL ;
329
- }
330
323
}
331
324
332
325
333
326
int colvarbias_meta::clear_state_data ()
334
327
{
335
- if (hills_energy) {
336
- delete hills_energy;
337
- hills_energy = NULL ;
338
- }
339
-
340
- if (hills_energy_gradients) {
341
- delete hills_energy_gradients;
342
- hills_energy_gradients = NULL ;
343
- }
344
-
345
328
hills.clear ();
346
329
hills_off_grid.clear ();
347
-
348
330
return COLVARS_OK;
349
331
}
350
332
@@ -626,8 +608,7 @@ int colvarbias_meta::update_grid_data()
626
608
{
627
609
if ((cvm::step_absolute () % grids_freq) == 0 ) {
628
610
// map the most recent gaussians to the grids
629
- project_hills (new_hills_begin, hills.end (),
630
- hills_energy, hills_energy_gradients);
611
+ project_hills (new_hills_begin, hills.end (), hills_energy.get (), hills_energy_gradients.get ());
631
612
new_hills_begin = hills.end ();
632
613
633
614
// TODO: we may want to condense all into one replicas array,
@@ -636,8 +617,8 @@ int colvarbias_meta::update_grid_data()
636
617
for (size_t ir = 0 ; ir < replicas.size (); ir++) {
637
618
replicas[ir]->project_hills (replicas[ir]->new_hills_begin ,
638
619
replicas[ir]->hills .end (),
639
- replicas[ir]->hills_energy ,
640
- replicas[ir]->hills_energy_gradients );
620
+ replicas[ir]->hills_energy . get () ,
621
+ replicas[ir]->hills_energy_gradients . get () );
641
622
replicas[ir]->new_hills_begin = replicas[ir]->hills .end ();
642
623
}
643
624
}
@@ -962,8 +943,7 @@ void colvarbias_meta::project_hills(colvarbias_meta::hill_iter h_first,
962
943
963
944
964
945
void colvarbias_meta::recount_hills_off_grid (colvarbias_meta::hill_iter h_first,
965
- colvarbias_meta::hill_iter h_last,
966
- colvar_grid_scalar * /* he */ )
946
+ colvarbias_meta::hill_iter h_last)
967
947
{
968
948
hills_off_grid.clear ();
969
949
@@ -1471,9 +1451,9 @@ void colvarbias_meta::rebin_grids_after_restart()
1471
1451
if (restart_keep_hills && !hills.empty ()) {
1472
1452
// if there are hills, recompute the new grids from them
1473
1453
cvm::log (" Rebinning the energy and forces grids from " +
1474
- cvm::to_str (hills.size ())+" hills (this may take a while )...\n " );
1475
- project_hills (hills.begin (), hills.end (),
1476
- new_hills_energy, new_hills_energy_gradients, true );
1454
+ cvm::to_str (hills.size ())+" hills (this may take a bit )...\n " );
1455
+ project_hills (hills.begin (), hills.end (), new_hills_energy. get (),
1456
+ new_hills_energy_gradients. get () , true );
1477
1457
cvm::log (" rebinning done.\n " );
1478
1458
1479
1459
} else {
0 commit comments