Changeset 9879f6 for src/boundary.cpp
- Timestamp:
- Mar 5, 2010, 10:16:47 AM (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:
- d3347e
- Parents:
- e87acf
- git-author:
- Frederik Heber <heber@…> (03/05/10 10:08:44)
- git-committer:
- Frederik Heber <heber@…> (03/05/10 10:16:47)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/boundary.cpp
re87acf r9879f6 140 140 { 141 141 Info FunctionInfo(__func__); 142 atom *Walker = NULL;143 142 PointMap PointsOnBoundary; 144 143 LineMap LinesOnBoundary; … … 166 165 167 166 // 3b. construct set of all points, transformed into cylindrical system and with left and right neighbours 168 Walker = mol->start; 169 while (Walker->next != mol->end) { 170 Walker = Walker->next; 171 ProjectedVector.CopyVector(&Walker->x); 167 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 168 ProjectedVector.CopyVector(&(*iter)->x); 172 169 ProjectedVector.SubtractVector(MolCenter); 173 170 ProjectedVector.ProjectOntoPlane(&AxisVector); … … 184 181 angle = 2. * M_PI - angle; 185 182 } 186 Log() << Verbose(1) << "Inserting " << * Walker<< ": (r, alpha) = (" << radius << "," << angle << "): " << ProjectedVector << endl;187 BoundaryTestPair = BoundaryPoints[axis].insert(BoundariesPair(angle, DistancePair (radius, Walker)));183 Log() << Verbose(1) << "Inserting " << *(*iter) << ": (r, alpha) = (" << radius << "," << angle << "): " << ProjectedVector << endl; 184 BoundaryTestPair = BoundaryPoints[axis].insert(BoundariesPair(angle, DistancePair (radius, (*iter)))); 188 185 if (!BoundaryTestPair.second) { // same point exists, check first r, then distance of original vectors to center of gravity 189 186 Log() << Verbose(2) << "Encountered two vectors whose projection onto axis " << axis << " is equal: " << endl; 190 187 Log() << Verbose(2) << "Present vector: " << *BoundaryTestPair.first->second.second << endl; 191 Log() << Verbose(2) << "New vector: " << * Walker<< endl;188 Log() << Verbose(2) << "New vector: " << *(*iter) << endl; 192 189 const double ProjectedVectorNorm = ProjectedVector.NormSquared(); 193 190 if ((ProjectedVectorNorm - BoundaryTestPair.first->second.first) > MYEPSILON) { 194 191 BoundaryTestPair.first->second.first = ProjectedVectorNorm; 195 BoundaryTestPair.first->second.second = Walker;192 BoundaryTestPair.first->second.second = (*iter); 196 193 Log() << Verbose(2) << "Keeping new vector due to larger projected distance " << ProjectedVectorNorm << "." << endl; 197 194 } else if (fabs(ProjectedVectorNorm - BoundaryTestPair.first->second.first) < MYEPSILON) { 198 helper.CopyVector(& Walker->x);195 helper.CopyVector(&(*iter)->x); 199 196 helper.SubtractVector(MolCenter); 200 197 const double oldhelperNorm = helper.NormSquared(); … … 202 199 helper.SubtractVector(MolCenter); 203 200 if (helper.NormSquared() < oldhelperNorm) { 204 BoundaryTestPair.first->second.second = Walker;201 BoundaryTestPair.first->second.second = (*iter); 205 202 Log() << Verbose(2) << "Keeping new vector due to larger distance to molecule center " << helper.NormSquared() << "." << endl; 206 203 } else { … … 705 702 int repetition[NDIM] = { 1, 1, 1 }; 706 703 int TotalNoClusters = 1; 707 atom *Walker = NULL;708 704 double totalmass = 0.; 709 705 double clustervolume = 0.; … … 729 725 730 726 // sum up the atomic masses 731 Walker = mol->start; 732 while (Walker->next != mol->end) { 733 Walker = Walker->next; 734 totalmass += Walker->type->mass; 727 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 728 totalmass += (*iter)->type->mass; 735 729 } 736 730 Log() << Verbose(0) << "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit." << endl; … … 811 805 Vector FillerDistance; 812 806 double FillIt = false; 813 atom *Walker = NULL;814 807 bond *Binder = NULL; 815 808 int i = 0; … … 884 877 885 878 // go through all atoms 886 Walker = filler->start; 887 while (Walker->next != filler->end) { 888 Walker = Walker->next; 879 for (molecule::const_iterator iter = filler->begin(); iter != filler->end(); ++iter) { 889 880 // copy atom ... 890 CopyAtoms[ Walker->nr] = Walker->clone();881 CopyAtoms[(*iter)->nr] = (*iter)->clone(); 891 882 892 883 // create atomic random translation vector ... … … 913 904 // ... and put at new position 914 905 if (DoRandomRotation) 915 CopyAtoms[ Walker->nr]->x.MatrixMultiplication(Rotations);916 CopyAtoms[ Walker->nr]->x.AddVector(&AtomTranslations);917 CopyAtoms[ Walker->nr]->x.AddVector(&FillerTranslations);918 CopyAtoms[ Walker->nr]->x.AddVector(&CurrentPosition);906 CopyAtoms[(*iter)->nr]->x.MatrixMultiplication(Rotations); 907 CopyAtoms[(*iter)->nr]->x.AddVector(&AtomTranslations); 908 CopyAtoms[(*iter)->nr]->x.AddVector(&FillerTranslations); 909 CopyAtoms[(*iter)->nr]->x.AddVector(&CurrentPosition); 919 910 920 911 // insert into Filling 921 912 922 913 // FIXME: gives completely different results if CopyAtoms[..] used instead of Walker, why??? 923 Log() << Verbose(4) << "Filling atom " << * Walker << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[Walker->nr]->x) << "." << endl;924 Filling->AddAtom(CopyAtoms[ Walker->nr]);914 Log() << Verbose(4) << "Filling atom " << *(*iter) << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[(*iter)->nr]->x) << "." << endl; 915 Filling->AddAtom(CopyAtoms[(*iter)->nr]); 925 916 } 926 917 … … 1036 1027 // // look whether all points are inside of the convex envelope, otherwise add them via degenerated triangles 1037 1028 // //->InsertStraddlingPoints(mol, LCList); 1038 // mol->GoToFirst();1029 // for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1039 1030 // class TesselPoint *Runner = NULL; 1040 // while (!mol->IsEnd()) { 1041 // Runner = mol->GetPoint(); 1031 // Runner = *iter; 1042 1032 // Log() << Verbose(1) << "Checking on " << Runner->Name << " ... " << endl; 1043 1033 // if (!->IsInnerPoint(Runner, LCList)) { … … 1047 1037 // Log() << Verbose(2) << Runner->Name << " is inside of or on envelope." << endl; 1048 1038 // } 1049 // mol->GoToNext();1050 1039 // } 1051 1040
Note:
See TracChangeset
for help on using the changeset viewer.