Changeset 8f4df1 for src/boundary.cpp
- Timestamp:
- Aug 7, 2010, 12:07:04 PM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 2d292d
- Parents:
- 8d6d31 (diff), d74077 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/boundary.cpp
r8d6d31 r8f4df1 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" 9 14 #include "World.hpp" 10 15 #include "atom.hpp" … … 87 92 if (Neighbour == BoundaryPoints[axis].end()) // make it wrap around 88 93 Neighbour = BoundaryPoints[axis].begin(); 89 DistanceVector = runner->second.second->x - Neighbour->second.second->x;94 DistanceVector = (runner->second.second->getPosition()) - (Neighbour->second.second->getPosition()); 90 95 do { // seek for neighbour pair where it flips 91 96 OldComponent = DistanceVector[Othercomponent]; … … 93 98 if (Neighbour == BoundaryPoints[axis].end()) // make it wrap around 94 99 Neighbour = BoundaryPoints[axis].begin(); 95 DistanceVector = runner->second.second->x - Neighbour->second.second->x;100 DistanceVector = (runner->second.second->getPosition()) - (Neighbour->second.second->getPosition()); 96 101 //Log() << Verbose(2) << "OldComponent is " << OldComponent << ", new one is " << DistanceVector.x[Othercomponent] << "." << endl; 97 102 } while ((runner != Neighbour) && (fabs(OldComponent / fabs( … … 105 110 //Log() << Verbose(1) << "The pair, where the sign of OtherComponent flips, is: " << *(Neighbour->second.second) << " and " << *(OtherNeighbour->second.second) << "." << endl; 106 111 // now we have found the pair: Neighbour and OtherNeighbour 107 OtherVector = runner->second.second->x - OtherNeighbour->second.second->x;112 OtherVector = (runner->second.second->getPosition()) - (OtherNeighbour->second.second->getPosition()); 108 113 //Log() << Verbose(1) << "Distances to Neighbour and OtherNeighbour are " << DistanceVector.x[component] << " and " << OtherVector.x[component] << "." << endl; 109 114 //Log() << Verbose(1) << "OtherComponents to Neighbour and OtherNeighbour are " << DistanceVector.x[Othercomponent] << " and " << OtherVector.x[Othercomponent] << "." << endl; … … 173 178 // 3b. construct set of all points, transformed into cylindrical system and with left and right neighbours 174 179 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 175 ProjectedVector = (*iter)-> x- (*MolCenter);180 ProjectedVector = (*iter)->getPosition() - (*MolCenter); 176 181 ProjectedVector.ProjectOntoPlane(AxisVector); 177 182 … … 199 204 DoLog(2) && (Log() << Verbose(2) << "Keeping new vector due to larger projected distance " << ProjectedVectorNorm << "." << endl); 200 205 } else if (fabs(ProjectedVectorNorm - BoundaryTestPair.first->second.first) < MYEPSILON) { 201 helper = (*iter)->x; 202 helper -= *MolCenter; 206 helper = (*iter)->getPosition() - (*MolCenter); 203 207 const double oldhelperNorm = helper.NormSquared(); 204 helper = BoundaryTestPair.first->second.second-> x- (*MolCenter);208 helper = BoundaryTestPair.first->second.second->getPosition() - (*MolCenter); 205 209 if (helper.NormSquared() < oldhelperNorm) { 206 210 BoundaryTestPair.first->second.second = (*iter); … … 255 259 { 256 260 Vector SideA, SideB, SideC, SideH; 257 SideA = left->second.second-> x- (*MolCenter);261 SideA = left->second.second->getPosition() - (*MolCenter); 258 262 SideA.ProjectOntoPlane(AxisVector); 259 263 // Log() << Verbose(1) << "SideA: " << SideA << endl; 260 264 261 SideB = right->second.second-> x-(*MolCenter);265 SideB = right->second.second->getPosition() -(*MolCenter); 262 266 SideB.ProjectOntoPlane(AxisVector); 263 267 // Log() << Verbose(1) << "SideB: " << SideB << endl; 264 268 265 SideC = left->second.second-> x - right->second.second->x;269 SideC = left->second.second->getPosition() - right->second.second->getPosition(); 266 270 SideC.ProjectOntoPlane(AxisVector); 267 271 // Log() << Verbose(1) << "SideC: " << SideC << endl; 268 272 269 SideH = runner->second.second-> x-(*MolCenter);273 SideH = runner->second.second->getPosition() -(*MolCenter); 270 274 SideH.ProjectOntoPlane(AxisVector); 271 275 // Log() << Verbose(1) << "SideH: " << SideH << endl; … … 701 705 // sum up the atomic masses 702 706 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 703 totalmass += (*iter)-> type->mass;707 totalmass += (*iter)->getType()->mass; 704 708 } 705 709 DoLog(0) && (Log() << Verbose(0) << "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit." << endl); … … 857 861 858 862 // ... and put at new position 859 Inserter = (*iter)-> x;863 Inserter = (*iter)->getPosition(); 860 864 if (DoRandomRotation) 861 865 Inserter *= Rotations; … … 882 886 // copy atom ... 883 887 CopyAtoms[(*iter)->nr] = (*iter)->clone(); 884 CopyAtoms[(*iter)->nr]->x = Inserter;888 (*CopyAtoms[(*iter)->nr]).setPosition(Inserter); 885 889 Filling->AddAtom(CopyAtoms[(*iter)->nr]); 886 DoLog( 4) && (Log() << Verbose(4) << "Filling atom " << **iter << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[(*iter)->nr]->x) << "." << endl);890 DoLog(1) && (Log() << Verbose(1) << "Filling atom " << **iter << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[(*iter)->nr]->getPosition()) << "." << endl); 887 891 } else { 888 892 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.