Changeset 833b15 for src/Tesselation/boundary.cpp
- Timestamp:
- Sep 9, 2014, 7:42:32 PM (11 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:
- a090e3
- Parents:
- 2d701e
- git-author:
- Frederik Heber <heber@…> (09/01/14 15:54:02)
- git-committer:
- Frederik Heber <heber@…> (09/09/14 19:42:32)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tesselation/boundary.cpp
r2d701e r833b15 183 183 LineMap LinesOnBoundary; 184 184 TriangleMap TrianglesOnBoundary; 185 Vector *MolCenter = mol->DetermineCenterOfAll();185 Vector MolCenter = mol->DetermineCenterOfAll(); 186 186 Vector helper; 187 187 BoundariesTestPair BoundaryTestPair; … … 207 207 // Boundaries stores non-const TesselPoint ref, hence we need iterator here 208 208 for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) { 209 ProjectedVector = (*iter)->getPosition() - ( *MolCenter);209 ProjectedVector = (*iter)->getPosition() - (MolCenter); 210 210 ProjectedVector.ProjectOntoPlane(AxisVector); 211 211 … … 233 233 LOG(2, "Keeping new vector due to larger projected distance " << ProjectedVectorNorm << "."); 234 234 } else if (fabs(ProjectedVectorNorm - BoundaryTestPair.first->second.first) < MYEPSILON) { 235 helper = (*iter)->getPosition() - ( *MolCenter);235 helper = (*iter)->getPosition() - (MolCenter); 236 236 const double oldhelperNorm = helper.NormSquared(); 237 helper = BoundaryTestPair.first->second.second->getPosition() - ( *MolCenter);237 helper = BoundaryTestPair.first->second.second->getPosition() - (MolCenter); 238 238 if (helper.NormSquared() < oldhelperNorm) { 239 239 BoundaryTestPair.first->second.second = (*iter); … … 289 289 { 290 290 Vector SideA, SideB, SideC, SideH; 291 SideA = left->second.second->getPosition() - ( *MolCenter);291 SideA = left->second.second->getPosition() - (MolCenter); 292 292 SideA.ProjectOntoPlane(AxisVector); 293 293 // LOG(1, "SideA: " << SideA); 294 294 295 SideB = right->second.second->getPosition() -( *MolCenter);295 SideB = right->second.second->getPosition() -(MolCenter); 296 296 SideB.ProjectOntoPlane(AxisVector); 297 297 // LOG(1, "SideB: " << SideB); … … 301 301 // LOG(1, "SideC: " << SideC); 302 302 303 SideH = runner->second.second->getPosition() -( *MolCenter);303 SideH = runner->second.second->getPosition() -(MolCenter); 304 304 SideH.ProjectOntoPlane(AxisVector); 305 305 // LOG(1, "SideH: " << SideH); … … 329 329 } while (flag); 330 330 } 331 delete(MolCenter);332 331 return BoundaryPoints; 333 332 }; … … 726 725 for (int i = 0; i < NDIM; i++) 727 726 BoxLengths[i] = GreatestDiameter[i]; 728 mol->CenterEdge( &BoxLengths);727 mol->CenterEdge(); 729 728 } else { 730 729 BoxLengths[0] = (repetition[0] * GreatestDiameter[0] + repetition[1] * GreatestDiameter[1] + repetition[2] * GreatestDiameter[2]); … … 749 748 // set new box dimensions 750 749 LOG(0, "Translating to box with these boundaries."); 751 mol->SetBoxDimension(&BoxLengths); 750 { 751 RealSpaceMatrix domain; 752 for(int i =0; i<NDIM;++i) 753 domain.at(i,i) = BoxLengths[i]; 754 World::getInstance().setDomain(domain); 755 } 752 756 mol->CenterInBox(); 753 757 } 754 758 delete[] GreatestDiameter; 755 759 // update Box of atoms by boundary 756 mol->SetBoxDimension(&BoxLengths); 760 { 761 RealSpaceMatrix domain; 762 for(int i =0; i<NDIM;++i) 763 domain.at(i,i) = BoxLengths[i]; 764 World::getInstance().setDomain(domain); 765 } 757 766 LOG(0, "RESULT: The resulting cell dimensions are: " << BoxLengths[0] << " and " << BoxLengths[1] << " and " << BoxLengths[2] << " with total volume of " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3."); 758 767 }; … … 804 813 805 814 // Center filler at origin 806 filler->CenterEdge( &Inserter);815 filler->CenterEdge(); 807 816 const int FillerCount = filler->getAtomCount(); 808 817 LOG(2, "INFO: Filler molecule has the following bonds:"); … … 1099 1108 1100 1109 // Center filler at its center of gravity 1101 Vector *gravity = filler->DetermineCenterOfGravity();1110 const Vector gravity = filler->DetermineCenterOfGravity(); 1102 1111 filler->CenterAtVector(gravity); 1103 delete gravity;1104 1112 //const int FillerCount = filler->getAtomCount(); 1105 1113 LOG(2, "INFO: Filler molecule has the following bonds:"); … … 1165 1173 RandomizeMoleculePositions(Filling, RandomAtomDisplacement, Rotations, random); 1166 1174 // translation 1167 Filling->Translate( &Inserter);1175 Filling->Translate(Inserter); 1168 1176 // remove out-of-bounds atoms 1169 1177 const bool status = RemoveAtomsOutsideDomain(Filling); … … 1203 1211 RandomizeMoleculePositions(filler, RandomAtomDisplacement, Rotations, random); 1204 1212 // translation 1205 filler->Translate( &firstInserter);1213 filler->Translate(firstInserter); 1206 1214 // remove out-of-bounds atoms 1207 1215 RemoveAtomsOutsideDomain(filler); … … 1277 1285 1278 1286 // Center filler at origin 1279 filler->CenterEdge( &Inserter);1287 filler->CenterEdge(); 1280 1288 // const int FillerCount = filler->getAtomCount(); 1281 1289 LOG(2, "INFO: Filler molecule has the following bonds:"); … … 1378 1386 RandomizeMoleculePositions(Filling, RandomAtomDisplacement, Rotations, random); 1379 1387 // translation 1380 Filling->Translate( &Inserter);1388 Filling->Translate(Inserter); 1381 1389 // remove out-of-bounds atoms 1382 1390 const bool status = RemoveAtomsOutsideDomain(Filling); … … 1416 1424 RandomizeMoleculePositions(filler, RandomAtomDisplacement, Rotations, random); 1417 1425 // translation 1418 filler->Translate( &firstInserter);1426 filler->Translate(firstInserter); 1419 1427 // remove out-of-bounds atoms 1420 1428 RemoveAtomsOutsideDomain(filler);
Note:
See TracChangeset
for help on using the changeset viewer.