File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -1022,6 +1022,7 @@ void colvargrid_integrate::prepare_calculations()
10221022 }
10231023 }
10241024 }
1025+ is_calculations_prepared = true ;
10251026}
10261027
10271028cvm::real colvargrid_integrate::get_regularized_weight (std::vector<int > &ix)
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ class colvargrid_integrate : public colvar_grid_scalar {
4545 void set_weighted_div ();
4646
4747 void set_div (){
48+ if (!is_calculations_prepared)
49+ prepare_calculations ();
4850 if (weighted) set_weighted_div ();
4951 else set_unweighted_div ();
5052 };
@@ -106,6 +108,8 @@ class colvargrid_integrate : public colvar_grid_scalar {
106108 // / sets itself to number of available OpenMP threads
107109 size_t m_num_threads = 1 ;
108110
111+ bool is_calculations_prepared = false ;
112+
109113 // Get G at a specific point where G is the gradient F if there is enough observation else it's F
110114 // multiplied by a coefficient < 1
111115 void get_regularized_grad (std::vector<cvm::real> &F, std::vector<int > &ix);
You can’t perform that action at this time.
0 commit comments