*/
bool needForeignEnergyDifferences(int64_t step) const;
+ /*! \brief Returns true if AWH has a bias with a free energy lambda state dimension at all.
+ */
+ bool hasFepLambdaDimension() const;
+
private:
/*! \brief Returns whether we need to write output at the current step.
*
*/
bool isOutputStep(int64_t step) const;
- /*! \brief Returns true if AWH has a bias with a free energy lambda state dimension at all.
- */
- bool hasFepLambdaDimension() const;
-
private:
std::vector<BiasCoupledToSystem> biasCoupledToSystem_; /**< AWH biases and definitions of their coupling to the system. */
const int64_t seed_; /**< Random seed for MC jumping with umbrella type bias potential. */
do_log ? fplog : nullptr, step, t,
fr->fcdata.get(), awh.get());
}
+ if (do_log && ir->bDoAwh && awh->hasFepLambdaDimension())
+ {
+ const bool isInitialOutput = false;
+ printLambdaStateToLog(fplog, state->lambda, isInitialOutput);
+ }
if (ir->bPull)
{
}
}
+void printLambdaStateToLog(FILE* fplog, const gmx::ArrayRef<real> lambda, const bool isInitialOutput)
+{
+ if (fplog != nullptr)
+ {
+ fprintf(fplog, "%s vector of lambda components:[ ", isInitialOutput ? "Initial" : "Current");
+ for (const auto& l : lambda)
+ {
+ fprintf(fplog, "%10.4f ", l);
+ }
+ fprintf(fplog, "]\n%s", isInitialOutput ? "" : "\n");
+ }
+}
+
void initialize_lambdas(FILE* fplog,
const t_inputrec& ir,
bool isMaster,
}
/* Send to the log the information on the current lambdas */
- if (fplog != nullptr)
- {
- fprintf(fplog, "Initial vector of lambda components:[ ");
- for (const auto& l : lambda)
- {
- fprintf(fplog, "%10.4f ", l);
- }
- fprintf(fplog, "]\n");
- }
+ const bool isInitialOutput = true;
+ printLambdaStateToLog(fplog, lambda, isInitialOutput);
}
}
};
+/*! \brief Prints the current lambda state to the log file.
+ *
+ * \param[in] fplog The log file. If fplog == nullptr there will be no output.
+ * \param[in] lambda The array of lambda values.
+ * \param[in] isInitialOutput Whether this output is the initial lambda state or not.
+ */
+void printLambdaStateToLog(FILE* fplog, gmx::ArrayRef<real> lambda, bool isInitialOutput);
+
+
/*! \brief Fills fep_state, lambda, and lam0 if needed
*
* If FEP or simulated tempering is in use: