Changeset a251a3


Ignore:
Timestamp:
May 26, 2008, 10:52:00 AM (17 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:
9a1b84
Parents:
040f93
Message:

molecule::CreateAdjacencyList() now needs IsAngstroem as parameter

This is necessary, as the database values (covalent radii et al) are in Angstroem, hence don't match if we use Bohrradii as length unit instead. CreateAdjacencyList() converts units and now finds correct bond structure and fragments properly.

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/builder.cpp

    r040f93 ra251a3  
    931931                cout << Verbose(0) << "Creating connection matrix..." << endl;
    932932                start = clock();
    933                 mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr++]));
     933                mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr++]), configuration.GetIsAngstroem());
    934934                cout << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl;
    935935                if (mol->first->next != mol->last) {
     
    11161116          }
    11171117          if (mol->first->next != mol->last) // if connect matrix is present already, redo it
    1118             mol->CreateAdjacencyList((ofstream *)&cout, mol->BondDistance);
     1118            mol->CreateAdjacencyList((ofstream *)&cout, mol->BondDistance, configuration.GetIsAngstroem());
    11191119          // free memory
    11201120          delete[](Elements);
     
    11591159        cin >> tmp1;
    11601160        start = clock();
    1161         mol->CreateAdjacencyList((ofstream *)&cout, tmp1);
     1161        mol->CreateAdjacencyList((ofstream *)&cout, tmp1, configuration.GetIsAngstroem());
    11621162        //mol->CreateListOfBondsPerAtom((ofstream *)&cout);
    11631163        Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, false, MinimumRingSize);
  • src/molecules.cpp

    r040f93 ra251a3  
    13181318 * \param *out out stream for printing the matrix, NULL if no output
    13191319 * \param bonddistance length of linked cells (i.e. maximum minimal length checked)
    1320  */
    1321 void molecule::CreateAdjacencyList(ofstream *out, double bonddistance)
     1320 * \param IsAngstroem whether coordinate system is gauged to Angstroem or Bohr radii
     1321 */
     1322void molecule::CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem)
    13221323{
    13231324  atom *Walker = NULL, *OtherWalker = NULL;
     
    13291330  vector x;
    13301331 
    1331   BondDistance = bonddistance;
     1332  BondDistance = bonddistance; // * ((IsAngstroem) ? 1. : 1./AtomicLengthToAngstroem);
    13321333  *out << Verbose(0) << "Begin of CreateAdjacencyList." << endl;
    13331334  // remove every bond from the list
     
    14071408                        /// \todo periodic check is missing here!
    14081409                        //*out << Verbose(1) << "Checking distance " << OtherWalker->x.PeriodicDistance(&(Walker->x), cell_size) << " against typical bond length of " << bonddistance*bonddistance << "." << endl;
    1409                         MinDistance = OtherWalker->type->CovalentRadius + Walker->type->CovalentRadius; 
     1410                        MinDistance = OtherWalker->type->CovalentRadius + Walker->type->CovalentRadius;
     1411                        MinDistance *= (IsAngstroem) ? 1. : 1./AtomicLengthToAngstroem;
    14101412                        MaxDistance = MinDistance + BONDTHRESHOLD;
    14111413                        MinDistance -= BONDTHRESHOLD;
     
    14141416                          *out << Verbose(0) << "Adding Bond between " << *Walker << " and " << *OtherWalker << "." << endl;
    14151417                          AddBond(Walker->father, OtherWalker->father, 1);  // also increases molecule::BondCount
     1418                          BondCount++;
    14161419                        } else {
    14171420                          //*out << Verbose(1) << "Not Adding: Wrong label order or distance too great." << endl;
     
    14281431        delete(CellList[i]);
    14291432      }
    1430     Free((void **)&CellList, "molecule::CreateAdjacencyList - ** CellList"); 
    1431  
     1433    Free((void **)&CellList, "molecule::CreateAdjacencyList - ** CellList");
     1434   
    14321435    // create the adjacency list per atom
    14331436    CreateListOfBondsPerAtom(out);
  • src/molecules.hpp

    r040f93 ra251a3  
    279279
    280280  /// Initialising routines in fragmentation 
    281   void CreateAdjacencyList(ofstream *out, double bonddistance);
     281  void CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem);
    282282  void CreateListOfBondsPerAtom(ofstream *out);
    283283 
Note: See TracChangeset for help on using the changeset viewer.