Changes in src/molecule.cpp [68f03d:a67d19]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule.cpp
r68f03d ra67d19 6 6 7 7 #include <cstring> 8 #include <boost/bind.hpp> 9 10 #include "World.hpp" 8 11 9 #include "atom.hpp" 12 10 #include "bond.hpp" … … 26 24 #include "vector.hpp" 27 25 #include "World.hpp" 28 #include "Plane.hpp"29 #include "Exceptions/LinearDependenceException.hpp"30 31 26 32 27 /************************************* Functions for class molecule *********************************/ … … 35 30 * Initialises molecule list with correctly referenced start and end, and sets molecule::last_atom to zero. 36 31 */ 37 molecule::molecule(const periodentafel * const teil) : elemente(teil), start( World::getInstance().createAtom()), end(World::getInstance().createAtom()),32 molecule::molecule(const periodentafel * const teil) : elemente(teil), start(new atom), end(new atom), 38 33 first(new bond(start, end, 1, -1)), last(new bond(start, end, 1, -1)), MDSteps(0), AtomCount(0), 39 34 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) 44 36 { 45 37 // init atom chain list … … 54 46 for(int i=MAX_ELEMENTS;i--;) 55 47 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 }; 62 50 63 51 /** Destructor of class molecule. … … 69 57 delete(first); 70 58 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 }; 116 62 117 63 … … 123 69 bool molecule::AddAtom(atom *pointer) 124 70 { 125 bool retval = false;126 OBSERVE;127 71 if (pointer != NULL) { 128 72 pointer->sort = &pointer->nr; … … 135 79 if (pointer->type->Z != 1) 136 80 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 ret val =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; 146 90 }; 147 91 … … 153 97 atom * molecule::AddCopyAtom(atom *pointer) 154 98 { 155 atom *retval = NULL;156 OBSERVE;157 99 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); 162 103 walker->nr = last_atom++; // increase number within molecule 163 104 add(walker, end); … … 165 106 NoNonHydrogen++; 166 107 AtomCount++; 167 ret val=walker;168 } 169 return retval;108 return walker; 109 } else 110 return NULL; 170 111 }; 171 112 … … 206 147 bool molecule::AddHydrogenReplacementAtom(bond *TopBond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bool IsAngstroem) 207 148 { 208 bool AllWentWell = true; // flag gathering the boolean return value of molecule::AddAtom and other functions, as return value on exit209 OBSERVE;210 149 double bondlength; // bond length of the bond to be replaced/cut 211 150 double bondangle; // bond angle of the bond to be replaced/cut 212 151 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 213 153 bond *FirstBond = NULL, *SecondBond = NULL; // Other bonds in double bond case to determine "other" plane 214 154 atom *FirstOtherAtom = NULL, *SecondOtherAtom = NULL, *ThirdOtherAtom = NULL; // pointer to hydrogen atoms to be added … … 218 158 double *matrix = NULL; 219 159 bond *Binder = NULL; 220 double * const cell_size = World::get Instance().getDomain();160 double * const cell_size = World::get()->cell_size; 221 161 222 162 // Log() << Verbose(3) << "Begin of AddHydrogenReplacementAtom." << endl; 223 163 // create vector in direction of bond 224 InBondvector = TopReplacement->x - TopOrigin->x; 164 InBondvector.CopyVector(&TopReplacement->x); 165 InBondvector.SubtractVector(&TopOrigin->x); 225 166 bondlength = InBondvector.Norm(); 226 167 … … 234 175 Orthovector1.Zero(); 235 176 for (int i=NDIM;i--;) { 236 l = TopReplacement->x [i] - TopOrigin->x[i];177 l = TopReplacement->x.x[i] - TopOrigin->x.x[i]; 237 178 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.; 239 180 } // (signs are correct, was tested!) 240 181 } 241 182 matrix = ReturnFullMatrixforSymmetric(cell_size); 242 183 Orthovector1.MatrixMultiplication(matrix); 243 InBondvector -= Orthovector1; // subtract just the additional translation184 InBondvector.SubtractVector(&Orthovector1); // subtract just the additional translation 244 185 Free(&matrix); 245 186 bondlength = InBondvector.Norm(); … … 253 194 BondRescale = TopOrigin->type->HBondDistance[TopBond->BondDegree-1]; 254 195 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); 256 197 return false; 257 198 BondRescale = bondlength; … … 264 205 switch(TopBond->BondDegree) { 265 206 case 1: 266 FirstOtherAtom = World::getInstance().createAtom(); // new atom207 FirstOtherAtom = new atom(); // new atom 267 208 FirstOtherAtom->type = elemente->FindElement(1); // element is Hydrogen 268 FirstOtherAtom->v = TopReplacement->v; // copy velocity209 FirstOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity 269 210 FirstOtherAtom->FixedIon = TopReplacement->FixedIon; 270 211 if (TopReplacement->type->Z == 1) { // neither rescale nor replace if it's already hydrogen … … 274 215 FirstOtherAtom->father = NULL; // if we replace hydrogen, we mark it as our father, otherwise we are just an added hydrogen with no father 275 216 } 276 InBondvector *= BondRescale; // rescale the distance vector to Hydrogen bond length277 FirstOtherAtom->x = TopOrigin->x; // set coordination to origin ...278 FirstOtherAtom->x = InBondvector; // ... and add distance vector to replacement atom217 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 279 220 AllWentWell = AllWentWell && AddAtom(FirstOtherAtom); 280 221 // Log() << Verbose(4) << "Added " << *FirstOtherAtom << " at: "; … … 296 237 SecondOtherAtom = (*Runner)->GetOtherAtom(TopOrigin); 297 238 } 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); 299 240 } 300 241 } … … 308 249 309 250 // 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); 318 252 } else { 319 Orthovector1.GetOneNormalVector( InBondvector);253 Orthovector1.GetOneNormalVector(&InBondvector); 320 254 } 321 255 //Log() << Verbose(3)<< "Orthovector1: "; … … 323 257 //Log() << Verbose(0) << endl; 324 258 // orthogonal vector and bond vector between origin and replacement form the new plane 325 Orthovector1.MakeNormal To(InBondvector);259 Orthovector1.MakeNormalVector(&InBondvector); 326 260 Orthovector1.Normalize(); 327 261 //Log() << Verbose(3) << "ReScaleCheck: " << Orthovector1.Norm() << " and " << InBondvector.Norm() << "." << endl; 328 262 329 263 // create the two Hydrogens ... 330 FirstOtherAtom = World::getInstance().createAtom();331 SecondOtherAtom = World::getInstance().createAtom();264 FirstOtherAtom = new atom(); 265 SecondOtherAtom = new atom(); 332 266 FirstOtherAtom->type = elemente->FindElement(1); 333 267 SecondOtherAtom->type = elemente->FindElement(1); 334 FirstOtherAtom->v = TopReplacement->v; // copy velocity268 FirstOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity 335 269 FirstOtherAtom->FixedIon = TopReplacement->FixedIon; 336 SecondOtherAtom->v = TopReplacement->v; // copy velocity270 SecondOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity 337 271 SecondOtherAtom->FixedIon = TopReplacement->FixedIon; 338 272 FirstOtherAtom->father = NULL; // we are just an added hydrogen with no father … … 340 274 bondangle = TopOrigin->type->HBondAngle[1]; 341 275 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); 343 277 return false; 344 278 bondangle = 0; … … 355 289 SecondOtherAtom->x.Zero(); 356 290 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 BondDistance361 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); 362 296 //Log() << Verbose(3) << "ReScaleCheck: " << FirstOtherAtom->x.Norm() << " and " << SecondOtherAtom->x.Norm() << "." << endl; 363 297 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]; 366 300 } 367 301 // ... and add to molecule … … 383 317 case 3: 384 318 // 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(); 388 322 FirstOtherAtom->type = elemente->FindElement(1); 389 323 SecondOtherAtom->type = elemente->FindElement(1); 390 324 ThirdOtherAtom->type = elemente->FindElement(1); 391 FirstOtherAtom->v = TopReplacement->v; // copy velocity325 FirstOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity 392 326 FirstOtherAtom->FixedIon = TopReplacement->FixedIon; 393 SecondOtherAtom->v = TopReplacement->v; // copy velocity327 SecondOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity 394 328 SecondOtherAtom->FixedIon = TopReplacement->FixedIon; 395 ThirdOtherAtom->v = TopReplacement->v; // copy velocity329 ThirdOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity 396 330 ThirdOtherAtom->FixedIon = TopReplacement->FixedIon; 397 331 FirstOtherAtom->father = NULL; // we are just an added hydrogen with no father … … 400 334 401 335 // we need to vectors orthonormal the InBondvector 402 AllWentWell = AllWentWell && Orthovector1.GetOneNormalVector( InBondvector);336 AllWentWell = AllWentWell && Orthovector1.GetOneNormalVector(&InBondvector); 403 337 // Log() << Verbose(3) << "Orthovector1: "; 404 338 // Orthovector1.Output(out); 405 339 // 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); 413 341 // Log() << Verbose(3) << "Orthovector2: "; 414 342 // Orthovector2.Output(out); … … 427 355 factors[1] = f; 428 356 factors[2] = 0.; 429 FirstOtherAtom->x.LinearCombinationOfVectors( InBondvector, Orthovector1,Orthovector2, factors);357 FirstOtherAtom->x.LinearCombinationOfVectors(&InBondvector, &Orthovector1, &Orthovector2, factors); 430 358 factors[1] = -0.5*f; 431 359 factors[2] = g; 432 SecondOtherAtom->x.LinearCombinationOfVectors( InBondvector, Orthovector1,Orthovector2, factors);360 SecondOtherAtom->x.LinearCombinationOfVectors(&InBondvector, &Orthovector1, &Orthovector2, factors); 433 361 factors[2] = -g; 434 ThirdOtherAtom->x.LinearCombinationOfVectors( InBondvector, Orthovector1,Orthovector2, factors);362 ThirdOtherAtom->x.LinearCombinationOfVectors(&InBondvector, &Orthovector1, &Orthovector2, factors); 435 363 436 364 // rescale each to correct BondDistance … … 440 368 441 369 // 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); 445 373 446 374 // ... and add to molecule … … 485 413 bool molecule::AddXYZFile(string filename) 486 414 { 487 488 415 istringstream *input = NULL; 489 416 int NumberOfAtoms = 0; // atom number in xyz read … … 499 426 return false; 500 427 501 OBSERVE;502 428 getline(xyzfile,line,'\n'); // Read numer of atoms in file 503 429 input = new istringstream(line); … … 510 436 MDSteps++; 511 437 for(i=0;i<NumberOfAtoms;i++){ 512 Walker = World::getInstance().createAtom();438 Walker = new atom; 513 439 getline(xyzfile,line,'\n'); 514 440 istringstream *item = new istringstream(line); … … 530 456 } 531 457 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; 536 462 } 537 463 AddAtom(Walker); // add to molecule … … 548 474 molecule *molecule::CopyMolecule() 549 475 { 550 molecule *copy = World::getInstance().createMolecule();476 molecule *copy = new molecule(elemente); 551 477 atom *LeftAtom = NULL, *RightAtom = NULL; 552 478 … … 591 517 */ 592 518 molecule* molecule::CopyMoleculeFromSubRegion(const Vector offset, const double *parallelepiped) const { 593 molecule *copy = World::getInstance().createMolecule();519 molecule *copy = new molecule(elemente); 594 520 595 521 ActOnCopyWithEachAtomIfTrue ( &molecule::AddCopyAtom, copy, &atom::IsInParallelepiped, offset, parallelepiped ); … … 617 543 add(Binder, last); 618 544 } 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); 620 546 } 621 547 return Binder; … … 677 603 void molecule::SetBoxDimension(Vector *dim) 678 604 { 679 double * const cell_size = World::get Instance().getDomain();680 cell_size[0] = dim-> at(0);605 double * const cell_size = World::get()->cell_size; 606 cell_size[0] = dim->x[0]; 681 607 cell_size[1] = 0.; 682 cell_size[2] = dim-> at(1);608 cell_size[2] = dim->x[1]; 683 609 cell_size[3] = 0.; 684 610 cell_size[4] = 0.; 685 cell_size[5] = dim-> at(2);611 cell_size[5] = dim->x[2]; 686 612 }; 687 613 … … 696 622 AtomCount--; 697 623 } 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); 699 625 if (ElementsInMolecule[pointer->type->Z] == 0) // was last atom of this element? 700 626 ElementCount--; … … 714 640 ElementsInMolecule[pointer->type->Z]--; // decrease number of atom of this element 715 641 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); 717 643 if (ElementsInMolecule[pointer->type->Z] == 0) // was last atom of this element? 718 644 ElementCount--; … … 768 694 bool molecule::CheckBounds(const Vector *x) const 769 695 { 770 double * const cell_size = World::get Instance().getDomain();696 double * const cell_size = World::get()->cell_size; 771 697 bool result = true; 772 698 int j =-1; 773 699 for (int i=0;i<NDIM;i++) { 774 700 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])); 776 702 } 777 703 //return result; … … 916 842 if (Walker->type->Z != 1) // count non-hydrogen atoms whilst at it 917 843 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); 922 848 i++; 923 849 } … … 1023 949 DeterminePeriodicCenter(CenterOfGravity); 1024 950 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) { 1028 957 DoLog(4) && (Log() << Verbose(4) << "Centers of gravity don't match." << endl); 1029 958 result = false; … … 1156 1085 } 1157 1086 }; 1158 1159 void molecule::flipActiveFlag(){1160 ActiveFlag = !ActiveFlag;1161 }
Note:
See TracChangeset
for help on using the changeset viewer.