Changes in src/boundary.cpp [1883f9:6e5084]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/boundary.cpp
r1883f9 r6e5084 7 7 8 8 #include "Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp" 9 #include "BoundaryPointSet.hpp"10 #include "BoundaryLineSet.hpp"11 #include "BoundaryTriangleSet.hpp"12 #include "CandidateForTesselation.hpp"13 //#include "TesselPoint.hpp"14 9 #include "World.hpp" 15 10 #include "atom.hpp" … … 92 87 if (Neighbour == BoundaryPoints[axis].end()) // make it wrap around 93 88 Neighbour = BoundaryPoints[axis].begin(); 94 DistanceVector = (runner->second.second->getPosition()) - (Neighbour->second.second->getPosition());89 DistanceVector = runner->second.second->x - Neighbour->second.second->x; 95 90 do { // seek for neighbour pair where it flips 96 91 OldComponent = DistanceVector[Othercomponent]; … … 98 93 if (Neighbour == BoundaryPoints[axis].end()) // make it wrap around 99 94 Neighbour = BoundaryPoints[axis].begin(); 100 DistanceVector = (runner->second.second->getPosition()) - (Neighbour->second.second->getPosition());95 DistanceVector = runner->second.second->x - Neighbour->second.second->x; 101 96 //Log() << Verbose(2) << "OldComponent is " << OldComponent << ", new one is " << DistanceVector.x[Othercomponent] << "." << endl; 102 97 } while ((runner != Neighbour) && (fabs(OldComponent / fabs( … … 110 105 //Log() << Verbose(1) << "The pair, where the sign of OtherComponent flips, is: " << *(Neighbour->second.second) << " and " << *(OtherNeighbour->second.second) << "." << endl; 111 106 // now we have found the pair: Neighbour and OtherNeighbour 112 OtherVector = (runner->second.second->getPosition()) - (OtherNeighbour->second.second->getPosition());107 OtherVector = runner->second.second->x - OtherNeighbour->second.second->x; 113 108 //Log() << Verbose(1) << "Distances to Neighbour and OtherNeighbour are " << DistanceVector.x[component] << " and " << OtherVector.x[component] << "." << endl; 114 109 //Log() << Verbose(1) << "OtherComponents to Neighbour and OtherNeighbour are " << DistanceVector.x[Othercomponent] << " and " << OtherVector.x[Othercomponent] << "." << endl; … … 178 173 // 3b. construct set of all points, transformed into cylindrical system and with left and right neighbours 179 174 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 180 ProjectedVector = (*iter)-> getPosition()- (*MolCenter);175 ProjectedVector = (*iter)->x - (*MolCenter); 181 176 ProjectedVector.ProjectOntoPlane(AxisVector); 182 177 … … 204 199 DoLog(2) && (Log() << Verbose(2) << "Keeping new vector due to larger projected distance " << ProjectedVectorNorm << "." << endl); 205 200 } else if (fabs(ProjectedVectorNorm - BoundaryTestPair.first->second.first) < MYEPSILON) { 206 helper = (*iter)->getPosition() - (*MolCenter); 201 helper = (*iter)->x; 202 helper -= *MolCenter; 207 203 const double oldhelperNorm = helper.NormSquared(); 208 helper = BoundaryTestPair.first->second.second-> getPosition()- (*MolCenter);204 helper = BoundaryTestPair.first->second.second->x - (*MolCenter); 209 205 if (helper.NormSquared() < oldhelperNorm) { 210 206 BoundaryTestPair.first->second.second = (*iter); … … 259 255 { 260 256 Vector SideA, SideB, SideC, SideH; 261 SideA = left->second.second-> getPosition()- (*MolCenter);257 SideA = left->second.second->x - (*MolCenter); 262 258 SideA.ProjectOntoPlane(AxisVector); 263 259 // Log() << Verbose(1) << "SideA: " << SideA << endl; 264 260 265 SideB = right->second.second-> getPosition()-(*MolCenter);261 SideB = right->second.second->x -(*MolCenter); 266 262 SideB.ProjectOntoPlane(AxisVector); 267 263 // Log() << Verbose(1) << "SideB: " << SideB << endl; 268 264 269 SideC = left->second.second-> getPosition() - right->second.second->getPosition();265 SideC = left->second.second->x - right->second.second->x; 270 266 SideC.ProjectOntoPlane(AxisVector); 271 267 // Log() << Verbose(1) << "SideC: " << SideC << endl; 272 268 273 SideH = runner->second.second-> getPosition()-(*MolCenter);269 SideH = runner->second.second->x -(*MolCenter); 274 270 SideH.ProjectOntoPlane(AxisVector); 275 271 // Log() << Verbose(1) << "SideH: " << SideH << endl; … … 705 701 // sum up the atomic masses 706 702 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 707 totalmass += (*iter)-> getType()->mass;703 totalmass += (*iter)->type->mass; 708 704 } 709 705 DoLog(0) && (Log() << Verbose(0) << "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit." << endl); … … 804 800 // Center filler at origin 805 801 filler->CenterEdge(&Inserter); 802 filler->Center.Zero(); 806 803 const int FillerCount = filler->getAtomCount(); 807 804 DoLog(2) && (Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl); … … 860 857 861 858 // ... and put at new position 862 Inserter = (*iter)-> getPosition();859 Inserter = (*iter)->x; 863 860 if (DoRandomRotation) 864 861 Inserter *= Rotations; … … 885 882 // copy atom ... 886 883 CopyAtoms[(*iter)->nr] = (*iter)->clone(); 887 (*CopyAtoms[(*iter)->nr]).setPosition(Inserter);884 CopyAtoms[(*iter)->nr]->x = Inserter; 888 885 Filling->AddAtom(CopyAtoms[(*iter)->nr]); 889 DoLog( 1) && (Log() << Verbose(1) << "Filling atom " << **iter << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[(*iter)->nr]->getPosition()) << "." << endl);886 DoLog(4) && (Log() << Verbose(4) << "Filling atom " << **iter << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[(*iter)->nr]->x) << "." << endl); 890 887 } else { 891 888 DoLog(1) && (Log() << Verbose(1) << "INFO: Position at " << Inserter << " is inner point, within boundary or outside of MaxDistance." << endl);
Note:
See TracChangeset
for help on using the changeset viewer.