Changeset ea7176 for src


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, Candidate_v1.7.0, 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.

Location:
src
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • src/Legacy/oldmenu.cpp

    r80c63d rea7176  
    757757    cin >> faktor;
    758758
    759     mol->CountAtoms(); // recount atoms
    760     if (mol->AtomCount != 0) {  // if there is more than none
    761       count = mol->AtomCount;  // is changed becausing of adding, thus has to be stored away beforehand
     759    if (mol->getAtomCount() != 0) {  // if there is more than none
     760      count = mol->getAtomCount();  // is changed becausing of adding, thus has to be stored away beforehand
    762761      Elements = new element *[count];
    763762      vectors = new Vector *[count];
     
    10261025  // generate some KeySets
    10271026  Log() << Verbose(0) << "Generating KeySets." << endl;
    1028   KeySet TestSets[mol->AtomCount+1];
     1027  KeySet TestSets[mol->getAtomCount()+1];
    10291028  i=1;
    10301029  for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
     
    10381037  molecule::const_iterator iter = mol->begin();
    10391038  if (iter != mol->end()) {
    1040     test = TestSets[mol->AtomCount-1].insert((*iter)->nr);
     1039    test = TestSets[mol->getAtomCount()-1].insert((*iter)->nr);
    10411040    if (test.second) {
    10421041      Log() << Verbose(1) << "Insertion worked?!" << endl;
     
    10541053  // insert KeySets into Subgraphs
    10551054  Log() << Verbose(0) << "Inserting KeySets into Subgraph class." << endl;
    1056   for (int j=0;j<mol->AtomCount;j++) {
     1055  for (int j=0;j<mol->getAtomCount();j++) {
    10571056    Subgraphs.insert(GraphPair (TestSets[j],pair<int, double>(counter++, 1.)));
    10581057  }
    10591058  Log() << Verbose(0) << "Testing insertion of already present item in Subgraph." << endl;
    10601059  GraphTestPair test2;
    1061   test2 = Subgraphs.insert(GraphPair (TestSets[mol->AtomCount],pair<int, double>(counter++, 1.)));
     1060  test2 = Subgraphs.insert(GraphPair (TestSets[mol->getAtomCount()],pair<int, double>(counter++, 1.)));
    10621061  if (test2.second) {
    10631062    Log() << Verbose(1) << "Insertion worked?!" << endl;
  • src/Patterns/Cacheable.hpp

    r80c63d rea7176  
    2121    virtual ~Cacheable();
    2222
    23     const bool isValid();
    24     const T& operator*();
    25     const bool operator==(const T&);
    26     const bool operator!=(const T&);
     23    const bool isValid() const;
     24    const T& operator*() const;
    2725
    2826    // methods implemented for base-class Observer
     
    3028    void subjectKilled(Observable *subject);
    3129  private:
    32     void checkValid();
     30    void checkValid() const;
    3331
    34     T content;
     32    mutable T content;
    3533    Observable *owner;
    36     bool valid;
    37     bool canBeUsed;
     34    mutable bool valid;
     35    mutable bool canBeUsed;
    3836    boost::function<T()> recalcMethod;
    3937  };
     
    5351
    5452  template<typename T>
    55   const T& Cacheable<T>::operator*(){
     53  const T& Cacheable<T>::operator*() const{
    5654    checkValid();
    5755    return content;
    58   }
    59 
    60   template<typename T>
    61   const bool Cacheable<T>::operator==(const T& rval){
    62     checkValid();
    63     return (content == rval);
    64   }
    65 
    66   template<typename T>
    67   const bool Cacheable<T>::operator!=(const T& rval){
    68     checkValid();
    69     return (content != rval);
    7056  }
    7157
     
    7763
    7864  template<typename T>
    79   const bool Cacheable<T>::isValid(){
     65  const bool Cacheable<T>::isValid() const{
    8066    return valid;
    8167  }
     
    9379
    9480  template<typename T>
    95   void Cacheable<T>::checkValid(){
     81  void Cacheable<T>::checkValid() const{
    9682    assert(canBeUsed && "Cacheable used after owner was deleted");
    9783    if(!isValid()){
     
    10793    virtual ~Cacheable();
    10894
    109     const bool isValid();
    110     const T& operator*();
    111     const bool operator==(const T&);
    112     const bool operator!=(const T&);
     95    const bool isValid() const;
     96    const T& operator*() const;
    11397
    11498    // methods implemented for base-class Observer
     
    126110
    127111  template<typename T>
    128   const T& Cacheable<T>::operator*(){
     112  const T& Cacheable<T>::operator*() const{
    129113    return recalcMethod();
    130   }
    131 
    132   template<typename T>
    133   const bool Cacheable<T>::operator==(const T& rval){
    134     return (recalcMethod() == rval);
    135   }
    136 
    137   template<typename T>
    138   const bool Cacheable<T>::operator!=(const T& rval){
    139     return (recalcMethod() != rval);
    140114  }
    141115
     
    145119
    146120  template<typename T>
    147   const bool Cacheable<T>::isValid(){
     121  const bool Cacheable<T>::isValid() const{
    148122    return true;
    149123  }
     
    155129
    156130  template<typename T>
    157   void Cacheable<T>::subjectKilled(Observable *subject) {
     131  void Cacheable<T>::subjectKilled(Observable *subject){
    158132    assert(0 && "Cacheable::subjectKilled should never be called when caching is disabled");
    159133  }
  • src/boundary.cpp

    r80c63d rea7176  
    825825  filler->Center.Zero();
    826826
    827   filler->CountAtoms();
    828   atom * CopyAtoms[filler->AtomCount];
     827  atom * CopyAtoms[filler->getAtomCount()];
    829828
    830829  // calculate filler grid in [0,1]^3
  • src/builder.cpp

    r80c63d rea7176  
    14821482                if (first->type != NULL) {
    14831483                  mol->AddAtom(first);  // add to molecule
    1484                   if ((configPresent == empty) && (mol->AtomCount != 0))
     1484                  if ((configPresent == empty) && (mol->getAtomCount() != 0))
    14851485                    configPresent = present;
    14861486                } else
     
    15111511                Log() << Verbose(1) << "Depth-First-Search Analysis." << endl;
    15121512                MoleculeLeafClass *Subgraphs = NULL;      // list of subgraphs from DFS analysis
    1513                 int *MinimumRingSize = new int[mol->AtomCount];
     1513                int *MinimumRingSize = new int[mol->getAtomCount()];
    15141514                atom ***ListOfLocalAtoms = NULL;
    15151515                class StackClass<bond *> *BackEdgeStack = NULL;
     
    15741574                int counter  = 0;
    15751575                for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
    1576                   if ((Boundary == NULL) || (Boundary->AtomCount < (*BigFinder)->AtomCount)) {
     1576                  if ((Boundary == NULL) || (Boundary->getAtomCount() < (*BigFinder)->getAtomCount())) {
    15771577                    Boundary = *BigFinder;
    15781578                  }
     
    17211721                int counter  = 0;
    17221722                for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
    1723                   (*BigFinder)->CountAtoms();
    1724                   if ((Boundary == NULL) || (Boundary->AtomCount < (*BigFinder)->AtomCount)) {
     1723                  if ((Boundary == NULL) || (Boundary->getAtomCount() < (*BigFinder)->getAtomCount())) {
    17251724                    Boundary = *BigFinder;
    17261725                  }
    17271726                  counter++;
    17281727                }
    1729                 Log() << Verbose(1) << "Biggest molecule has " << Boundary->AtomCount << " atoms." << endl;
     1728                Log() << Verbose(1) << "Biggest molecule has " << Boundary->getAtomCount() << " atoms." << endl;
    17301729                start = clock();
    17311730                LCList = new LinkedCell(Boundary, atof(argv[argptr])*2.);
     
    20672066                    faktor = 1;
    20682067                  }
    2069                   mol->CountAtoms();  // recount atoms
    2070                   if (mol->AtomCount != 0) {  // if there is more than none
    2071                     count = mol->AtomCount;   // is changed becausing of adding, thus has to be stored away beforehand
     2068                  if (mol->getAtomCount() != 0) {  // if there is more than none
     2069                    count = mol->getAtomCount();   // is changed becausing of adding, thus has to be stored away beforehand
    20722070                    Elements = new element *[count];
    20732071                    vectors = new Vector *[count];
  • src/molecule.cpp

    r80c63d rea7176  
    3232 */
    3333molecule::molecule(const periodentafel * const teil) : elemente(teil),
    34   first(new bond(0, 0, 1, -1)), last(new bond(0, 0, 1, -1)), MDSteps(0), AtomCount(0),
     34  first(new bond(0, 0, 1, -1)), last(new bond(0, 0, 1, -1)), MDSteps(0),
    3535  BondCount(0), ElementCount(0), NoNonHydrogen(0), NoNonBonds(0), NoCyclicBonds(0), BondDistance(0.),
    3636  ActiveFlag(false), IndexNr(-1),
    3737  formula(this,boost::bind(&molecule::calcFormula,this)),
    38   last_atom(0),
    39   InternalPointer(begin())
     38  AtomCount(this,boost::bind(&molecule::doCountAtoms,this)), last_atom(0),  InternalPointer(begin())
    4039{
    4140  // init bond chain list
     
    7271const std::string molecule::getName(){
    7372  return std::string(name);
     73}
     74
     75int molecule::getAtomCount() const{
     76  return *AtomCount;
    7477}
    7578
     
    180183  if (pointer != NULL) {
    181184    pointer->sort = &pointer->nr;
    182     AtomCount++;
    183185    if (pointer->type != NULL) {
    184186      if (ElementsInMolecule[pointer->type->Z] == 0)
     
    214216    if ((pointer->type != NULL) && (pointer->type->Z != 1))
    215217      NoNonHydrogen++;
    216     AtomCount++;
    217218    retval=walker;
    218219  }
     
    611612
    612613  // copy values
    613   copy->CountAtoms();
    614614  copy->CountElements();
    615615  if (first->next != last) {  // if adjaceny list is present
     
    728728bool molecule::RemoveAtom(atom *pointer)
    729729{
     730  OBSERVE;
    730731  if (ElementsInMolecule[pointer->type->Z] != 0)  { // this would indicate an error
    731732    ElementsInMolecule[pointer->type->Z]--;  // decrease number of atom of this element
    732     AtomCount--;
    733733  } else
    734734    eLog() << Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl;
     
    909909    now = time((time_t *)NULL);   // Get the system time and put it into 'now' as 'calender time'
    910910    for (int step=0;step<MDSteps;step++) {
    911       *output << AtomCount << "\n\tCreated by molecuilder, step " << step << ", on " << ctime(&now);
     911      *output << getAtomCount() << "\n\tCreated by molecuilder, step " << step << ", on " << ctime(&now);
    912912      ActOnAllAtoms( &atom::OutputTrajectoryXYZ, output, step );
    913913    }
     
    926926  if (output != NULL) {
    927927    now = time((time_t *)NULL);   // Get the system time and put it into 'now' as 'calender time'
    928     *output << AtomCount << "\n\tCreated by molecuilder on " << ctime(&now);
     928    *output << getAtomCount() << "\n\tCreated by molecuilder on " << ctime(&now);
    929929    ActOnAllAtoms( &atom::OutputXYZLine, output );
    930930    return true;
     
    936936 * \param *out output stream for debugging
    937937 */
    938 void molecule::CountAtoms()
    939 {
    940   int i = size();
    941   if ((AtomCount == 0) || (i != AtomCount)) {
    942     cout << "!!!!!!!!! Counting needed" << endl;
    943     Log() << Verbose(3) << "Mismatch in AtomCount " << AtomCount << " and recounted number " << i << ", renaming all." << endl;
    944     AtomCount = i;
    945 
    946     // count NonHydrogen atoms and give each atom a unique name
    947     if (AtomCount != 0) {
    948       i=0;
    949       NoNonHydrogen = 0;
    950       for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
    951         (*iter)->nr = i;   // update number in molecule (for easier referencing in FragmentMolecule lateron)
    952         if ((*iter)->type->Z != 1) // count non-hydrogen atoms whilst at it
    953           NoNonHydrogen++;
    954         Free(&(*iter)->Name);
    955         (*iter)->Name = Malloc<char>(6, "molecule::CountAtoms: *walker->Name");
    956         sprintf((*iter)->Name, "%2s%02d", (*iter)->type->symbol, (*iter)->nr+1);
    957         Log() << Verbose(3) << "Naming atom nr. " << (*iter)->nr << " " << (*iter)->Name << "." << endl;
    958         i++;
    959       }
    960     } else
    961       Log() << Verbose(3) << "AtomCount is still " << AtomCount << ", thus counting nothing." << endl;
    962   }
     938int molecule::doCountAtoms()
     939{
     940  int res = size();
     941  int i = 0;
     942  NoNonHydrogen = 0;
     943  for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
     944    (*iter)->nr = i;   // update number in molecule (for easier referencing in FragmentMolecule lateron)
     945    if ((*iter)->type->Z != 1) // count non-hydrogen atoms whilst at it
     946      NoNonHydrogen++;
     947    Free(&(*iter)->Name);
     948    (*iter)->Name = Malloc<char>(6, "molecule::CountAtoms: *walker->Name");
     949    sprintf((*iter)->Name, "%2s%02d", (*iter)->type->symbol, (*iter)->nr+1);
     950    Log() << Verbose(3) << "Naming atom nr. " << (*iter)->nr << " " << (*iter)->Name << "." << endl;
     951    i++;
     952  }
     953  return res;
    963954};
    964955
     
    10221013  /// first count both their atoms and elements and update lists thereby ...
    10231014  //Log() << Verbose(0) << "Counting atoms, updating list" << endl;
    1024   CountAtoms();
    1025   OtherMolecule->CountAtoms();
    10261015  CountElements();
    10271016  OtherMolecule->CountElements();
     
    10301019  /// -# AtomCount
    10311020  if (result) {
    1032     if (AtomCount != OtherMolecule->AtomCount) {
    1033       Log() << Verbose(4) << "AtomCounts don't match: " << AtomCount << " == " << OtherMolecule->AtomCount << endl;
     1021    if (getAtomCount() != OtherMolecule->getAtomCount()) {
     1022      Log() << Verbose(4) << "AtomCounts don't match: " << getAtomCount() << " == " << OtherMolecule->getAtomCount() << endl;
    10341023      result = false;
    1035     } else Log() << Verbose(4) << "AtomCounts match: " << AtomCount << " == " << OtherMolecule->AtomCount << endl;
     1024    } else Log() << Verbose(4) << "AtomCounts match: " << getAtomCount() << " == " << OtherMolecule->getAtomCount() << endl;
    10361025  }
    10371026  /// -# ElementCount
     
    10731062  if (result) {
    10741063    Log() << Verbose(5) << "Calculating distances" << endl;
    1075     Distances = Calloc<double>(AtomCount, "molecule::IsEqualToWithinThreshold: Distances");
    1076     OtherDistances = Calloc<double>(AtomCount, "molecule::IsEqualToWithinThreshold: OtherDistances");
     1064    Distances = Calloc<double>(getAtomCount(), "molecule::IsEqualToWithinThreshold: Distances");
     1065    OtherDistances = Calloc<double>(getAtomCount(), "molecule::IsEqualToWithinThreshold: OtherDistances");
    10771066    SetIndexedArrayForEachAtomTo ( Distances, &atom::nr, &atom::DistanceSquaredToVector, (const Vector &)CenterOfGravity);
    10781067    SetIndexedArrayForEachAtomTo ( OtherDistances, &atom::nr, &atom::DistanceSquaredToVector, (const Vector &)CenterOfGravity);
     
    10801069    /// ... sort each list (using heapsort (o(N log N)) from GSL)
    10811070    Log() << Verbose(5) << "Sorting distances" << endl;
    1082     PermMap = Calloc<size_t>(AtomCount, "molecule::IsEqualToWithinThreshold: *PermMap");
    1083     OtherPermMap = Calloc<size_t>(AtomCount, "molecule::IsEqualToWithinThreshold: *OtherPermMap");
    1084     gsl_heapsort_index (PermMap, Distances, AtomCount, sizeof(double), CompareDoubles);
    1085     gsl_heapsort_index (OtherPermMap, OtherDistances, AtomCount, sizeof(double), CompareDoubles);
    1086     PermutationMap = Calloc<int>(AtomCount, "molecule::IsEqualToWithinThreshold: *PermutationMap");
     1071    PermMap = Calloc<size_t>(getAtomCount(), "molecule::IsEqualToWithinThreshold: *PermMap");
     1072    OtherPermMap = Calloc<size_t>(getAtomCount(), "molecule::IsEqualToWithinThreshold: *OtherPermMap");
     1073    gsl_heapsort_index (PermMap, Distances, getAtomCount(), sizeof(double), CompareDoubles);
     1074    gsl_heapsort_index (OtherPermMap, OtherDistances, getAtomCount(), sizeof(double), CompareDoubles);
     1075    PermutationMap = Calloc<int>(getAtomCount(), "molecule::IsEqualToWithinThreshold: *PermutationMap");
    10871076    Log() << Verbose(5) << "Combining Permutation Maps" << endl;
    1088     for(int i=AtomCount;i--;)
     1077    for(int i=getAtomCount();i--;)
    10891078      PermutationMap[PermMap[i]] = (int) OtherPermMap[i];
    10901079
     
    10921081    Log() << Verbose(4) << "Comparing distances" << endl;
    10931082    flag = 0;
    1094     for (int i=0;i<AtomCount;i++) {
     1083    for (int i=0;i<getAtomCount();i++) {
    10951084      Log() << Verbose(5) << "Distances squared: |" << Distances[PermMap[i]] << " - " << OtherDistances[OtherPermMap[i]] << "| = " << fabs(Distances[PermMap[i]] - OtherDistances[OtherPermMap[i]]) << " ?<? " <<  threshold << endl;
    10961085      if (fabs(Distances[PermMap[i]] - OtherDistances[OtherPermMap[i]]) > threshold*threshold)
     
    11291118{
    11301119  Log() << Verbose(3) << "Begin of GetFatherAtomicMap." << endl;
    1131   int *AtomicMap = Malloc<int>(AtomCount, "molecule::GetAtomicMap: *AtomicMap");
    1132   for (int i=AtomCount;i--;)
     1120  int *AtomicMap = Malloc<int>(getAtomCount(), "molecule::GetAtomicMap: *AtomicMap");
     1121  for (int i=getAtomCount();i--;)
    11331122    AtomicMap[i] = -1;
    11341123  if (OtherMolecule == this) {  // same molecule
    1135     for (int i=AtomCount;i--;) // no need as -1 means already that there is trivial correspondence
     1124    for (int i=getAtomCount();i--;) // no need as -1 means already that there is trivial correspondence
    11361125      AtomicMap[i] = i;
    11371126    Log() << Verbose(4) << "Map is trivial." << endl;
  • src/molecule.hpp

    r80c63d rea7176  
    103103    bond *last;         //!< end of bond list
    104104    int MDSteps;        //!< The number of MD steps in Trajectories
    105     int AtomCount;          //!< number of atoms, brought up-to-date by CountAtoms()
     105    //int AtomCount;          //!< number of atoms, brought up-to-date by CountAtoms()
    106106    int BondCount;          //!< number of atoms, brought up-to-date by CountBonds()
    107107    int ElementCount;       //!< how many unique elements are therein
     
    118118  private:
    119119    Cacheable<string> formula;
     120    Cacheable<int>    AtomCount;
    120121    moleculeId_t id;
    121122    atomSet atoms; //<!set of atoms
    122123  protected:
     124    //void CountAtoms();
    123125    /**
    124126     * this iterator type should be used for internal variables, \
     
    135137  //getter and setter
    136138  const std::string getName();
     139  int getAtomCount() const;
     140  int doCountAtoms();
    137141  moleculeId_t getId();
    138142  void setId(moleculeId_t);
     
    252256
    253257  /// Count and change present atoms' coordination.
    254   void CountAtoms();
    255258  void CountElements();
    256259  void CalculateOrbitals(class config &configuration);
  • src/molecule_dynamics.cpp

    r80c63d rea7176  
    213213void FillDistanceList(molecule *mol, struct EvaluatePotential &Params)
    214214{
    215   for (int i=mol->AtomCount; i--;) {
     215  for (int i=mol->getAtomCount(); i--;) {
    216216    Params.DistanceList[i] = new DistanceMap;    // is the distance sorted target list per atom
    217217    Params.DistanceList[i]->clear();
     
    287287  }
    288288  while ((Potential) > Params.PenaltyConstants[2]) {
    289     PrintPermutationMap(mol->AtomCount, Params);
     289    PrintPermutationMap(mol->getAtomCount(), Params);
    290290    iter++;
    291291    if (iter == mol->end()) // round-robin at the end
     
    296296    Potential = TryNextNearestNeighbourForInjectivePermutation(mol, (*iter), Potential, Params);
    297297  }
    298   for (int i=mol->AtomCount; i--;) // now each single entry in the DoubleList should be <=1
     298  for (int i=mol->getAtomCount(); i--;) // now each single entry in the DoubleList should be <=1
    299299    if (Params.DoubleList[i] > 1) {
    300300      eLog() << Verbose(0) << "Failed to create an injective PermutationMap!" << endl;
     
    335335  double Potential, OldPotential, OlderPotential;
    336336  struct EvaluatePotential Params;
    337   Params.PermutationMap = Calloc<atom*>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.**PermutationMap");
    338   Params.DistanceList = Malloc<DistanceMap*>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.**DistanceList");
    339   Params.DistanceIterators = Malloc<DistanceMap::iterator>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.*DistanceIterators");
    340   Params.DoubleList = Calloc<int>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.*DoubleList");
    341   Params.StepList = Malloc<DistanceMap::iterator>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.*StepList");
     337  Params.PermutationMap = Calloc<atom*>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.**PermutationMap");
     338  Params.DistanceList = Malloc<DistanceMap*>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.**DistanceList");
     339  Params.DistanceIterators = Malloc<DistanceMap::iterator>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.*DistanceIterators");
     340  Params.DoubleList = Calloc<int>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.*DoubleList");
     341  Params.StepList = Malloc<DistanceMap::iterator>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.*StepList");
    342342  int round;
    343343  atom *Sprinter = NULL;
     
    372372      iter = begin();
    373373      for (; iter != end(); ++iter) {
    374         PrintPermutationMap(AtomCount, Params);
     374        PrintPermutationMap(getAtomCount(), Params);
    375375        Sprinter = Params.DistanceIterators[(*iter)->nr]->second;   // store initial partner
    376376        Strider = Params.DistanceIterators[(*iter)->nr];  //remember old iterator
     
    400400            Params.PermutationMap[(*iter)->nr] = Params.DistanceIterators[(*iter)->nr]->second; // put next farther distance into PermutationMap
    401401            Params.PermutationMap[(*runner)->nr] = Sprinter;  // and hand the old target to its respective owner
    402             PrintPermutationMap(AtomCount, Params);
     402            PrintPermutationMap(getAtomCount(), Params);
    403403            // calculate the new potential
    404404            //Log() << Verbose(2) << "Checking new potential ..." << endl;
     
    438438
    439439  /// free memory and return with evaluated potential
    440   for (int i=AtomCount; i--;)
     440  for (int i=getAtomCount(); i--;)
    441441    Params.DistanceList[i]->clear();
    442442  Free(&Params.DistanceList);
     
    483483    MinimiseConstrainedPotential(PermutationMap, startstep, endstep, configuration.GetIsAngstroem());
    484484  else {
    485     PermutationMap = Malloc<atom *>(AtomCount, "molecule::LinearInterpolationBetweenConfiguration: **PermutationMap");
     485    PermutationMap = Malloc<atom *>(getAtomCount(), "molecule::LinearInterpolationBetweenConfiguration: **PermutationMap");
    486486    SetIndexedArrayForEachAtomTo( PermutationMap, &atom::nr );
    487487  }
     
    516516
    517517  // store the list to single step files
    518   int *SortIndex = Malloc<int>(AtomCount, "molecule::LinearInterpolationBetweenConfiguration: *SortIndex");
    519   for (int i=AtomCount; i--; )
     518  int *SortIndex = Malloc<int>(getAtomCount(), "molecule::LinearInterpolationBetweenConfiguration: *SortIndex");
     519  for (int i=getAtomCount(); i--; )
    520520    SortIndex[i] = i;
    521521  status = MoleculePerStep->OutputConfigForListOfFragments(&configuration, SortIndex);
     
    561561      return false;
    562562    }
    563     if (Force.RowCounter[0] != AtomCount) {
    564       eLog() << Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << AtomCount << "." << endl;
     563    if (Force.RowCounter[0] != getAtomCount()) {
     564      eLog() << Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << getAtomCount() << "." << endl;
    565565      performCriticalExit();
    566566      return false;
     
    568568    // correct Forces
    569569    Velocity.Zero();
    570     for(int i=0;i<AtomCount;i++)
     570    for(int i=0;i<getAtomCount();i++)
    571571      for(int d=0;d<NDIM;d++) {
    572572        Velocity.x[d] += Force.Matrix[0][i][d+5];
    573573      }
    574     for(int i=0;i<AtomCount;i++)
     574    for(int i=0;i<getAtomCount();i++)
    575575      for(int d=0;d<NDIM;d++) {
    576         Force.Matrix[0][i][d+5] -= Velocity.x[d]/(double)AtomCount;
     576        Force.Matrix[0][i][d+5] -= Velocity.x[d]/static_cast<double>(getAtomCount());
    577577      }
    578578    // solve a constrained potential if we are meant to
     
    677677      delta_alpha = 0.;
    678678      ActOnAllAtoms( &atom::Thermostat_NoseHoover_init, MDSteps, &delta_alpha );
    679       delta_alpha = (delta_alpha - (3.*AtomCount+1.) * configuration.TargetTemp)/(configuration.HooverMass*Units2Electronmass);
     679      delta_alpha = (delta_alpha - (3.*getAtomCount()+1.) * configuration.TargetTemp)/(configuration.HooverMass*Units2Electronmass);
    680680      configuration.alpha += delta_alpha*configuration.Deltat;
    681681      Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl;
  • src/molecule_fragmentation.cpp

    r80c63d rea7176  
    435435
    436436  // initialize mask list
    437   for(int i=AtomCount;i--;)
     437  for(int i=getAtomCount();i--;)
    438438    AtomMask[i] = false;
    439439
    440440  if (Order < 0) { // adaptive increase of BondOrder per site
    441     if (AtomMask[AtomCount] == true)  // break after one step
     441    if (AtomMask[getAtomCount()] == true)  // break after one step
    442442      return false;
    443443
     
    483483      }
    484484    }
    485     if ((Order == 0) && (AtomMask[AtomCount] == false))  // single stepping, just check
     485    if ((!Order) && (!AtomMask[getAtomCount()]))  // single stepping, just check
    486486      status = true;
    487487
     
    494494  }
    495495
    496   PrintAtomMask(AtomMask, AtomCount); // for debugging
     496  PrintAtomMask(AtomMask, getAtomCount()); // for debugging
    497497
    498498  return status;
     
    510510    return false;
    511511  }
    512   SortIndex = Malloc<int>(AtomCount, "molecule::CreateMappingLabelsToConfigSequence: *SortIndex");
    513   for(int i=AtomCount;i--;)
     512  SortIndex = Malloc<int>(getAtomCount(), "molecule::CreateMappingLabelsToConfigSequence: *SortIndex");
     513  for(int i=getAtomCount();i--;)
    514514    SortIndex[i] = -1;
    515515
     
    595595  MoleculeListClass *BondFragments = NULL;
    596596  int *SortIndex = NULL;
    597   int *MinimumRingSize = new int[AtomCount];
     597  int *MinimumRingSize = new int[getAtomCount()];
    598598  int FragmentCounter;
    599599  MoleculeLeafClass *MolecularWalker = NULL;
     
    623623
    624624  // create lookup table for Atom::nr
    625   FragmentationToDo = FragmentationToDo && CreateFatherLookupTable(ListOfAtoms, AtomCount);
     625  FragmentationToDo = FragmentationToDo && CreateFatherLookupTable(ListOfAtoms, getAtomCount());
    626626
    627627  // === compare it with adjacency file ===
     
    633633
    634634  // analysis of the cycles (print rings, get minimum cycle length) for each subgraph
    635   for(int i=AtomCount;i--;)
    636     MinimumRingSize[i] = AtomCount;
     635  for(int i=getAtomCount();i--;)
     636    MinimumRingSize[i] = getAtomCount();
    637637  MolecularWalker = Subgraphs;
    638638  FragmentCounter = 0;
     
    671671  // ===== 6b. prepare and go into the adaptive (Order<0), single-step (Order==0) or incremental (Order>0) cycle
    672672  KeyStack *RootStack = new KeyStack[Subgraphs->next->Count()];
    673   AtomMask = new bool[AtomCount+1];
    674   AtomMask[AtomCount] = false;
     673  AtomMask = new bool[getAtomCount()+1];
     674  AtomMask[getAtomCount()] = false;
    675675  FragmentationToDo = false;  // if CheckOrderAtSite just ones recommends fragmentation, we will save fragments afterwards
    676676  while ((CheckOrder = CheckOrderAtSite(AtomMask, ParsedFragmentList, Order, MinimumRingSize, configuration->configpath))) {
    677677    FragmentationToDo = FragmentationToDo || CheckOrder;
    678     AtomMask[AtomCount] = true;   // last plus one entry is used as marker that we have been through this loop once already in CheckOrderAtSite()
     678    AtomMask[getAtomCount()] = true;   // last plus one entry is used as marker that we have been through this loop once already in CheckOrderAtSite()
    679679    // ===== 6b. fill RootStack for each subgraph (second adaptivity check) =====
    680680    Subgraphs->next->FillRootStackForSubgraphs(RootStack, AtomMask, (FragmentCounter = 0));
     
    811811bool molecule::ParseOrderAtSiteFromFile(char *path)
    812812{
    813   unsigned char *OrderArray = Calloc<unsigned char>(AtomCount, "molecule::ParseOrderAtSiteFromFile - *OrderArray");
    814   bool *MaxArray = Calloc<bool>(AtomCount, "molecule::ParseOrderAtSiteFromFile - *MaxArray");
     813  unsigned char *OrderArray = Calloc<unsigned char>(getAtomCount(), "molecule::ParseOrderAtSiteFromFile - *OrderArray");
     814  bool *MaxArray = Calloc<bool>(getAtomCount(), "molecule::ParseOrderAtSiteFromFile - *MaxArray");
    815815  bool status;
    816816  int AtomNr, value;
     
    917917  atom *OtherFather = NULL;
    918918  atom *FatherOfRunner = NULL;
    919   Leaf->CountAtoms();
    920919
    921920#ifdef ADDHYDROGEN
     
    955954      eLog() << Verbose(1) << "Son " << (*iter)->Name << " has father " << FatherOfRunner->Name << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl;
    956955    }
    957     if ((LonelyFlag) && (Leaf->AtomCount > 1)) {
     956    if ((LonelyFlag) && (Leaf->getAtomCount() > 1)) {
    958957      Log() << Verbose(0) << *(*iter) << "has got bonds only to hydrogens!" << endl;
    959958    }
     
    975974molecule * molecule::StoreFragmentFromKeySet(KeySet &Leaflet, bool IsAngstroem)
    976975{
    977   atom **SonList = Calloc<atom*>(AtomCount, "molecule::StoreFragmentFromStack: **SonList");
     976  atom **SonList = Calloc<atom*>(getAtomCount(), "molecule::StoreFragmentFromStack: **SonList");
    978977  molecule *Leaf = World::get()->createMolecule();
    979978
     
    16021601  FragmentSearch.FragmentSet = new KeySet;
    16031602  FragmentSearch.Root = FindAtom(RootKeyNr);
    1604   FragmentSearch.ShortestPathList = Malloc<int>(AtomCount, "molecule::PowerSetGenerator: *ShortestPathList");
    1605   for (int i=AtomCount;i--;) {
     1603  FragmentSearch.ShortestPathList = Malloc<int>(getAtomCount(), "molecule::PowerSetGenerator: *ShortestPathList");
     1604  for (int i=getAtomCount();i--;) {
    16061605    FragmentSearch.ShortestPathList[i] = -1;
    16071606  }
     
    17071706  Vector Translationvector;
    17081707  //class StackClass<atom *> *CompStack = NULL;
    1709   class StackClass<atom *> *AtomStack = new StackClass<atom *>(AtomCount);
     1708  class StackClass<atom *> *AtomStack = new StackClass<atom *>(getAtomCount());
    17101709  bool flag = true;
    17111710
    17121711  Log() << Verbose(2) << "Begin of ScanForPeriodicCorrection." << endl;
    17131712
    1714   ColorList = Calloc<enum Shading>(AtomCount, "molecule::ScanForPeriodicCorrection: *ColorList");
     1713  ColorList = Calloc<enum Shading>(getAtomCount(), "molecule::ScanForPeriodicCorrection: *ColorList");
    17151714  while (flag) {
    17161715    // remove bonds that are beyond bonddistance
     
    17461745      Log() << Verbose(0) << endl;
    17471746      // apply to all atoms of first component via BFS
    1748       for (int i=AtomCount;i--;)
     1747      for (int i=getAtomCount();i--;)
    17491748        ColorList[i] = white;
    17501749      AtomStack->Push(Binder->leftatom);
  • src/molecule_geometry.cpp

    r80c63d rea7176  
    298298  Free(&inversematrix);
    299299
    300   Center.Scale(1./(double)AtomCount);
     300  Center.Scale(1./static_cast<double>(getAtomCount()));
    301301};
    302302
  • 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);
  • src/moleculelist.cpp

    r80c63d rea7176  
    2020#include "memoryallocator.hpp"
    2121#include "periodentafel.hpp"
     22#include "Helpers/Assert.hpp"
    2223
    2324/*********************************** Functions for class MoleculeListClass *************************/
     
    7172  // sort each atom list and put the numbers into a list, then go through
    7273  //Log() << Verbose(0) << "Comparing fragment no. " << *(molecule **)a << " to " << *(molecule **)b << "." << endl;
    73   if ((**(molecule **) a).AtomCount < (**(molecule **) b).AtomCount) {
     74  // Yes those types are awkward... but check it for yourself it checks out this way
     75  molecule *const *mol1_ptr= static_cast<molecule *const *>(a);
     76  molecule *mol1 = *mol1_ptr;
     77  molecule *const *mol2_ptr= static_cast<molecule *const *>(b);
     78  molecule *mol2 = *mol2_ptr;
     79  if (mol1->getAtomCount() < mol2->getAtomCount()) {
    7480    return -1;
    7581  } else {
    76     if ((**(molecule **) a).AtomCount > (**(molecule **) b).AtomCount)
     82    if (mol1->getAtomCount() > mol2->getAtomCount())
    7783      return +1;
    7884    else {
    79       Count = (**(molecule **) a).AtomCount;
     85      Count = mol1->getAtomCount();
    8086      aList = new int[Count];
    8187      bList = new int[Count];
     
    8591      aCounter = 0;
    8692      bCounter = 0;
    87       molecule::const_iterator aiter = (**(molecule **) a).begin();
    88       molecule::const_iterator biter = (**(molecule **) b).begin();
    89       for (;(aiter != (**(molecule **) a).end()) && (biter != (**(molecule **) b).end());
     93      molecule::const_iterator aiter = mol1->begin();
     94      molecule::const_iterator biter = mol2->begin();
     95      for (;(aiter != mol1->end()) && (biter != mol2->end());
    9096          ++aiter, ++biter) {
    9197        if ((*aiter)->GetTrueFather() == NULL)
     
    101107      // check if AtomCount was for real
    102108      flag = 0;
    103       if ((aiter == (**(molecule **) a).end()) && (biter != (**(molecule **) b).end())) {
     109      if ((aiter == mol1->end()) && (biter != mol2->end())) {
    104110        flag = -1;
    105111      } else {
    106         if ((aiter != (**(molecule **) a).end()) && (biter == (**(molecule **) b).end()))
     112        if ((aiter != mol1->end()) && (biter == mol2->end()))
    107113          flag = 1;
    108114      }
     
    162168      }
    163169      // output Index, Name, number of atoms, chemical formula
    164       (*out) << ((*ListRunner)->ActiveFlag ? "*" : " ") << (*ListRunner)->IndexNr << "\t" << (*ListRunner)->name << "\t\t" << (*ListRunner)->AtomCount << "\t";
     170      (*out) << ((*ListRunner)->ActiveFlag ? "*" : " ") << (*ListRunner)->IndexNr << "\t" << (*ListRunner)->name << "\t\t" << (*ListRunner)->getAtomCount() << "\t";
    165171      Elemental = (*ListRunner)->elemente->end;
    166172      while(Elemental->previous != (*ListRunner)->elemente->start) {
     
    321327
    322328  // prepare index list for bonds
    323   srcmol->CountAtoms();
    324   atom ** CopyAtoms = new atom*[srcmol->AtomCount];
    325   for(int i=0;i<srcmol->AtomCount;i++)
     329  atom ** CopyAtoms = new atom*[srcmol->getAtomCount()];
     330  for(int i=0;i<srcmol->getAtomCount();i++)
    326331    CopyAtoms[i] = NULL;
    327332
     
    338343    }
    339344  }
    340   Log() << Verbose(1) << nr << " of " << srcmol->AtomCount << " atoms have been merged.";
     345  Log() << Verbose(1) << nr << " of " << srcmol->getAtomCount() << " atoms have been merged.";
    341346
    342347  // go through all bonds and add as well
     
    780785  // 4b. create and fill map of which atom is associated to which connected molecule (note, counting starts at 1)
    781786  int FragmentCounter = 0;
    782   int *MolMap = Calloc<int>(mol->AtomCount, "config::Load() - *MolMap");
     787  int *MolMap = Calloc<int>(mol->getAtomCount(), "config::Load() - *MolMap");
    783788  MoleculeLeafClass *MolecularWalker = Subgraphs;
    784789  while (MolecularWalker->next != NULL) {
     
    792797  // 4c. relocate atoms to new molecules and remove from Leafs
    793798  for (molecule::iterator iter = mol->begin(); !mol->empty(); iter = mol->begin()) {
    794     if (((*iter)->nr <0) || ((*iter)->nr >= mol->AtomCount)) {
     799    if (((*iter)->nr <0) || ((*iter)->nr >= mol->getAtomCount())) {
    795800      eLog() << Verbose(0) << "Index of atom " << *(*iter) << " is invalid!" << endl;
    796801      performCriticalExit();
     
    10161021  Log() << Verbose(1) << "Begin of FillBondStructureFromReference." << endl;
    10171022  // fill ListOfLocalAtoms if NULL was given
    1018   if (!FillListOfLocalAtoms(ListOfLocalAtoms, FragmentCounter, reference->AtomCount, FreeList)) {
     1023  if (!FillListOfLocalAtoms(ListOfLocalAtoms, FragmentCounter, reference->getAtomCount(), FreeList)) {
    10191024    Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl;
    10201025    return false;
     
    11431148  Log() << Verbose(1) << "Begin of AssignKeySetsToFragment." << endl;
    11441149  // fill ListOfLocalAtoms if NULL was given
    1145   if (!FillListOfLocalAtoms(ListOfLocalAtoms, FragmentCounter, reference->AtomCount, FreeList)) {
     1150  if (!FillListOfLocalAtoms(ListOfLocalAtoms, FragmentCounter, reference->getAtomCount(), FreeList)) {
    11461151    Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl;
    11471152    return false;
  • src/tesselation.cpp

    r80c63d rea7176  
    368368    Counter++;
    369369  }
     370  cout << "Counter is now: " << Counter << endl;
    370371  ASSERT(Counter >= 3,"We have a triangle with only two distinct endpoints!");
    371372};
  • src/unittests/AnalysisCorrelationToPointUnitTest.cpp

    r80c63d rea7176  
    7979
    8080  // check that TestMolecule was correctly constructed
    81   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
     81  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 );
    8282
    8383  TestList = World::get()->getMolecules();
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    r80c63d rea7176  
    3939void AnalysisCorrelationToSurfaceUnitTest::setUp()
    4040{
    41   ASSERT_DO(Assert::Throw);
     41  ASSERT_DO(Assert::Abort);
    4242  atom *Walker = NULL;
    4343
     
    8787
    8888  // check that TestMolecule was correctly constructed
    89   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
     89  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 );
    9090
    9191  TestList = World::get()->getMolecules();
  • src/unittests/AnalysisPairCorrelationUnitTest.cpp

    r80c63d rea7176  
    7979
    8080  // check that TestMolecule was correctly constructed
    81   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
     81  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 );
    8282
    8383  TestList = World::get()->getMolecules();
  • src/unittests/analysisbondsunittest.cpp

    r80c63d rea7176  
    9090
    9191  // check that TestMolecule was correctly constructed
    92   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 5 );
     92  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 5 );
    9393
    9494  // create a small file with table
  • src/unittests/bondgraphunittest.cpp

    r80c63d rea7176  
    8181
    8282  // check that TestMolecule was correctly constructed
    83   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
     83  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 );
    8484
    8585  // create a small file with table
  • src/unittests/listofbondsunittest.cpp

    r80c63d rea7176  
    7474
    7575  // check that TestMolecule was correctly constructed
    76   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
     76  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 );
    7777
    7878};
Note: See TracChangeset for help on using the changeset viewer.