Changeset 3c58f8


Ignore:
Timestamp:
Feb 4, 2011, 6:56:38 PM (14 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
4c2643
Parents:
72d108
git-author:
Frederik Heber <heber@…> (02/02/11 09:43:01)
git-committer:
Frederik Heber <heber@…> (02/04/11 18:56:38)
Message:

Changed molecule::ScanForPeriodicCorrection().

  • it still used templated link stuff for the bonds which is deprecated and hence not usable.
  • now simply bool is returned, whether periodic fixing _would_ be necessary.
  • the number of of periodic fixings is counted and printed in MoleculeListClass::OutputConfigForListOfFragments().
Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/molecule.hpp

    r72d108 r3c58f8  
    206206  void SetNameFromFilename(const char *filename);
    207207  void SetBoxDimension(Vector *dim);
    208   void ScanForPeriodicCorrection();
     208  bool ScanForPeriodicCorrection();
    209209  bool VerletForceIntegration(char *file, config &configuration, const size_t offset);
    210210  double VolumeOfConvexEnvelope(bool IsAngstroem);
  • src/molecule_fragmentation.cpp

    r72d108 r3c58f8  
    17681768 * \param *out ofstream for debugging messages
    17691769 */
    1770 void molecule::ScanForPeriodicCorrection()
     1770bool molecule::ScanForPeriodicCorrection()
    17711771{
    17721772  bond *Binder = NULL;
     
    17771777  enum Shading *ColorList = NULL;
    17781778  double tmp;
     1779  bool LastBond = true; // only needed to due list construct
    17791780  Vector Translationvector;
    17801781  //std::deque<atom *> *CompStack = NULL;
     
    17871788  for (int i=0;i<getAtomCount();i++)
    17881789    ColorList[i] = (enum Shading)0;
    1789   while (flag) {
     1790  if (flag) {
    17901791    // remove bonds that are beyond bonddistance
    17911792    Translationvector.Zero();
     
    17991800          //Log() << Verbose(3) << "Checking " << i << "th distance of " << *Binder->leftatom << " to " << *Binder->rightatom << ": " << tmp << "." << endl;
    18001801          if (tmp > BondDistance) {
    1801             OtherBinder = Binder->next; // note down binding partner for later re-insertion
    1802             unlink(Binder);   // unlink bond
     1802//            OtherBinder = Binder->next; // note down binding partner for later re-insertion
     1803//            if (OtherBinder != NULL) {
     1804//              LastBond = false;
     1805//            } else {
     1806//              OtherBinder = Binder->previous;
     1807//              LastBond = true;
     1808//            }
     1809//            unlink(Binder);   // unlink bond
    18031810            DoLog(2) && (Log() << Verbose(2) << "Correcting at bond " << *Binder << "." << endl);
    18041811            flag = true;
     
    18071814        }
    18081815      }
    1809     if (flag) {
     1816    //if (flag) {
     1817    if (0) {
    18101818      // create translation vector from their periodically modified distance
    18111819      for (int i=NDIM;i--;) {
     
    18371845      }
    18381846      // re-add bond
    1839       link(Binder, OtherBinder);
     1847      if (OtherBinder == NULL) { // is the only bond?
     1848        //Do nothing
     1849      } else {
     1850        if (!LastBond) {
     1851          link(Binder, OtherBinder);
     1852        } else {
     1853          link(OtherBinder, Binder);
     1854        }
     1855      }
    18401856    } else {
    18411857      DoLog(3) && (Log() << Verbose(3) << "No corrections for this fragment." << endl);
     
    18471863  delete[](ColorList);
    18481864  DoLog(2) && (Log() << Verbose(2) << "End of ScanForPeriodicCorrection." << endl);
    1849 };
     1865
     1866  return flag;
     1867};
  • src/moleculelist.cpp

    r72d108 r3c58f8  
    506506  RealSpaceMatrix cell_size = World::getInstance().getDomain().getM();
    507507  RealSpaceMatrix cell_size_backup = cell_size;
     508  int count=0;
    508509
    509510  // store the fragments as config and as xyz
     
    519520
    520521    // correct periodic
    521     (*ListRunner)->ScanForPeriodicCorrection();
     522    if ((*ListRunner)->ScanForPeriodicCorrection()) {
     523      count++;
     524    }
    522525
    523526    // output xyz file
     
    591594  // printing final number
    592595  DoLog(2) && (Log() << Verbose(2) << "Final number of fragments: " << FragmentCounter << "." << endl);
     596
     597  // printing final number
     598  DoLog(0) && (Log() << Verbose(0) << "For " << count << " fragments periodic correction would have been necessary." << endl);
    593599
    594600  // restore cell_size
Note: See TracChangeset for help on using the changeset viewer.