Changeset cfa795


Ignore:
Timestamp:
Jun 28, 2010, 5:02:50 PM (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:
24c35a
Parents:
13892b
Message:

GetCenterofCircumcircle(0 - Removed old calculation that is superceded by use of barycentric coordinates.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tesselationhelpers.cpp

    r13892b rcfa795  
    183183  Vector SideB = c - a;
    184184  Vector SideC = a - b;
    185   alpha = M_PI - SideB.Angle(SideC);
    186   beta = M_PI - SideC.Angle(SideA);
    187   gamma = M_PI - SideA.Angle(SideB);
    188   Log() << Verbose(1) << "INFO: alpha = " << alpha/M_PI*180. << ", beta = " << beta/M_PI*180. << ", gamma = " << gamma/M_PI*180. << "." << endl;
    189   if (fabs(M_PI - alpha - beta - gamma) > HULLEPSILON) {
    190     DoeLog(2) && (eLog()<< Verbose(2) << "GetCenterofCircumcircle: Sum of angles " << (alpha+beta+gamma)/M_PI*180. << " > 180 degrees by " << fabs(M_PI - alpha - beta - gamma)/M_PI*180. << "!" << endl);
    191   }
    192 
    193   Center->Zero();
    194   helper = sin(2.*alpha) * a;
    195   (*Center) += helper;
    196   helper = sin(2.*beta) * b;
    197   (*Center) += helper;
    198   helper = sin(2.*gamma) * c;
    199   (*Center) += helper;
    200   Center->Scale(1./(sin(2.*alpha) + sin(2.*beta) + sin(2.*gamma)));
    201   Log() << Verbose(1) << "INFO: Center (1st algo) is at " << *Center << "." << endl;
    202 
    203 //  LinearSystemOfEquations LSofEq(NDIM,NDIM);
    204 //  double *matrix = new double[NDIM*NDIM];
    205 //  matrix[0] = 0.;
    206 //  matrix[1] = a.DistanceSquared(b);
    207 //  matrix[2] = a.DistanceSquared(c);
    208 //  matrix[3] = a.DistanceSquared(b);
    209 //  matrix[4] = 0.;
    210 //  matrix[5] = b.DistanceSquared(c);
    211 //  matrix[6] = a.DistanceSquared(c);
    212 //  matrix[7] = b.DistanceSquared(c);
    213 //  matrix[8] = 0.;
    214 //  cout << "Matrix is: ";
    215 //  for (int i=0;i<NDIM*NDIM;i++)
    216 //    cout << matrix[i] << "\t";
    217 //  cout << endl;
    218 //  LSofEq.SetA(matrix);
    219 //  delete[](matrix);
    220 //  LSofEq.Setb(new Vector(1.,1.,1.));
    221 //  LSofEq.SetSymmetric(true);
    222 //  helper.Zero();
    223 //  if (!LSofEq.GetSolutionAsVector(helper)) {
    224 //    DoLog(0) && (eLog()<< Verbose(0) << "Could not solve the linear system in GetCenterofCircumCircle()!" << endl);
    225 //  }
    226 //  cout << "Solution is " << helper << endl;
    227   // is equivalent to the three lines below
     185
    228186  helper[0] = SideA.NormSquared()*(SideB.NormSquared()+SideC.NormSquared() - SideA.NormSquared());
    229187  helper[1] = SideB.NormSquared()*(SideC.NormSquared()+SideA.NormSquared() - SideB.NormSquared());
Note: See TracChangeset for help on using the changeset viewer.