Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_dynamics.cpp

    ra67d19 re138de  
    207207    doubles++;
    208208  if (doubles >0)
    209     DoLog(2) && (Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl);
     209    Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl;
    210210  Free(&DoubleList);
    211211//  Log() << Verbose(2) << zeile1.str() << endl << zeile2.str() << endl;
     
    249249    Params.DoubleList[Params.DistanceList[Walker->nr]->begin()->second->nr]++;            // increase this target's source count (>1? not injective)
    250250    Params.DistanceIterators[Walker->nr] = Params.DistanceList[Walker->nr]->begin();    // and remember which one we picked
    251     DoLog(2) && (Log() << Verbose(2) << *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;
    252252  }
    253253};
     
    277277      Params.DistanceIterators[Walker->nr] = NewBase;
    278278      OldPotential = Potential;
    279       DoLog(3) && (Log() << Verbose(3) << "Found a new permutation, new potential is " << OldPotential << "." << endl);
     279      Log() << Verbose(3) << "Found a new permutation, new potential is " << OldPotential << "." << endl;
    280280    }
    281281  }
     
    306306  for (int i=mol->AtomCount; i--;) // now each single entry in the DoubleList should be <=1
    307307    if (Params.DoubleList[i] > 1) {
    308       DoeLog(0) && (eLog()<< Verbose(0) << "Failed to create an injective PermutationMap!" << endl);
    309       performCriticalExit();
    310     }
    311   DoLog(1) && (Log() << Verbose(1) << "done." << endl);
     308      eLog() << Verbose(0) << "Failed to create an injective PermutationMap!" << endl;
     309      exit(1);
     310    }
     311  Log() << Verbose(1) << "done." << endl;
    312312};
    313313
     
    358358  Params.PenaltyConstants[2] = 1e+7;    // just a huge penalty
    359359  // generate the distance list
    360   DoLog(1) && (Log() << Verbose(1) << "Allocating, initializting and filling the distance list ... " << endl);
     360  Log() << Verbose(1) << "Allocating, initializting and filling the distance list ... " << endl;
    361361  FillDistanceList(this, Params);
    362362
     
    365365
    366366  // make the PermutationMap injective by checking whether we have a non-zero constants[2] term in it
    367   DoLog(1) && (Log() << Verbose(1) << "Making the PermutationMap injective ... " << endl);
     367  Log() << Verbose(1) << "Making the PermutationMap injective ... " << endl;
    368368  MakeInjectivePermutation(this, Params);
    369369  Free(&Params.DoubleList);
    370370
    371371  // argument minimise the constrained potential in this injective PermutationMap
    372   DoLog(1) && (Log() << Verbose(1) << "Argument minimising the PermutationMap." << endl);
     372  Log() << Verbose(1) << "Argument minimising the PermutationMap, at current potential " << OldPotential << " ... " << endl;
    373373  OldPotential = 1e+10;
    374374  round = 0;
    375375  do {
    376     DoLog(2) && (Log() << Verbose(2) << "Starting round " << ++round << ", at current potential " << OldPotential << " ... " << endl);
     376    Log() << Verbose(2) << "Starting round " << ++round << " ... " << endl;
    377377    OlderPotential = OldPotential;
    378378    do {
     
    424424            } else {
    425425              Params.DistanceIterators[Runner->nr] = Rider;  // if successful also move the pointer in the iterator list
    426               DoLog(3) && (Log() << 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;
    427427              OldPotential = Potential;
    428428            }
    429429            if (Potential > Params.PenaltyConstants[2]) {
    430               DoeLog(1) && (eLog()<< Verbose(1) << "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;
    431431              exit(255);
    432432            }
    433433            //Log() << Verbose(0) << endl;
    434434          } else {
    435             DoeLog(1) && (eLog()<< Verbose(1) << *Runner << " was not the owner of " << *Sprinter << "!" << endl);
     435            eLog() << Verbose(0) << "ERROR: " << *Runner << " was not the owner of " << *Sprinter << "!" << endl;
    436436            exit(255);
    437437          }
     
    443443    } while (Walker->next != end);
    444444  } while ((OlderPotential - OldPotential) > 1e-3);
    445   DoLog(1) && (Log() << Verbose(1) << "done." << endl);
     445  Log() << Verbose(1) << "done." << endl;
    446446
    447447
     
    466466{
    467467  /// evaluate forces (only the distance to target dependent part) with the final PermutationMap
    468   DoLog(1) && (Log() << Verbose(1) << "Calculating forces and adding onto ForceMatrix ... " << endl);
     468  Log() << Verbose(1) << "Calculating forces and adding onto ForceMatrix ... " << endl;
    469469  ActOnAllAtoms( &atom::EvaluateConstrainedForce, startstep, endstep, PermutationMap, Force );
    470   DoLog(1) && (Log() << Verbose(1) << "done." << endl);
     470  Log() << Verbose(1) << "done." << endl;
    471471};
    472472
     
    503503
    504504  // go through all steps and add the molecular configuration to the list and to the Trajectories of \a this molecule
    505   DoLog(1) && (Log() << Verbose(1) << "Filling intermediate " << MaxSteps << " steps with MDSteps of " << MDSteps << "." << endl);
     505  Log() << Verbose(1) << "Filling intermediate " << MaxSteps << " steps with MDSteps of " << MDSteps << "." << endl;
    506506  for (int step = 0; step <= MaxSteps; step++) {
    507507    mol = new molecule(elemente);
     
    568568    // parse file into ForceMatrix
    569569    if (!Force.ParseMatrix(file, 0,0,0)) {
    570       DoeLog(0) && (eLog()<< Verbose(0) << "Could not parse Force Matrix file " << file << "." << endl);
    571       performCriticalExit();
     570      eLog() << Verbose(0) << "Could not parse Force Matrix file " << file << "." << endl;
    572571      return false;
    573572    }
    574573    if (Force.RowCounter[0] != AtomCount) {
    575       DoeLog(0) && (eLog()<< Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << AtomCount << "." << endl);
    576       performCriticalExit();
     574      eLog() << Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << AtomCount << "." << endl;
    577575      return false;
    578576    }
     
    652650  switch(Thermostat) {
    653651     case None:
    654       DoLog(2) && (Log() << Verbose(2) <<  "Applying no thermostat..." << endl);
     652      Log() << Verbose(2) <<  "Applying no thermostat..." << endl;
    655653      break;
    656654     case Woodcock:
    657655      if ((configuration.ScaleTempStep > 0) && ((MDSteps-1) % configuration.ScaleTempStep == 0)) {
    658         DoLog(2) && (Log() << Verbose(2) <<  "Applying Woodcock thermostat..." << endl);
     656        Log() << Verbose(2) <<  "Applying Woodcock thermostat..." << endl;
    659657        ActOnAllAtoms( &atom::Thermostat_Woodcock, sqrt(ScaleTempFactor), MDSteps, &ekin );
    660658      }
    661659      break;
    662660     case Gaussian:
    663       DoLog(2) && (Log() << Verbose(2) <<  "Applying Gaussian thermostat..." << endl);
     661      Log() << Verbose(2) <<  "Applying Gaussian thermostat..." << endl;
    664662      ActOnAllAtoms( &atom::Thermostat_Gaussian_init, MDSteps, &G, &E );
    665663
    666       DoLog(1) && (Log() << Verbose(1) << "Gaussian Least Constraint constant is " << G/E << "." << endl);
     664      Log() << Verbose(1) << "Gaussian Least Constraint constant is " << G/E << "." << endl;
    667665      ActOnAllAtoms( &atom::Thermostat_Gaussian_least_constraint, MDSteps, G/E, &ekin, &configuration);
    668666
    669667      break;
    670668     case Langevin:
    671       DoLog(2) && (Log() << Verbose(2) <<  "Applying Langevin thermostat..." << endl);
     669      Log() << Verbose(2) <<  "Applying Langevin thermostat..." << endl;
    672670      // init random number generator
    673671      gsl_rng_env_setup();
     
    679677
    680678     case Berendsen:
    681       DoLog(2) && (Log() << Verbose(2) <<  "Applying Berendsen-VanGunsteren thermostat..." << endl);
     679      Log() << Verbose(2) <<  "Applying Berendsen-VanGunsteren thermostat..." << endl;
    682680      ActOnAllAtoms( &atom::Thermostat_Berendsen, MDSteps, ScaleTempFactor, &ekin, &configuration );
    683681      break;
    684682
    685683     case NoseHoover:
    686       DoLog(2) && (Log() << Verbose(2) <<  "Applying Nose-Hoover thermostat..." << endl);
     684      Log() << Verbose(2) <<  "Applying Nose-Hoover thermostat..." << endl;
    687685      // dynamically evolve alpha (the additional degree of freedom)
    688686      delta_alpha = 0.;
     
    690688      delta_alpha = (delta_alpha - (3.*AtomCount+1.) * configuration.TargetTemp)/(configuration.HooverMass*Units2Electronmass);
    691689      configuration.alpha += delta_alpha*configuration.Deltat;
    692       DoLog(3) && (Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl);
     690      Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl;
    693691      // apply updated alpha as additional force
    694692      ActOnAllAtoms( &atom::Thermostat_NoseHoover_scale, MDSteps, &ekin, &configuration );
    695693      break;
    696694  }
    697   DoLog(1) && (Log() << Verbose(1) << "Kinetic energy is " << ekin << "." << endl);
    698 };
     695  Log() << Verbose(1) << "Kinetic energy is " << ekin << "." << endl;
     696};
Note: See TracChangeset for help on using the changeset viewer.