Open HanatoK opened 2 weeks ago
As commented in #709 we have already several cases where we are running all biases in sequence: https://github.com/Colvars/colvars/blob/a587282f1e0a8e97fbb440ebd7ca18a82f068fbd/src/colvarmodule.cpp#L1016-L1042
So if there is a dependency like the one you describe, we could just do the same (until we have the AST that you proposed elsewhere).
The only tricky detail would be ensuring that the biases are listed internally in the same order as they were defined in the user input. colvarmodule::parse_biases()
reads all biases of the same type at once, and goes alphabetically over bias types. However, we could record the position of each bias in a new input string and use that position to sort all newly added biases?
It should be possible to use the bias energy, or other output components, of a
colvarbias
instance as the inputs of anothercolvarbias
instance. For example, ahistogram
bias can reuse the bias energies from other biases to perform reweighting on-the-fly.