Changeset c4d4df


Ignore:
Timestamp:
Oct 13, 2009, 4:42:58 PM (15 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:
06c7a3, f74d08
Parents:
93d120
git-author:
Frederik Heber <heber@…> (10/13/09 16:14:49)
git-committer:
Frederik Heber <heber@…> (10/13/09 16:42:58)
Message:

Pair correlation analysis added.

Unit tests are working fine.

Location:
src
Files:
8 added
6 edited

Legend:

Unmodified
Added
Removed
  • src/Makefile.am

    r93d120 rc4d4df  
    1 SOURCE = atom.cpp bond.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp graph.cpp helpers.cpp leastsquaremin.cpp linkedcell.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp
    2 HEADER = atom.hpp bond.hpp boundary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp graph.hpp helpers.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp vector.hpp verbose.hpp
     1SOURCE = analysis_correlation.cpp atom.cpp bond.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp graph.cpp helpers.cpp leastsquaremin.cpp linkedcell.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp
     2HEADER = analysis_correlation.hpp atom.hpp bond.hpp boundary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp graph.hpp helpers.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp vector.hpp verbose.hpp
    33
    44BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB)
  • src/tesselationhelpers.cpp

    r93d120 rc4d4df  
    679679};
    680680
     681/** Returns the distance to the plane defined by \a *triangle
     682 * \param *out output stream for debugging
     683 * \param *x Vector to calculate distance to
     684 * \param *triangle triangle defining plane
     685 * \return distance between \a *x and plane defined by \a *triangle, -1 - if something went wrong
     686 */
     687double DistanceToTrianglePlane(ofstream *out, Vector *x, BoundaryTriangleSet *triangle)
     688{
     689  double distance = 0.;
     690  if (x == NULL) {
     691    return -1;
     692  }
     693  distance = x->DistanceToPlane(out, &triangle->NormalVector, triangle->endpoints[0]->node->node);
     694  return distance;
     695};
    681696
    682697/** Creates the objects in a VRML file.
  • src/tesselationhelpers.hpp

    r93d120 rc4d4df  
    6868void WriteVrmlFile(ofstream *out, ofstream *vrmlfile, class Tesselation *Tess, PointCloud *cloud);
    6969void CalculateConcavityPerBoundaryPoint(ofstream *out, class Tesselation *TesselStruct);
     70double DistanceToTrianglePlane(ofstream *out, Vector *x, BoundaryTriangleSet *triangle);
    7071
    7172bool CheckListOfBaselines(ofstream *out, Tesselation *TesselStruct);
  • src/unittests/Makefile.am

    r93d120 rc4d4df  
    11INCLUDES = -I$(top_srcdir)/src
    22
    3 noinst_PROGRAMS =  ActOnAllTest MemoryAllocatorUnitTest MemoryUsageObserverUnitTest VectorUnitTest
     3noinst_PROGRAMS =  ActOnAllUnitTest AnalysisCorrelationToPointUnitTest AnalysisCorrelationToSurfaceUnitTest AnalysisPairCorrelationUnitTest MemoryAllocatorUnitTest MemoryUsageObserverUnitTest VectorUnitTest
    44
    5 TESTS = ActOnAllTest MemoryUsageObserverUnitTest MemoryAllocatorUnitTest VectorUnitTest
     5TESTS = ActOnAllUnitTest AnalysisCorrelationToPointUnitTest AnalysisCorrelationToSurfaceUnitTest AnalysisPairCorrelationUnitTest MemoryUsageObserverUnitTest MemoryAllocatorUnitTest VectorUnitTest
    66check_PROGRAMS = $(TESTS)
    77
    8 ActOnAllTest_SOURCES = ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp memoryallocator.hpp
    9 ActOnAllTest_CXXFLAGS = $(CPPUNIT_CFLAGS)
    10 ActOnAllTest_LDFLAGS = $(CPPUNIT_LIBS) -ldl
    11 ActOnAllTest_LDADD = ../libmolecuilder.a
     8ActOnAllUnitTest_SOURCES = ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp memoryallocator.hpp
     9ActOnAllUnitTest_CXXFLAGS = $(CPPUNIT_CFLAGS)
     10ActOnAllUnitTest_LDFLAGS = $(CPPUNIT_LIBS) -ldl
     11ActOnAllUnitTest_LDADD = ../libmolecuilder.a
    1212
     13AnalysisCorrelationToPointUnitTest_SOURCES = analysis_correlation.hpp AnalysisCorrelationToPointUnitTest.cpp AnalysisCorrelationToPointUnitTest.hpp
     14AnalysisCorrelationToPointUnitTest_CXXFLAGS = $(CPPUNIT_CFLAGS)
     15AnalysisCorrelationToPointUnitTest_LDFLAGS = $(CPPUNIT_LIBS) -ldl
     16AnalysisCorrelationToPointUnitTest_LDADD = ../libmolecuilder.a
     17
     18AnalysisCorrelationToSurfaceUnitTest_SOURCES = analysis_correlation.hpp AnalysisCorrelationToSurfaceUnitTest.cpp AnalysisCorrelationToSurfaceUnitTest.hpp
     19AnalysisCorrelationToSurfaceUnitTest_CXXFLAGS = $(CPPUNIT_CFLAGS)
     20AnalysisCorrelationToSurfaceUnitTest_LDFLAGS = $(CPPUNIT_LIBS) -ldl
     21AnalysisCorrelationToSurfaceUnitTest_LDADD = ../libmolecuilder.a
     22
     23AnalysisPairCorrelationUnitTest_SOURCES = analysis_correlation.hpp AnalysisPairCorrelationUnitTest.cpp AnalysisPairCorrelationUnitTest.hpp
     24AnalysisPairCorrelationUnitTest_CXXFLAGS = $(CPPUNIT_CFLAGS)
     25AnalysisPairCorrelationUnitTest_LDFLAGS = $(CPPUNIT_LIBS) -ldl
     26AnalysisPairCorrelationUnitTest_LDADD = ../libmolecuilder.a
    1327
    1428VectorUnitTest_SOURCES = defs.hpp helpers.hpp leastsquaremin.hpp memoryallocator.hpp memoryusageobserver.hpp vectorunittest.cpp vectorunittest.hpp vector.hpp verbose.hpp
  • src/vector.cpp

    r93d120 rc4d4df  
    256256    return false;
    257257  }
     258};
     259
     260/** Calculates the minimum distance of this vector to the plane.
     261 * \param *out output stream for debugging
     262 * \param *PlaneNormal normal of plane
     263 * \param *PlaneOffset offset of plane
     264 * \return distance to plane
     265 */
     266double Vector::DistanceToPlane(ofstream *out, Vector *PlaneNormal, Vector *PlaneOffset)
     267{
     268  Vector temp;
     269
     270  // first create part that is orthonormal to PlaneNormal with withdraw
     271  temp.CopyVector(this);
     272  temp.SubtractVector(PlaneOffset);
     273  temp.MakeNormalVector(PlaneNormal);
     274  temp.Scale(-1.);
     275  // then add connecting vector from plane to point
     276  temp.AddVector(this);
     277  temp.SubtractVector(PlaneOffset);
     278
     279  return temp.Norm();
    258280};
    259281
  • src/vector.hpp

    r93d120 rc4d4df  
    3131  double Distance(const Vector *y) const;
    3232  double DistanceSquared(const Vector *y) const;
     33  double DistanceToPlane(ofstream *out, Vector *PlaneNormal, Vector *PlaneOffset);
    3334  double PeriodicDistance(const Vector *y, const double *cell_size) const;
    3435  double PeriodicDistanceSquared(const Vector *y, const double *cell_size) const;
Note: See TracChangeset for help on using the changeset viewer.