state_.doSkippedUpdatesInNeighborhood(params_, grid_);
}
convolvedBias = state_.updateProbabilityWeightsAndConvolvedBias(
- dimParams_, grid_, moveUmbrella ? neighborLambdaEnergies : ArrayRef<const double>{},
- &probWeightNeighbor);
+ dimParams_, grid_, moveUmbrella ? neighborLambdaEnergies : ArrayRef<const double>{}, &probWeightNeighbor);
if (isSampleCoordStep)
{
double potential;
if (params_.convolveForce)
{
- state_.calcConvolvedForce(dimParams_, grid_, probWeightNeighbor,
+ state_.calcConvolvedForce(dimParams_,
+ grid_,
+ probWeightNeighbor,
moveUmbrella ? neighborLambdaDhdl : ArrayRef<const double>{},
- tempForce_, biasForce_);
+ tempForce_,
+ biasForce_);
potential = -convolvedBias * params_.invBeta;
}
"AWH bias grid point for the umbrella reference value is outside of the "
"target region.");
potential = state_.calcUmbrellaForceAndPotential(
- dimParams_, grid_, coordState.umbrellaGridpoint(),
- moveUmbrella ? neighborLambdaDhdl : ArrayRef<const double>{}, biasForce_);
+ dimParams_,
+ grid_,
+ coordState.umbrellaGridpoint(),
+ moveUmbrella ? neighborLambdaDhdl : ArrayRef<const double>{},
+ biasForce_);
/* Moving the umbrella results in a force correction and
* a new potential. The umbrella center is sampled as often as
if (moveUmbrella)
{
const bool onlySampleUmbrellaGridpoint = false;
- double newPotential = state_.moveUmbrella(dimParams_, grid_, probWeightNeighbor,
- neighborLambdaDhdl, biasForce_, step, seed,
- params_.biasIndex, onlySampleUmbrellaGridpoint);
- *potentialJump = newPotential - potential;
+ double newPotential = state_.moveUmbrella(dimParams_,
+ grid_,
+ probWeightNeighbor,
+ neighborLambdaDhdl,
+ biasForce_,
+ step,
+ seed,
+ params_.biasIndex,
+ onlySampleUmbrellaGridpoint);
+ *potentialJump = newPotential - potential;
}
}
/* Update the free energy estimates and bias and other history dependent method parameters */
if (params_.isUpdateFreeEnergyStep(step))
{
- state_.updateFreeEnergyAndAddSamplesToHistogram(dimParams_, grid_, params_, commRecord, ms,
- t, step, fplog, &updateList_);
+ state_.updateFreeEnergyAndAddSamplesToHistogram(
+ dimParams_, grid_, params_, commRecord, ms, t, step, fplog, &updateList_);
if (params_.convolveForce)
{
if (moveUmbrella && params_.convolveForce && grid_.hasLambdaAxis())
{
const bool onlySampleUmbrellaGridpoint = true;
- state_.moveUmbrella(dimParams_, grid_, probWeightNeighbor, neighborLambdaDhdl, biasForce_,
- step, seed, params_.biasIndex, onlySampleUmbrellaGridpoint);
+ state_.moveUmbrella(dimParams_,
+ grid_,
+ probWeightNeighbor,
+ neighborLambdaDhdl,
+ biasForce_,
+ step,
+ seed,
+ params_.biasIndex,
+ onlySampleUmbrellaGridpoint);
}
/* Return the potential. */
"The number of AWH updates in the checkpoint file (%" PRId64
") does not match the total number of AWH samples divided by the number of samples "
"per update for %d sharing AWH bias(es) (%" PRId64 "/%d=%" PRId64 ")",
- numUpdatesExpected, params.numSharedUpdate, numSamples,
- params.numSamplesUpdateFreeEnergy_ * params.numSharedUpdate, numUpdatesFromSamples);
+ numUpdatesExpected,
+ params.numSharedUpdate,
+ numSamples,
+ params.numSamplesUpdateFreeEnergy_ * params.numSharedUpdate,
+ numUpdatesFromSamples);
mesg += " Maybe you changed AWH parameters.";
/* Unfortunately we currently do not store the number of simulations
* sharing the bias or the state to checkpoint. But we can hint at
mesg += gmx::formatString(
" Or the run you continued from used %" PRId64
" sharing simulations, whereas you now specified %d sharing simulations.",
- numUpdatesFromSamples / state.histogramSize().numUpdates(), params.numSharedUpdate);
+ numUpdatesFromSamples / state.histogramSize().numUpdates(),
+ params.numSharedUpdate);
}
GMX_THROW(InvalidInputError(mesg));
}
*/
double blockLength = 0;
/* Construct the force correlation object. */
- forceCorrelationGrid_ = std::make_unique<CorrelationGrid>(
- state_.points().size(), ndim(), blockLength,
- CorrelationGrid::BlockLengthMeasure::Time, awhParams.nstSampleCoord * mdTimeStep);
+ forceCorrelationGrid_ =
+ std::make_unique<CorrelationGrid>(state_.points().size(),
+ ndim(),
+ blockLength,
+ CorrelationGrid::BlockLengthMeasure::Time,
+ awhParams.nstSampleCoord * mdTimeStep);
writer_ = std::make_unique<BiasWriter>(*this);
}
fprintf(fplog,
"%s initial force correlation block length = %g %s"
"%s force correlation number of blocks = %d",
- prefix.c_str(), forceCorrelationGrid().getBlockLength(),
+ prefix.c_str(),
+ forceCorrelationGrid().getBlockLength(),
forceCorrelationGrid().blockLengthMeasure == CorrelationGrid::BlockLengthMeasure::Weight
? ""
: "ps",
- prefix.c_str(), forceCorrelationGrid().getNumBlocks());
+ prefix.c_str(),
+ forceCorrelationGrid().getNumBlocks());
}
}
We actually add the force normalized by beta which has the units of 1/length. This means that the
resulting correlation time integral is directly in units of friction time/length^2 which is really what
we're interested in. */
- state_.calcUmbrellaForceAndPotential(dimParams_, grid_, indexNeighbor, neighborLambdaDhdl,
- forceFromNeighbor);
+ state_.calcUmbrellaForceAndPotential(
+ dimParams_, grid_, indexNeighbor, neighborLambdaDhdl, forceFromNeighbor);
/* Note: we might want to give a whole list of data to add instead and have this loop in the data adding function */
forceCorrelationGrid_->addData(indexNeighbor, weightNeighbor, forceFromNeighbor, t);