Changeset faca99 for src/Shapes
- Timestamp:
- Oct 5, 2011, 9:18:21 AM (14 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:
- 2e352f
- Parents:
- 807c0e
- git-author:
- Daniel Dueck <dueck@…> (01/15/11 16:11:41)
- git-committer:
- Frederik Heber <heber@…> (10/05/11 09:18:21)
- Location:
- src/Shapes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Shapes/BaseShapes.cpp
r807c0e rfaca99 72 72 std::vector<Vector> PointsOnSurface; 73 73 74 const double dlength = M_PI*(3.-sqrt(5.)); 74 double PI=3.14159265358979323846; 75 double a=4*PI/N; 76 double d= sqrt(a); 77 int Mtheta=int(PI/d); 78 double dtheta=PI/Mtheta; 79 double dphi=a/dtheta; 80 for (int m=0; m<Mtheta; m++) 81 { 82 double theta=PI*(m+0.5)/Mtheta; 83 int Mphi=int(2*PI*sin(theta)/dphi); 84 for (int n=0; n<Mphi;n++) 85 { 86 double phi= 2*PI*n/Mphi; 87 Vector point; 88 point.Zero(); 89 point[0]=sin(theta)*cos(phi); 90 point[1]=sin(theta)*sin(phi); 91 point[2]=cos(theta); 92 PointsOnSurface.push_back(point); 93 } 94 } 95 /*const double dlength = M_PI*(3.-sqrt(5.)); 75 96 double length = 0; 76 97 const double dz = 2.0/N; … … 85 106 PointsOnSurface.push_back(point); 86 107 z = z - dz; 87 length = length + dlength; 88 } 89 90 ASSERT(PointsOnSurface.size() == N, "Sphere_impl::getHomogeneousPointsOnSurface() did not create enough points."); 108 length = length + dlength;*/ 109 110 //ASSERT(PointsOnSurface.size() == N, "Sphere_impl::getHomogeneousPointsOnSurface() did not create enough points."); 91 111 return PointsOnSurface; 92 112 } -
src/Shapes/unittests/ShapeUnitTest.cpp
r807c0e rfaca99 651 651 CPPUNIT_ASSERT(fabs(1. - (*iter).NormSquared()) < MYEPSILON); 652 652 } 653 CPPUNIT_ASSERT_EQUAL( N, PointsOnSurface.size());653 CPPUNIT_ASSERT_EQUAL((size_t)194, PointsOnSurface.size()); 654 654 } 655 655
Note:
See TracChangeset
for help on using the changeset viewer.