Ignore:
Timestamp:
Mar 19, 2010, 1:29:01 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
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:
e0b6fd
Parents:
80c63d
Message:

FIX: Made AtomCount a Cacheable so that the number of atoms in a molecule will always be correct

All unittests working.
All Complete testcases fail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_graph.cpp

    r80c63d rea7176  
    125125
    126126  // count atoms in molecule = dimension of matrix (also give each unique name and continuous numbering)
    127   CountAtoms();
    128   Log() << Verbose(1) << "AtomCount " << AtomCount << " and bonddistance is " << bonddistance << "." << endl;
    129 
    130   if ((AtomCount > 1) && (bonddistance > 1.)) {
     127  Log() << Verbose(1) << "AtomCount " << getAtomCount() << " and bonddistance is " << bonddistance << "." << endl;
     128
     129  if ((getAtomCount() > 1) && (bonddistance > 1.)) {
    131130    Log() << Verbose(2) << "Creating Linked Cell structure ... " << endl;
    132131    LC = new LinkedCell(this, bonddistance);
     
    191190    ActOnAllAtoms( &atom::OutputBondOfAtom );
    192191  } else
    193     Log() << Verbose(1) << "AtomCount is " << AtomCount << ", thus no bonds, no connections!." << endl;
     192    Log() << Verbose(1) << "AtomCount is " << getAtomCount() << ", thus no bonds, no connections!." << endl;
    194193  Log() << Verbose(0) << "End of CreateAdjacencyList." << endl;
    195194  if (free_BG)
     
    233232    Log() << Verbose(0) << " done." << endl;
    234233  } else {
    235     Log() << Verbose(1) << "BondCount is " << BondCount << ", no bonds between any of the " << AtomCount << " atoms." << endl;
     234    Log() << Verbose(1) << "BondCount is " << BondCount << ", no bonds between any of the " << getAtomCount() << " atoms." << endl;
    236235  }
    237236  Log() << Verbose(0) << No << " bonds could not be corrected." << endl;
     
    453452void DepthFirstSearchAnalysis_Init(struct DFSAccounting &DFS, const molecule * const mol)
    454453{
    455   DFS.AtomStack = new StackClass<atom *> (mol->AtomCount);
     454  DFS.AtomStack = new StackClass<atom *> (mol->getAtomCount());
    456455  DFS.CurrentGraphNr = 0;
    457456  DFS.ComponentNumber = 0;
     
    847846      Root = *iter;
    848847
    849       if (MinimumRingSize[Root->GetTrueFather()->nr] == mol->AtomCount) { // check whether MinimumRingSize is set, if not BFS to next where it is
     848      if (MinimumRingSize[Root->GetTrueFather()->nr] == mol->getAtomCount()) { // check whether MinimumRingSize is set, if not BFS to next where it is
    850849        Walker = Root;
    851850
    852851        //Log() << Verbose(1) << "---------------------------------------------------------------------------------------------------------" << endl;
    853         CyclicStructureAnalysis_BFSToNextCycle(Root, Walker, MinimumRingSize, mol->AtomCount);
     852        CyclicStructureAnalysis_BFSToNextCycle(Root, Walker, MinimumRingSize, mol->getAtomCount());
    854853
    855854      }
     
    881880  int MinRingSize = -1;
    882881
    883   InitializeBFSAccounting(BFS, AtomCount);
     882  InitializeBFSAccounting(BFS, getAtomCount());
    884883
    885884  //Log() << Verbose(1) << "Back edge list - ";
     
    11171116    CurrentBondsOfAtom = -1; // we count one too far due to line end
    11181117    // parse into structure
    1119     if ((AtomNr >= 0) && (AtomNr < AtomCount)) {
     1118    if ((AtomNr >= 0) && (AtomNr < getAtomCount())) {
    11201119      Walker = ListOfAtoms[AtomNr];
    11211120      while (!line.eof())
     
    12961295    AddedAtomList[Root->nr] = Mol->AddCopyAtom(Root);
    12971296
    1298   BreadthFirstSearchAdd_Init(BFS, Root, BondOrder, AtomCount, AddedAtomList);
     1297  BreadthFirstSearchAdd_Init(BFS, Root, BondOrder, getAtomCount(), AddedAtomList);
    12991298
    13001299  // and go on ... Queue always contains all lightgray vertices
     
    14071406
    14081407  Log() << Verbose(2) << "Begin of BuildInducedSubgraph." << endl;
    1409   BuildInducedSubgraph_Init(ParentList, Father->AtomCount);
     1408  BuildInducedSubgraph_Init(ParentList, Father->getAtomCount());
    14101409  BuildInducedSubgraph_FillParentList(this, Father, ParentList);
    14111410  status = BuildInducedSubgraph_CreateBondsFromParent(this, Father, ParentList);
Note: See TracChangeset for help on using the changeset viewer.