Ignore:
Timestamp:
Nov 4, 2009, 7:56:04 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
4ef101, aa8542
Parents:
ec70ec
Message:

Huge change from ofstream * (const) out --> Log().

  • first shift was done via regular expressions
  • then via error messages from the code
  • note that class atom, class element and class molecule kept in parts their output stream, was they print to file.
  • make check runs fine
  • MISSING: Verbosity is not fixed for everything (i.e. if no endl; is present and next has Verbose(0) ...)

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecule_dynamics.cpp

    rec70ec r543ce4  
    99#include "config.hpp"
    1010#include "element.hpp"
     11#include "log.hpp"
    1112#include "memoryallocator.hpp"
    1213#include "molecule.hpp"
     
    6364      tmp = trajectory2.Norm();  // remaining norm is distance
    6465    } else if ((fabs(trajectory1.ScalarProduct(&trajectory2)/Norm1/Norm2) - 1.) < MYEPSILON) { // check whether they're linear dependent
    65   //        *out << Verbose(3) << "Both trajectories of " << *Walker << " and " << *Runner << " are linear dependent: ";
    66   //        *out << trajectory1;
    67   //        *out << " and ";
    68   //        *out << trajectory2;
     66  //        Log() << Verbose(3) << "Both trajectories of " << *Walker << " and " << *Runner << " are linear dependent: ";
     67  //        Log() << Verbose(0) << trajectory1;
     68  //        Log() << Verbose(0) << " and ";
     69  //        Log() << Verbose(0) << trajectory2;
    6970      tmp = Walker->Trajectory.R.at(Params.startstep).Distance(&Runner->Trajectory.R.at(Params.startstep));
    70   //        *out << " with distance " << tmp << "." << endl;
     71  //        Log() << Verbose(0) << " with distance " << tmp << "." << endl;
    7172    } else { // determine distance by finding minimum distance
    72   //        *out << Verbose(3) << "Both trajectories of " << *Walker << " and " << *Runner << " are linear independent ";
    73   //        *out << endl;
    74   //        *out << "First Trajectory: ";
    75   //        *out << trajectory1 << endl;
    76   //        *out << "Second Trajectory: ";
    77   //        *out << trajectory2 << endl;
     73  //        Log() << Verbose(3) << "Both trajectories of " << *Walker << " and " << *Runner << " are linear independent ";
     74  //        Log() << Verbose(0) << endl;
     75  //        Log() << Verbose(0) << "First Trajectory: ";
     76  //        Log() << Verbose(0) << trajectory1 << endl;
     77  //        Log() << Verbose(0) << "Second Trajectory: ";
     78  //        Log() << Verbose(0) << trajectory2 << endl;
    7879      // determine normal vector for both
    7980      normal.MakeNormalVector(&trajectory1, &trajectory2);
    8081      // print all vectors for debugging
    81   //        *out << "Normal vector in between: ";
    82   //        *out << normal << endl;
     82  //        Log() << Verbose(0) << "Normal vector in between: ";
     83  //        Log() << Verbose(0) << normal << endl;
    8384      // setup matrix
    8485      for (int i=NDIM;i--;) {
     
    9293      // distance from last component
    9394      tmp = gsl_vector_get(x,2);
    94   //        *out << " with distance " << tmp << "." << endl;
     95  //        Log() << Verbose(0) << " with distance " << tmp << "." << endl;
    9596      // test whether we really have the intersection (by checking on c_1 and c_2)
    9697      TestVector.CopyVector(&Runner->Trajectory.R.at(Params.startstep));
     
    103104      TestVector.SubtractVector(&trajectory1);
    104105      if (TestVector.Norm() < MYEPSILON) {
    105   //          *out << Verbose(2) << "Test: ok.\tDistance of " << tmp << " is correct." << endl;
     106  //          Log() << Verbose(2) << "Test: ok.\tDistance of " << tmp << " is correct." << endl;
    106107      } else {
    107   //          *out << Verbose(2) << "Test: failed.\tIntersection is off by ";
    108   //          *out << TestVector;
    109   //          *out << "." << endl;
     108  //          Log() << Verbose(2) << "Test: failed.\tIntersection is off by ";
     109  //          Log() << Verbose(0) << TestVector;
     110  //          Log() << Verbose(0) << "." << endl;
    110111      }
    111112    }
     
    114115    if (fabs(tmp) > MYEPSILON) {
    115116      result += Params.PenaltyConstants[1] * 1./tmp;
    116       //*out << Verbose(4) << "Adding " << 1./tmp*constants[1] << "." << endl;
     117      //Log() << Verbose(4) << "Adding " << 1./tmp*constants[1] << "." << endl;
    117118    }
    118119  }
     
    134135    if ((Params.PermutationMap[Walker->nr] == Params.PermutationMap[Runner->nr]) && (Walker->nr < Runner->nr)) {
    135136  //    atom *Sprinter = PermutationMap[Walker->nr];
    136   //        *out << *Walker << " and " << *Runner << " are heading to the same target at ";
    137   //        *out << Sprinter->Trajectory.R.at(endstep);
    138   //        *out << ", penalting." << endl;
     137  //        Log() << Verbose(0) << *Walker << " and " << *Runner << " are heading to the same target at ";
     138  //        Log() << Verbose(0) << Sprinter->Trajectory.R.at(endstep);
     139  //        Log() << Verbose(0) << ", penalting." << endl;
    139140      result += Params.PenaltyConstants[2];
    140       //*out << Verbose(4) << "Adding " << constants[2] << "." << endl;
     141      //Log() << Verbose(4) << "Adding " << constants[2] << "." << endl;
    141142    }
    142143  }
     
    159160 * \todo There's a bit double counting going on for the first time, bu nothing to worry really about.
    160161 */
    161 double molecule::ConstrainedPotential(ofstream *out, struct EvaluatePotential &Params)
     162double molecule::ConstrainedPotential(struct EvaluatePotential &Params)
    162163{
    163164  double tmp, result;
     
    173174    tmp *= Params.IsAngstroem ? 1. : 1./AtomicLengthToAngstroem;
    174175    result += Params.PenaltyConstants[0] * tmp;
    175     //*out << Verbose(4) << "Adding " << tmp*constants[0] << "." << endl;
     176    //Log() << Verbose(4) << "Adding " << tmp*constants[0] << "." << endl;
    176177
    177178    // second term: sum of distances to other trajectories
     
    190191 * \param AtomCount number of atoms
    191192 */
    192 void PrintPermutationMap(ofstream *out, int AtomCount, struct EvaluatePotential &Params)
     193void PrintPermutationMap(int AtomCount, struct EvaluatePotential &Params)
    193194{
    194195  stringstream zeile1, zeile2;
     
    206207    doubles++;
    207208  if (doubles >0)
    208     *out << "Found " << doubles << " Doubles." << endl;
     209    Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl;
    209210  Free(&DoubleList);
    210 //  *out << zeile1.str() << endl << zeile2.str() << endl;
     211//  Log() << Verbose(2) << zeile1.str() << endl << zeile2.str() << endl;
    211212};
    212213
     
    239240 * \param &Params constrained potential parameters
    240241 */
    241 void CreateInitialLists(ofstream *out, molecule *mol, struct EvaluatePotential &Params)
     242void CreateInitialLists(molecule *mol, struct EvaluatePotential &Params)
    242243{
    243244  atom *Walker = mol->start;
     
    248249    Params.DoubleList[Params.DistanceList[Walker->nr]->begin()->second->nr]++;            // increase this target's source count (>1? not injective)
    249250    Params.DistanceIterators[Walker->nr] = Params.DistanceList[Walker->nr]->begin();    // and remember which one we picked
    250     *out << *Walker << " starts with distance " << Params.DistanceList[Walker->nr]->begin()->first << "." << endl;
     251    Log() << Verbose(2) << *Walker << " starts with distance " << Params.DistanceList[Walker->nr]->begin()->first << "." << endl;
    251252  }
    252253};
     
    259260 * \param &Params constrained potential parameters
    260261 */
    261 double TryNextNearestNeighbourForInjectivePermutation(ofstream *out, molecule *mol, atom *Walker, double &OldPotential, struct EvaluatePotential &Params)
     262double TryNextNearestNeighbourForInjectivePermutation(molecule *mol, atom *Walker, double &OldPotential, struct EvaluatePotential &Params)
    262263{
    263264  double Potential = 0;
     
    268269  if (NewBase != Params.DistanceList[Walker->nr]->end()) {
    269270    Params.PermutationMap[Walker->nr] = NewBase->second;
    270     Potential = fabs(mol->ConstrainedPotential(out, Params));
     271    Potential = fabs(mol->ConstrainedPotential(Params));
    271272    if (Potential > OldPotential) { // undo
    272273      Params.PermutationMap[Walker->nr] = Params.DistanceIterators[Walker->nr]->second;
     
    276277      Params.DistanceIterators[Walker->nr] = NewBase;
    277278      OldPotential = Potential;
    278       *out << Verbose(3) << "Found a new permutation, new potential is " << OldPotential << "." << endl;
     279      Log() << Verbose(3) << "Found a new permutation, new potential is " << OldPotential << "." << endl;
    279280    }
    280281  }
     
    287288 * \param &Params constrained potential parameters
    288289 */
    289 void MakeInjectivePermutation(ofstream *out, molecule *mol, struct EvaluatePotential &Params)
     290void MakeInjectivePermutation(molecule *mol, struct EvaluatePotential &Params)
    290291{
    291292  atom *Walker = mol->start;
    292293  DistanceMap::iterator NewBase;
    293   double Potential = fabs(mol->ConstrainedPotential(out, Params));
     294  double Potential = fabs(mol->ConstrainedPotential(Params));
    294295
    295296  while ((Potential) > Params.PenaltyConstants[2]) {
    296     PrintPermutationMap(out, mol->AtomCount, Params);
     297    PrintPermutationMap(mol->AtomCount, Params);
    297298    Walker = Walker->next;
    298299    if (Walker == mol->end) // round-robin at the end
     
    301302      continue;
    302303    // now, try finding a new one
    303     Potential = TryNextNearestNeighbourForInjectivePermutation(out, mol, Walker, Potential, Params);
     304    Potential = TryNextNearestNeighbourForInjectivePermutation(mol, Walker, Potential, Params);
    304305  }
    305306  for (int i=mol->AtomCount; i--;) // now each single entry in the DoubleList should be <=1
    306307    if (Params.DoubleList[i] > 1) {
    307       cerr << "Failed to create an injective PermutationMap!" << endl;
     308      eLog() << Verbose(0) << "Failed to create an injective PermutationMap!" << endl;
    308309      exit(1);
    309310    }
    310   *out << Verbose(1) << "done." << endl;
     311  Log() << Verbose(1) << "done." << endl;
    311312};
    312313
     
    338339 * \bug this all is not O(N log N) but O(N^2)
    339340 */
    340 double molecule::MinimiseConstrainedPotential(ofstream *out, atom **&PermutationMap, int startstep, int endstep, bool IsAngstroem)
     341double molecule::MinimiseConstrainedPotential(atom **&PermutationMap, int startstep, int endstep, bool IsAngstroem)
    341342{
    342343  double Potential, OldPotential, OlderPotential;
     
    357358  Params.PenaltyConstants[2] = 1e+7;    // just a huge penalty
    358359  // generate the distance list
    359   *out << Verbose(1) << "Allocating, initializting and filling the distance list ... " << endl;
     360  Log() << Verbose(1) << "Allocating, initializting and filling the distance list ... " << endl;
    360361  FillDistanceList(this, Params);
    361362
    362363  // create the initial PermutationMap (source -> target)
    363   CreateInitialLists(out, this, Params);
     364  CreateInitialLists(this, Params);
    364365
    365366  // make the PermutationMap injective by checking whether we have a non-zero constants[2] term in it
    366   *out << Verbose(1) << "Making the PermutationMap injective ... " << endl;
    367   MakeInjectivePermutation(out, this, Params);
     367  Log() << Verbose(1) << "Making the PermutationMap injective ... " << endl;
     368  MakeInjectivePermutation(this, Params);
    368369  Free(&Params.DoubleList);
    369370
    370371  // argument minimise the constrained potential in this injective PermutationMap
    371   *out << Verbose(1) << "Argument minimising the PermutationMap, at current potential " << OldPotential << " ... " << endl;
     372  Log() << Verbose(1) << "Argument minimising the PermutationMap, at current potential " << OldPotential << " ... " << endl;
    372373  OldPotential = 1e+10;
    373374  round = 0;
    374375  do {
    375     *out << "Starting round " << ++round << " ... " << endl;
     376    Log() << Verbose(2) << "Starting round " << ++round << " ... " << endl;
    376377    OlderPotential = OldPotential;
    377378    do {
     
    379380      while (Walker->next != end) { // pick one
    380381        Walker = Walker->next;
    381         PrintPermutationMap(out, AtomCount, Params);
     382        PrintPermutationMap(AtomCount, Params);
    382383        Sprinter = Params.DistanceIterators[Walker->nr]->second;   // store initial partner
    383384        Strider = Params.DistanceIterators[Walker->nr];  //remember old iterator
     
    387388          break;
    388389        }
    389         //*out << Verbose(2) << "Current Walker: " << *Walker << " with old/next candidate " << *Sprinter << "/" << *DistanceIterators[Walker->nr]->second << "." << endl;
     390        //Log() << Verbose(2) << "Current Walker: " << *Walker << " with old/next candidate " << *Sprinter << "/" << *DistanceIterators[Walker->nr]->second << "." << endl;
    390391        // find source of the new target
    391392        Runner = start->next;
    392393        while(Runner != end) { // find the source whose toes we might be stepping on (Walker's new target should be in use by another already)
    393394          if (Params.PermutationMap[Runner->nr] == Params.DistanceIterators[Walker->nr]->second) {
    394             //*out << Verbose(2) << "Found the corresponding owner " << *Runner << " to " << *PermutationMap[Runner->nr] << "." << endl;
     395            //Log() << Verbose(2) << "Found the corresponding owner " << *Runner << " to " << *PermutationMap[Runner->nr] << "." << endl;
    395396            break;
    396397          }
     
    404405              break;
    405406          if (Rider != Params.DistanceList[Runner->nr]->end()) { // if we have found one
    406             //*out << Verbose(2) << "Current Other: " << *Runner << " with old/next candidate " << *PermutationMap[Runner->nr] << "/" << *Rider->second << "." << endl;
     407            //Log() << Verbose(2) << "Current Other: " << *Runner << " with old/next candidate " << *PermutationMap[Runner->nr] << "/" << *Rider->second << "." << endl;
    407408            // exchange both
    408409            Params.PermutationMap[Walker->nr] = Params.DistanceIterators[Walker->nr]->second; // put next farther distance into PermutationMap
    409410            Params.PermutationMap[Runner->nr] = Sprinter;  // and hand the old target to its respective owner
    410             PrintPermutationMap(out, AtomCount, Params);
     411            PrintPermutationMap(AtomCount, Params);
    411412            // calculate the new potential
    412             //*out << Verbose(2) << "Checking new potential ..." << endl;
    413             Potential = ConstrainedPotential(out, Params);
     413            //Log() << Verbose(2) << "Checking new potential ..." << endl;
     414            Potential = ConstrainedPotential(Params);
    414415            if (Potential > OldPotential) { // we made everything worse! Undo ...
    415               //*out << Verbose(3) << "Nay, made the potential worse: " << Potential << " vs. " << OldPotential << "!" << endl;
    416               //*out << Verbose(3) << "Setting " << *Runner << "'s source to " << *Params.DistanceIterators[Runner->nr]->second << "." << endl;
     416              //Log() << Verbose(3) << "Nay, made the potential worse: " << Potential << " vs. " << OldPotential << "!" << endl;
     417              //Log() << Verbose(3) << "Setting " << *Runner << "'s source to " << *Params.DistanceIterators[Runner->nr]->second << "." << endl;
    417418              // Undo for Runner (note, we haven't moved the iteration yet, we may use this)
    418419              Params.PermutationMap[Runner->nr] = Params.DistanceIterators[Runner->nr]->second;
    419420              // Undo for Walker
    420421              Params.DistanceIterators[Walker->nr] = Strider;  // take next farther distance target
    421               //*out << Verbose(3) << "Setting " << *Walker << "'s source to " << *Params.DistanceIterators[Walker->nr]->second << "." << endl;
     422              //Log() << Verbose(3) << "Setting " << *Walker << "'s source to " << *Params.DistanceIterators[Walker->nr]->second << "." << endl;
    422423              Params.PermutationMap[Walker->nr] = Params.DistanceIterators[Walker->nr]->second;
    423424            } else {
    424425              Params.DistanceIterators[Runner->nr] = Rider;  // if successful also move the pointer in the iterator list
    425               *out << Verbose(3) << "Found a better permutation, new potential is " << Potential << " vs." << OldPotential << "." << endl;
     426              Log() << Verbose(3) << "Found a better permutation, new potential is " << Potential << " vs." << OldPotential << "." << endl;
    426427              OldPotential = Potential;
    427428            }
    428429            if (Potential > Params.PenaltyConstants[2]) {
    429               cerr << "ERROR: The two-step permutation procedure did not maintain injectivity!" << endl;
     430              eLog() << Verbose(0) << "ERROR: The two-step permutation procedure did not maintain injectivity!" << endl;
    430431              exit(255);
    431432            }
    432             //*out << endl;
     433            //Log() << Verbose(0) << endl;
    433434          } else {
    434             cerr << "ERROR: " << *Runner << " was not the owner of " << *Sprinter << "!" << endl;
     435            eLog() << Verbose(0) << "ERROR: " << *Runner << " was not the owner of " << *Sprinter << "!" << endl;
    435436            exit(255);
    436437          }
     
    442443    } while (Walker->next != end);
    443444  } while ((OlderPotential - OldPotential) > 1e-3);
    444   *out << Verbose(1) << "done." << endl;
     445  Log() << Verbose(1) << "done." << endl;
    445446
    446447
     
    450451  Free(&Params.DistanceList);
    451452  Free(&Params.DistanceIterators);
    452   return ConstrainedPotential(out, Params);
     453  return ConstrainedPotential(Params);
    453454};
    454455
     
    462463 * \todo the constant for the constrained potential distance part is hard-coded independently of the hard-coded value in MinimiseConstrainedPotential()
    463464 */
    464 void molecule::EvaluateConstrainedForces(ofstream *out, int startstep, int endstep, atom **PermutationMap, ForceMatrix *Force)
     465void molecule::EvaluateConstrainedForces(int startstep, int endstep, atom **PermutationMap, ForceMatrix *Force)
    465466{
    466467  /// evaluate forces (only the distance to target dependent part) with the final PermutationMap
    467   *out << Verbose(1) << "Calculating forces and adding onto ForceMatrix ... " << endl;
     468  Log() << Verbose(1) << "Calculating forces and adding onto ForceMatrix ... " << endl;
    468469  ActOnAllAtoms( &atom::EvaluateConstrainedForce, startstep, endstep, PermutationMap, Force );
    469   *out << Verbose(1) << "done." << endl;
     470  Log() << Verbose(1) << "done." << endl;
    470471};
    471472
     
    479480 * \return true - success in writing step files, false - error writing files or only one step in molecule::Trajectories
    480481 */
    481 bool molecule::LinearInterpolationBetweenConfiguration(ofstream *out, int startstep, int endstep, const char *prefix, config &configuration, bool MapByIdentity)
     482bool molecule::LinearInterpolationBetweenConfiguration(int startstep, int endstep, const char *prefix, config &configuration, bool MapByIdentity)
    482483{
    483484  molecule *mol = NULL;
     
    489490  atom *Walker = NULL, *Sprinter = NULL;
    490491  if (!MapByIdentity)
    491     MinimiseConstrainedPotential(out, PermutationMap, startstep, endstep, configuration.GetIsAngstroem());
     492    MinimiseConstrainedPotential(PermutationMap, startstep, endstep, configuration.GetIsAngstroem());
    492493  else {
    493494    PermutationMap = Malloc<atom *>(AtomCount, "molecule::LinearInterpolationBetweenConfiguration: **PermutationMap");
     
    502503
    503504  // go through all steps and add the molecular configuration to the list and to the Trajectories of \a this molecule
    504   *out << Verbose(1) << "Filling intermediate " << MaxSteps << " steps with MDSteps of " << MDSteps << "." << endl;
     505  Log() << Verbose(1) << "Filling intermediate " << MaxSteps << " steps with MDSteps of " << MDSteps << "." << endl;
    505506  for (int step = 0; step <= MaxSteps; step++) {
    506507    mol = new molecule(elemente);
     
    514515        Sprinter->x.x[n] = Walker->Trajectory.R.at(startstep).x[n] + (PermutationMap[Walker->nr]->Trajectory.R.at(endstep).x[n] - Walker->Trajectory.R.at(startstep).x[n])*((double)step/(double)MaxSteps);
    515516        // add to Trajectories
    516         //*out << Verbose(3) << step << ">=" << MDSteps-1 << endl;
     517        //Log() << Verbose(3) << step << ">=" << MDSteps-1 << endl;
    517518        if (step < MaxSteps) {
    518519          Walker->Trajectory.R.at(step).x[n] = Walker->Trajectory.R.at(startstep).x[n] + (PermutationMap[Walker->nr]->Trajectory.R.at(endstep).x[n] - Walker->Trajectory.R.at(startstep).x[n])*((double)step/(double)MaxSteps);
     
    529530  for (int i=AtomCount; i--; )
    530531    SortIndex[i] = i;
    531   status = MoleculePerStep->OutputConfigForListOfFragments(out, &configuration, SortIndex);
     532  status = MoleculePerStep->OutputConfigForListOfFragments(&configuration, SortIndex);
    532533
    533534  // free and return
     
    550551 * \todo This is not yet checked if it is correctly working with DoConstrained set to true.
    551552 */
    552 bool molecule::VerletForceIntegration(ofstream *out, char *file, config &configuration)
     553bool molecule::VerletForceIntegration(char *file, config &configuration)
    553554{
    554555  ifstream input(file);
     
    567568    // parse file into ForceMatrix
    568569    if (!Force.ParseMatrix(file, 0,0,0)) {
    569       cerr << "Could not parse Force Matrix file " << file << "." << endl;
     570      eLog() << Verbose(0) << "Could not parse Force Matrix file " << file << "." << endl;
    570571      return false;
    571572    }
    572573    if (Force.RowCounter[0] != AtomCount) {
    573       cerr << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << AtomCount << "." << endl;
     574      eLog() << Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << AtomCount << "." << endl;
    574575      return false;
    575576    }
     
    588589      // calculate forces and potential
    589590      atom **PermutationMap = NULL;
    590       ConstrainedPotentialEnergy = MinimiseConstrainedPotential(out, PermutationMap,configuration.DoConstrainedMD, 0, configuration.GetIsAngstroem());
    591       EvaluateConstrainedForces(out, configuration.DoConstrainedMD, 0, PermutationMap, &Force);
     591      ConstrainedPotentialEnergy = MinimiseConstrainedPotential(PermutationMap,configuration.DoConstrainedMD, 0, configuration.GetIsAngstroem());
     592      EvaluateConstrainedForces(configuration.DoConstrainedMD, 0, PermutationMap, &Force);
    592593      Free(&PermutationMap);
    593594    }
     
    649650  switch(Thermostat) {
    650651     case None:
    651       cout << Verbose(2) <<  "Applying no thermostat..." << endl;
     652      Log() << Verbose(2) <<  "Applying no thermostat..." << endl;
    652653      break;
    653654     case Woodcock:
    654655      if ((configuration.ScaleTempStep > 0) && ((MDSteps-1) % configuration.ScaleTempStep == 0)) {
    655         cout << Verbose(2) <<  "Applying Woodcock thermostat..." << endl;
     656        Log() << Verbose(2) <<  "Applying Woodcock thermostat..." << endl;
    656657        ActOnAllAtoms( &atom::Thermostat_Woodcock, sqrt(ScaleTempFactor), MDSteps, &ekin );
    657658      }
    658659      break;
    659660     case Gaussian:
    660       cout << Verbose(2) <<  "Applying Gaussian thermostat..." << endl;
     661      Log() << Verbose(2) <<  "Applying Gaussian thermostat..." << endl;
    661662      ActOnAllAtoms( &atom::Thermostat_Gaussian_init, MDSteps, &G, &E );
    662663
    663       cout << Verbose(1) << "Gaussian Least Constraint constant is " << G/E << "." << endl;
     664      Log() << Verbose(1) << "Gaussian Least Constraint constant is " << G/E << "." << endl;
    664665      ActOnAllAtoms( &atom::Thermostat_Gaussian_least_constraint, MDSteps, G/E, &ekin, &configuration);
    665666
    666667      break;
    667668     case Langevin:
    668       cout << Verbose(2) <<  "Applying Langevin thermostat..." << endl;
     669      Log() << Verbose(2) <<  "Applying Langevin thermostat..." << endl;
    669670      // init random number generator
    670671      gsl_rng_env_setup();
     
    676677
    677678     case Berendsen:
    678       cout << Verbose(2) <<  "Applying Berendsen-VanGunsteren thermostat..." << endl;
     679      Log() << Verbose(2) <<  "Applying Berendsen-VanGunsteren thermostat..." << endl;
    679680      ActOnAllAtoms( &atom::Thermostat_Berendsen, MDSteps, ScaleTempFactor, &ekin, &configuration );
    680681      break;
    681682
    682683     case NoseHoover:
    683       cout << Verbose(2) <<  "Applying Nose-Hoover thermostat..." << endl;
     684      Log() << Verbose(2) <<  "Applying Nose-Hoover thermostat..." << endl;
    684685      // dynamically evolve alpha (the additional degree of freedom)
    685686      delta_alpha = 0.;
     
    687688      delta_alpha = (delta_alpha - (3.*AtomCount+1.) * configuration.TargetTemp)/(configuration.HooverMass*Units2Electronmass);
    688689      configuration.alpha += delta_alpha*configuration.Deltat;
    689       cout << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl;
     690      Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl;
    690691      // apply updated alpha as additional force
    691692      ActOnAllAtoms( &atom::Thermostat_NoseHoover_scale, MDSteps, &ekin, &configuration );
    692693      break;
    693694  }
    694   cout << Verbose(1) << "Kinetic energy is " << ekin << "." << endl;
    695 };
     695  Log() << Verbose(1) << "Kinetic energy is " << ekin << "." << endl;
     696};
Note: See TracChangeset for help on using the changeset viewer.