Changeset faca99 for src/Shapes


Ignore:
Timestamp:
Oct 5, 2011, 9:18:21 AM (14 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

MoleculeAction create-micelle: code updated; Baseshapes: procedure getHomogeneousPointsonSurface updated

Changed in rebase onto v1.1.3:

  • replaced parser instantiations by getter to FormatParserStorage and World.
  • removed doubly present loop over count (creates 1942 points).
  • We create now less than desired points, Unit tests checks for 194 instead of originally 200 points.
Location:
src/Shapes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Shapes/BaseShapes.cpp

    r807c0e rfaca99  
    7272  std::vector<Vector> PointsOnSurface;
    7373
    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.));
    7596  double length = 0;
    7697  const double dz = 2.0/N;
     
    85106    PointsOnSurface.push_back(point);
    86107    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.");
    91111  return PointsOnSurface;
    92112}
  • src/Shapes/unittests/ShapeUnitTest.cpp

    r807c0e rfaca99  
    651651    CPPUNIT_ASSERT(fabs(1. - (*iter).NormSquared()) < MYEPSILON);
    652652  }
    653   CPPUNIT_ASSERT_EQUAL(N, PointsOnSurface.size());
     653  CPPUNIT_ASSERT_EQUAL((size_t)194, PointsOnSurface.size());
    654654}
    655655
Note: See TracChangeset for help on using the changeset viewer.