Skip to content

Commit

Permalink
remove old annealing
Browse files Browse the repository at this point in the history
  • Loading branch information
Massimiliano Bonomi committed Sep 30, 2023
1 parent 77b06d8 commit e6c21cc
Showing 1 changed file with 4 additions and 36 deletions.
40 changes: 4 additions & 36 deletions src/isdb/EMMIVox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class EMMIVOX : public Colvar {

// temperature in kbt
double kbt_;
double kbt0_;
// model - atom types
std::vector<unsigned> Model_type_;
// model - list of atom sigmas - one per atom type
Expand Down Expand Up @@ -183,9 +182,6 @@ class EMMIVOX : public Colvar {
torch::Tensor invs2_nl_gpu_;
torch::Tensor Map_m_nl_gpu_;
torch::DeviceType device_t_;
// annealing stuff
unsigned anneal_;
double anneal_kbt_;
//
// write file with model density
void write_model_density(long int step);
Expand Down Expand Up @@ -273,8 +269,6 @@ void EMMIVOX::registerKeywords( Keywords& keys ) {
keys.add("optional","TEMP","temperature");
keys.add("optional","WRITE_MAP","file with model density");
keys.add("optional","WRITE_MAP_STRIDE","stride for writing model density to file");
keys.add("optional","ANNEAL","initial annealing in number of steps");
keys.add("optional","ANNEAL_TEMP","initial temperature for annealing");
keys.addFlag("NO_AVER",false,"no ensemble averaging in multi-replica mode");
keys.addFlag("CORRELATION",false,"calculate correlation coefficient");
keys.addFlag("GPU",false,"calculate EMMIVOX on GPU with Libtorch");
Expand Down Expand Up @@ -303,8 +297,7 @@ EMMIVOX::EMMIVOX(const ActionOptions&ao):
MCBstride_(1), MCBaccept_(0.), MCBtrials_(0.),
bfactcount_(0), bfactgroup_(1), bfactemin_(false),
martini_(false), statusstride_(0), first_status_(true),
eps_(0.0001), mapstride_(0), gpu_(false),
anneal_(0), anneal_kbt_(0.)
eps_(0.0001), mapstride_(0), gpu_(false)
{
// set constants
inv_sqrt2_ = 1.0/sqrt(2.0);
Expand Down Expand Up @@ -349,10 +342,8 @@ EMMIVOX::EMMIVOX(const ActionOptions&ao):
double temp=0.0;
parse("TEMP",temp);
// convert temp to kbt
if(temp>0.0) kbt0_=plumed.getAtoms().getKBoltzmann()*temp;
else kbt0_=plumed.getAtoms().getKbT();
// set initial temperature
kbt_ = kbt0_;
if(temp>0.0) kbt_=plumed.getAtoms().getKBoltzmann()*temp;
else kbt_=plumed.getAtoms().getKbT();

// scale MC
parse("SCALE", scale_);
Expand Down Expand Up @@ -416,17 +407,6 @@ EMMIVOX::EMMIVOX(const ActionOptions&ao):
gpu_ = false;
}

// annealing stuff
parse("ANNEAL", anneal_);
if(anneal_>0) {
// read initial temperature
parse("ANNEAL_TEMP", anneal_kbt_);
// convert to energy unit
anneal_kbt_ *= plumed.getAtoms().getKBoltzmann();
// compare with kbt0_
if(anneal_kbt_>kbt0_) error("ANNEAL_TEMP must be lower than TEMP");
}

// Martini model
parseFlag("MARTINI",martini_);

Expand Down Expand Up @@ -473,10 +453,6 @@ EMMIVOX::EMMIVOX(const ActionOptions&ao):
}
if(bfactread_) log.printf(" reading Bfactors from file : %s\n", statusfilename_.c_str());
log.printf(" temperature of the system in energy unit : %f\n", kbt_);
if(anneal_>0) {
log.printf(" doing annealing for initial number of steps : %u\n", anneal_);
log.printf(" initial annealing temperature in energy unit : %f\n", anneal_kbt_);
}
if(nrep_>1) {
log.printf(" number of replicas for averaging: %u\n", nrep_);
log.printf(" replica ID : %u\n", replica_);
Expand Down Expand Up @@ -1750,15 +1726,7 @@ void EMMIVOX::calculate()
// get time step
long int step = getStep();

// check if doing annealing
if(anneal_>0 && step<anneal_) {
// set temperature
kbt_ = anneal_kbt_ + (kbt0_ - anneal_kbt_) / static_cast<double>(anneal_) * static_cast<double>(step);
} else {
// reset to input TEMP
kbt_ = kbt0_;
}
// set value
// set temperature value
getPntrToComponent("kbt")->set(kbt_);

// neighbor list update
Expand Down

1 comment on commit e6c21cc

@PlumedBot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found broken examples in automatic/a-masterclass-22-09.txt
Found broken examples in automatic/a-masterclass-22-11.txt
Found broken examples in automatic/a-masterclass-22-12.txt
Found broken examples in automatic/performance-optimization.txt
Found broken examples in automatic/a-trieste-6.txt
Found broken examples in automatic/munster.txt
Found broken examples in automatic/ANN.tmp
Found broken examples in automatic/EDS.tmp
Found broken examples in automatic/EMMI.tmp
Found broken examples in automatic/ENVIRONMENTSIMILARITY.tmp
Found broken examples in automatic/FOURIER_TRANSFORM.tmp
Found broken examples in automatic/FUNCPATHGENERAL.tmp
Found broken examples in automatic/FUNCPATHMSD.tmp
Found broken examples in automatic/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GHBFIX.tmp
Found broken examples in automatic/INCLUDE.tmp
Found broken examples in automatic/MAZE_MEMETIC_SAMPLING.tmp
Found broken examples in automatic/MAZE_OPTIMIZER_BIAS.tmp
Found broken examples in automatic/MAZE_RANDOM_ACCELERATION_MD.tmp
Found broken examples in automatic/MAZE_RANDOM_WALK.tmp
Found broken examples in automatic/MAZE_SIMULATED_ANNEALING.tmp
Found broken examples in automatic/MAZE_STEERED_MD.tmp
Found broken examples in automatic/PIV.tmp
Found broken examples in automatic/PLUMED.tmp
Found broken examples in MiscelaneousPP.md

Please sign in to comment.