Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule.cpp

    r68f03d ra67d19  
    66
    77#include <cstring>
    8 #include <boost/bind.hpp>
    9 
    10 #include "World.hpp"
     8
    119#include "atom.hpp"
    1210#include "bond.hpp"
     
    2624#include "vector.hpp"
    2725#include "World.hpp"
    28 #include "Plane.hpp"
    29 #include "Exceptions/LinearDependenceException.hpp"
    30 
    3126
    3227/************************************* Functions for class molecule *********************************/
     
    3530 * Initialises molecule list with correctly referenced start and end, and sets molecule::last_atom to zero.
    3631 */
    37 molecule::molecule(const periodentafel * const teil) : elemente(teil), start(World::getInstance().createAtom()), end(World::getInstance().createAtom()),
     32molecule::molecule(const periodentafel * const teil) : elemente(teil), start(new atom), end(new atom),
    3833  first(new bond(start, end, 1, -1)), last(new bond(start, end, 1, -1)), MDSteps(0), AtomCount(0),
    3934  BondCount(0), ElementCount(0), NoNonHydrogen(0), NoNonBonds(0), NoCyclicBonds(0), BondDistance(0.),
    40   ActiveFlag(false), IndexNr(-1),
    41   formula(this,boost::bind(&molecule::calcFormula,this)),
    42   last_atom(0),
    43   InternalPointer(start)
     35  ActiveFlag(false), IndexNr(-1), last_atom(0), InternalPointer(start)
    4436{
    4537  // init atom chain list
     
    5446  for(int i=MAX_ELEMENTS;i--;)
    5547    ElementsInMolecule[i] = 0;
    56   strcpy(name,World::getInstance().getDefaultName());
    57 };
    58 
    59 molecule *NewMolecule(){
    60   return new molecule(World::getInstance().getPeriode());
    61 }
     48  strcpy(name,World::get()->DefaultName);
     49};
    6250
    6351/** Destructor of class molecule.
     
    6957  delete(first);
    7058  delete(last);
    71   end->getWorld()->destroyAtom(end);
    72   start->getWorld()->destroyAtom(start);
    73 };
    74 
    75 
    76 void DeleteMolecule(molecule *mol){
    77   delete mol;
    78 }
    79 
    80 // getter and setter
    81 const std::string molecule::getName(){
    82   return std::string(name);
    83 }
    84 
    85 void molecule::setName(const std::string _name){
    86   OBSERVE;
    87   strncpy(name,_name.c_str(),MAXSTRINGSIZE);
    88 }
    89 
    90 moleculeId_t molecule::getId(){
    91   return id;
    92 }
    93 
    94 void molecule::setId(moleculeId_t _id){
    95   id =_id;
    96 }
    97 
    98 const std::string molecule::getFormula(){
    99   return *formula;
    100 }
    101 
    102 std::string molecule::calcFormula(){
    103   std::map<atomicNumber_t,unsigned int> counts;
    104   stringstream sstr;
    105   periodentafel *periode = World::getInstance().getPeriode();
    106   for(atom *Walker = start; Walker != end; Walker = Walker->next) {
    107     counts[Walker->type->getNumber()]++;
    108   }
    109   std::map<atomicNumber_t,unsigned int>::reverse_iterator iter;
    110   for(iter = counts.rbegin(); iter != counts.rend(); ++iter) {
    111     atomicNumber_t Z = (*iter).first;
    112     sstr << periode->FindElement(Z)->symbol << (*iter).second;
    113   }
    114   return sstr.str();
    115 }
     59  delete(end);
     60  delete(start);
     61};
    11662
    11763
     
    12369bool molecule::AddAtom(atom *pointer)
    12470{
    125   bool retval = false;
    126   OBSERVE;
    12771  if (pointer != NULL) {
    12872    pointer->sort = &pointer->nr;
     
    13579      if (pointer->type->Z != 1)
    13680        NoNonHydrogen++;
    137       if(pointer->getName() == "Unknown"){
    138         stringstream sstr;
    139         sstr << pointer->type->symbol << pointer->nr+1;
    140         pointer->setName(sstr.str());
    141       }
    142     }
    143     retval = add(pointer, end);
    144   }
    145   return retval;
     81      if (pointer->Name == NULL) {
     82        Free(&pointer->Name);
     83        pointer->Name = Malloc<char>(6, "molecule::AddAtom: *pointer->Name");
     84        sprintf(pointer->Name, "%2s%02d", pointer->type->symbol, pointer->nr+1);
     85      }
     86    }
     87    return add(pointer, end);
     88  } else
     89    return false;
    14690};
    14791
     
    15397atom * molecule::AddCopyAtom(atom *pointer)
    15498{
    155   atom *retval = NULL;
    156   OBSERVE;
    15799  if (pointer != NULL) {
    158     atom *walker = pointer->clone();
    159     stringstream sstr;
    160     sstr << pointer->getName();
    161     walker->setName(sstr.str());
     100    atom *walker = new atom(pointer);
     101    walker->Name = Malloc<char>(strlen(pointer->Name) + 1, "atom::atom: *Name");
     102    strcpy (walker->Name, pointer->Name);
    162103    walker->nr = last_atom++;  // increase number within molecule
    163104    add(walker, end);
     
    165106      NoNonHydrogen++;
    166107    AtomCount++;
    167     retval=walker;
    168   }
    169   return retval;
     108    return walker;
     109  } else
     110    return NULL;
    170111};
    171112
     
    206147bool molecule::AddHydrogenReplacementAtom(bond *TopBond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bool IsAngstroem)
    207148{
    208   bool AllWentWell = true;    // flag gathering the boolean return value of molecule::AddAtom and other functions, as return value on exit
    209   OBSERVE;
    210149  double bondlength;  // bond length of the bond to be replaced/cut
    211150  double bondangle;  // bond angle of the bond to be replaced/cut
    212151  double BondRescale;   // rescale value for the hydrogen bond length
     152  bool AllWentWell = true;    // flag gathering the boolean return value of molecule::AddAtom and other functions, as return value on exit
    213153  bond *FirstBond = NULL, *SecondBond = NULL; // Other bonds in double bond case to determine "other" plane
    214154  atom *FirstOtherAtom = NULL, *SecondOtherAtom = NULL, *ThirdOtherAtom = NULL; // pointer to hydrogen atoms to be added
     
    218158  double *matrix = NULL;
    219159  bond *Binder = NULL;
    220   double * const cell_size = World::getInstance().getDomain();
     160  double * const cell_size = World::get()->cell_size;
    221161
    222162//  Log() << Verbose(3) << "Begin of AddHydrogenReplacementAtom." << endl;
    223163  // create vector in direction of bond
    224   InBondvector = TopReplacement->x - TopOrigin->x;
     164  InBondvector.CopyVector(&TopReplacement->x);
     165  InBondvector.SubtractVector(&TopOrigin->x);
    225166  bondlength = InBondvector.Norm();
    226167
     
    234175    Orthovector1.Zero();
    235176    for (int i=NDIM;i--;) {
    236       l = TopReplacement->x[i] - TopOrigin->x[i];
     177      l = TopReplacement->x.x[i] - TopOrigin->x.x[i];
    237178      if (fabs(l) > BondDistance) { // is component greater than bond distance
    238         Orthovector1[i] = (l < 0) ? -1. : +1.;
     179        Orthovector1.x[i] = (l < 0) ? -1. : +1.;
    239180      } // (signs are correct, was tested!)
    240181    }
    241182    matrix = ReturnFullMatrixforSymmetric(cell_size);
    242183    Orthovector1.MatrixMultiplication(matrix);
    243     InBondvector -= Orthovector1; // subtract just the additional translation
     184    InBondvector.SubtractVector(&Orthovector1); // subtract just the additional translation
    244185    Free(&matrix);
    245186    bondlength = InBondvector.Norm();
     
    253194  BondRescale = TopOrigin->type->HBondDistance[TopBond->BondDegree-1];
    254195  if (BondRescale == -1) {
    255     DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->getName() << "<->" << TopReplacement->getName() << ") of degree " << TopBond->BondDegree << "!" << endl);
     196    DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl);
    256197    return false;
    257198    BondRescale = bondlength;
     
    264205  switch(TopBond->BondDegree) {
    265206    case 1:
    266       FirstOtherAtom = World::getInstance().createAtom();    // new atom
     207      FirstOtherAtom = new atom();    // new atom
    267208      FirstOtherAtom->type = elemente->FindElement(1);  // element is Hydrogen
    268       FirstOtherAtom->v = TopReplacement->v; // copy velocity
     209      FirstOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
    269210      FirstOtherAtom->FixedIon = TopReplacement->FixedIon;
    270211      if (TopReplacement->type->Z == 1) { // neither rescale nor replace if it's already hydrogen
     
    274215        FirstOtherAtom->father = NULL;  // if we replace hydrogen, we mark it as our father, otherwise we are just an added hydrogen with no father
    275216      }
    276       InBondvector *= BondRescale;   // rescale the distance vector to Hydrogen bond length
    277       FirstOtherAtom->x = TopOrigin->x; // set coordination to origin ...
    278       FirstOtherAtom->x = InBondvector;  // ... and add distance vector to replacement atom
     217      InBondvector.Scale(&BondRescale);   // rescale the distance vector to Hydrogen bond length
     218      FirstOtherAtom->x.CopyVector(&TopOrigin->x); // set coordination to origin ...
     219      FirstOtherAtom->x.AddVector(&InBondvector);  // ... and add distance vector to replacement atom
    279220      AllWentWell = AllWentWell && AddAtom(FirstOtherAtom);
    280221//      Log() << Verbose(4) << "Added " << *FirstOtherAtom << " at: ";
     
    296237            SecondOtherAtom = (*Runner)->GetOtherAtom(TopOrigin);
    297238          } else {
    298             DoeLog(2) && (eLog()<< Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->getName());
     239            DoeLog(2) && (eLog()<< Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->Name);
    299240          }
    300241        }
     
    308249
    309250        // determine the plane of these two with the *origin
    310         try {
    311           Orthovector1 =Plane(TopOrigin->x, FirstOtherAtom->x, SecondOtherAtom->x).getNormal();
    312         }
    313         catch(LinearDependenceException &excp){
    314           Log() << Verbose(0) << excp;
    315           // TODO: figure out what to do with the Orthovector in this case
    316           AllWentWell = false;
    317         }
     251        AllWentWell = AllWentWell && Orthovector1.MakeNormalVector(&TopOrigin->x, &FirstOtherAtom->x, &SecondOtherAtom->x);
    318252      } else {
    319         Orthovector1.GetOneNormalVector(InBondvector);
     253        Orthovector1.GetOneNormalVector(&InBondvector);
    320254      }
    321255      //Log() << Verbose(3)<< "Orthovector1: ";
     
    323257      //Log() << Verbose(0) << endl;
    324258      // orthogonal vector and bond vector between origin and replacement form the new plane
    325       Orthovector1.MakeNormalTo(InBondvector);
     259      Orthovector1.MakeNormalVector(&InBondvector);
    326260      Orthovector1.Normalize();
    327261      //Log() << Verbose(3) << "ReScaleCheck: " << Orthovector1.Norm() << " and " << InBondvector.Norm() << "." << endl;
    328262
    329263      // create the two Hydrogens ...
    330       FirstOtherAtom = World::getInstance().createAtom();
    331       SecondOtherAtom = World::getInstance().createAtom();
     264      FirstOtherAtom = new atom();
     265      SecondOtherAtom = new atom();
    332266      FirstOtherAtom->type = elemente->FindElement(1);
    333267      SecondOtherAtom->type = elemente->FindElement(1);
    334       FirstOtherAtom->v = TopReplacement->v; // copy velocity
     268      FirstOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
    335269      FirstOtherAtom->FixedIon = TopReplacement->FixedIon;
    336       SecondOtherAtom->v = TopReplacement->v; // copy velocity
     270      SecondOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
    337271      SecondOtherAtom->FixedIon = TopReplacement->FixedIon;
    338272      FirstOtherAtom->father = NULL;  // we are just an added hydrogen with no father
     
    340274      bondangle = TopOrigin->type->HBondAngle[1];
    341275      if (bondangle == -1) {
    342         DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->getName() << "<->" << TopReplacement->getName() << ") of degree " << TopBond->BondDegree << "!" << endl);
     276        DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl);
    343277        return false;
    344278        bondangle = 0;
     
    355289      SecondOtherAtom->x.Zero();
    356290      for(int i=NDIM;i--;) { // rotate by half the bond angle in both directions (InBondvector is bondangle = 0 direction)
    357         FirstOtherAtom->x[i] = InBondvector[i] * cos(bondangle) + Orthovector1[i] * (sin(bondangle));
    358         SecondOtherAtom->x[i] = InBondvector[i] * cos(bondangle) + Orthovector1[i] * (-sin(bondangle));
    359       }
    360       FirstOtherAtom->x *= BondRescale;  // rescale by correct BondDistance
    361       SecondOtherAtom->x *= BondRescale;
     291        FirstOtherAtom->x.x[i] = InBondvector.x[i] * cos(bondangle) + Orthovector1.x[i] * (sin(bondangle));
     292        SecondOtherAtom->x.x[i] = InBondvector.x[i] * cos(bondangle) + Orthovector1.x[i] * (-sin(bondangle));
     293      }
     294      FirstOtherAtom->x.Scale(&BondRescale);  // rescale by correct BondDistance
     295      SecondOtherAtom->x.Scale(&BondRescale);
    362296      //Log() << Verbose(3) << "ReScaleCheck: " << FirstOtherAtom->x.Norm() << " and " << SecondOtherAtom->x.Norm() << "." << endl;
    363297      for(int i=NDIM;i--;) { // and make relative to origin atom
    364         FirstOtherAtom->x[i] += TopOrigin->x[i];
    365         SecondOtherAtom->x[i] += TopOrigin->x[i];
     298        FirstOtherAtom->x.x[i] += TopOrigin->x.x[i];
     299        SecondOtherAtom->x.x[i] += TopOrigin->x.x[i];
    366300      }
    367301      // ... and add to molecule
     
    383317    case 3:
    384318      // take the "usual" tetraoidal angle and add the three Hydrogen in direction of the bond (height of the tetraoid)
    385       FirstOtherAtom = World::getInstance().createAtom();
    386       SecondOtherAtom = World::getInstance().createAtom();
    387       ThirdOtherAtom = World::getInstance().createAtom();
     319      FirstOtherAtom = new atom();
     320      SecondOtherAtom = new atom();
     321      ThirdOtherAtom = new atom();
    388322      FirstOtherAtom->type = elemente->FindElement(1);
    389323      SecondOtherAtom->type = elemente->FindElement(1);
    390324      ThirdOtherAtom->type = elemente->FindElement(1);
    391       FirstOtherAtom->v = TopReplacement->v; // copy velocity
     325      FirstOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
    392326      FirstOtherAtom->FixedIon = TopReplacement->FixedIon;
    393       SecondOtherAtom->v = TopReplacement->v; // copy velocity
     327      SecondOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
    394328      SecondOtherAtom->FixedIon = TopReplacement->FixedIon;
    395       ThirdOtherAtom->v = TopReplacement->v; // copy velocity
     329      ThirdOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
    396330      ThirdOtherAtom->FixedIon = TopReplacement->FixedIon;
    397331      FirstOtherAtom->father = NULL;  //  we are just an added hydrogen with no father
     
    400334
    401335      // we need to vectors orthonormal the InBondvector
    402       AllWentWell = AllWentWell && Orthovector1.GetOneNormalVector(InBondvector);
     336      AllWentWell = AllWentWell && Orthovector1.GetOneNormalVector(&InBondvector);
    403337//      Log() << Verbose(3) << "Orthovector1: ";
    404338//      Orthovector1.Output(out);
    405339//      Log() << Verbose(0) << endl;
    406       try{
    407         Orthovector2 = Plane(InBondvector, Orthovector1,0).getNormal();
    408       }
    409       catch(LinearDependenceException &excp) {
    410         Log() << Verbose(0) << excp;
    411         AllWentWell = false;
    412       }
     340      AllWentWell = AllWentWell && Orthovector2.MakeNormalVector(&InBondvector, &Orthovector1);
    413341//      Log() << Verbose(3) << "Orthovector2: ";
    414342//      Orthovector2.Output(out);
     
    427355      factors[1] = f;
    428356      factors[2] = 0.;
    429       FirstOtherAtom->x.LinearCombinationOfVectors(InBondvector, Orthovector1, Orthovector2, factors);
     357      FirstOtherAtom->x.LinearCombinationOfVectors(&InBondvector, &Orthovector1, &Orthovector2, factors);
    430358      factors[1] = -0.5*f;
    431359      factors[2] = g;
    432       SecondOtherAtom->x.LinearCombinationOfVectors(InBondvector, Orthovector1, Orthovector2, factors);
     360      SecondOtherAtom->x.LinearCombinationOfVectors(&InBondvector, &Orthovector1, &Orthovector2, factors);
    433361      factors[2] = -g;
    434       ThirdOtherAtom->x.LinearCombinationOfVectors(InBondvector, Orthovector1, Orthovector2, factors);
     362      ThirdOtherAtom->x.LinearCombinationOfVectors(&InBondvector, &Orthovector1, &Orthovector2, factors);
    435363
    436364      // rescale each to correct BondDistance
     
    440368
    441369      // and relative to *origin atom
    442       FirstOtherAtom->x += TopOrigin->x;
    443       SecondOtherAtom->x += TopOrigin->x;
    444       ThirdOtherAtom->x += TopOrigin->x;
     370      FirstOtherAtom->x.AddVector(&TopOrigin->x);
     371      SecondOtherAtom->x.AddVector(&TopOrigin->x);
     372      ThirdOtherAtom->x.AddVector(&TopOrigin->x);
    445373
    446374      // ... and add to molecule
     
    485413bool molecule::AddXYZFile(string filename)
    486414{
    487 
    488415  istringstream *input = NULL;
    489416  int NumberOfAtoms = 0; // atom number in xyz read
     
    499426    return false;
    500427
    501   OBSERVE;
    502428  getline(xyzfile,line,'\n'); // Read numer of atoms in file
    503429  input = new istringstream(line);
     
    510436    MDSteps++;
    511437  for(i=0;i<NumberOfAtoms;i++){
    512     Walker = World::getInstance().createAtom();
     438    Walker = new atom;
    513439    getline(xyzfile,line,'\n');
    514440    istringstream *item = new istringstream(line);
     
    530456    }
    531457    for(j=NDIM;j--;) {
    532       Walker->x[j] = x[j];
    533       Walker->Trajectory.R.at(MDSteps-1)[j] = x[j];
    534       Walker->Trajectory.U.at(MDSteps-1)[j] = 0;
    535       Walker->Trajectory.F.at(MDSteps-1)[j] = 0;
     458      Walker->x.x[j] = x[j];
     459      Walker->Trajectory.R.at(MDSteps-1).x[j] = x[j];
     460      Walker->Trajectory.U.at(MDSteps-1).x[j] = 0;
     461      Walker->Trajectory.F.at(MDSteps-1).x[j] = 0;
    536462    }
    537463    AddAtom(Walker);  // add to molecule
     
    548474molecule *molecule::CopyMolecule()
    549475{
    550   molecule *copy = World::getInstance().createMolecule();
     476  molecule *copy = new molecule(elemente);
    551477  atom *LeftAtom = NULL, *RightAtom = NULL;
    552478
     
    591517 */
    592518molecule* molecule::CopyMoleculeFromSubRegion(const Vector offset, const double *parallelepiped) const {
    593   molecule *copy = World::getInstance().createMolecule();
     519  molecule *copy = new molecule(elemente);
    594520
    595521  ActOnCopyWithEachAtomIfTrue ( &molecule::AddCopyAtom, copy, &atom::IsInParallelepiped, offset, parallelepiped );
     
    617543    add(Binder, last);
    618544  } else {
    619     DoeLog(1) && (eLog()<< Verbose(1) << "Could not add bond between " << atom1->getName() << " and " << atom2->getName() << " as one or both are not present in the molecule." << endl);
     545    DoeLog(1) && (eLog()<< Verbose(1) << "Could not add bond between " << atom1->Name << " and " << atom2->Name << " as one or both are not present in the molecule." << endl);
    620546  }
    621547  return Binder;
     
    677603void molecule::SetBoxDimension(Vector *dim)
    678604{
    679   double * const cell_size = World::getInstance().getDomain();
    680   cell_size[0] = dim->at(0);
     605  double * const cell_size = World::get()->cell_size;
     606  cell_size[0] = dim->x[0];
    681607  cell_size[1] = 0.;
    682   cell_size[2] = dim->at(1);
     608  cell_size[2] = dim->x[1];
    683609  cell_size[3] = 0.;
    684610  cell_size[4] = 0.;
    685   cell_size[5] = dim->at(2);
     611  cell_size[5] = dim->x[2];
    686612};
    687613
     
    696622    AtomCount--;
    697623  } else
    698     DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->getName() << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
     624    DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
    699625  if (ElementsInMolecule[pointer->type->Z] == 0)  // was last atom of this element?
    700626    ElementCount--;
     
    714640    ElementsInMolecule[pointer->type->Z]--; // decrease number of atom of this element
    715641  else
    716     DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->getName() << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
     642    DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
    717643  if (ElementsInMolecule[pointer->type->Z] == 0)  // was last atom of this element?
    718644    ElementCount--;
     
    768694bool molecule::CheckBounds(const Vector *x) const
    769695{
    770   double * const cell_size = World::getInstance().getDomain();
     696  double * const cell_size = World::get()->cell_size;
    771697  bool result = true;
    772698  int j =-1;
    773699  for (int i=0;i<NDIM;i++) {
    774700    j += i+1;
    775     result = result && ((x->at(i) >= 0) && (x->at(i) < cell_size[j]));
     701    result = result && ((x->x[i] >= 0) && (x->x[i] < cell_size[j]));
    776702  }
    777703  //return result;
     
    916842        if (Walker->type->Z != 1) // count non-hydrogen atoms whilst at it
    917843          NoNonHydrogen++;
    918         stringstream sstr;
    919         sstr << Walker->type->symbol << Walker->nr+1;
    920         Walker->setName(sstr.str());
    921         DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << Walker->nr << " " << Walker->getName() << "." << endl);
     844        Free(&Walker->Name);
     845        Walker->Name = Malloc<char>(6, "molecule::CountAtoms: *walker->Name");
     846        sprintf(Walker->Name, "%2s%02d", Walker->type->symbol, Walker->nr+1);
     847        DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << Walker->nr << " " << Walker->Name << "." << endl);
    922848        i++;
    923849      }
     
    1023949    DeterminePeriodicCenter(CenterOfGravity);
    1024950    OtherMolecule->DeterminePeriodicCenter(OtherCenterOfGravity);
    1025     DoLog(5) && (Log() << Verbose(5) << "Center of Gravity: " << CenterOfGravity << endl);
    1026     DoLog(5) && (Log() << Verbose(5) << "Other Center of Gravity: " << OtherCenterOfGravity << endl);
    1027     if (CenterOfGravity.DistanceSquared(OtherCenterOfGravity) > threshold*threshold) {
     951    DoLog(5) && (Log() << Verbose(5) << "Center of Gravity: ");
     952    CenterOfGravity.Output();
     953    DoLog(0) && (Log() << Verbose(0) << endl << Verbose(5) << "Other Center of Gravity: ");
     954    OtherCenterOfGravity.Output();
     955    DoLog(0) && (Log() << Verbose(0) << endl);
     956    if (CenterOfGravity.DistanceSquared(&OtherCenterOfGravity) > threshold*threshold) {
    1028957      DoLog(4) && (Log() << Verbose(4) << "Centers of gravity don't match." << endl);
    1029958      result = false;
     
    11561085  }
    11571086};
    1158 
    1159 void molecule::flipActiveFlag(){
    1160   ActiveFlag = !ActiveFlag;
    1161 }
Note: See TracChangeset for help on using the changeset viewer.