Changeset 1513a74
- Timestamp:
- Apr 30, 2010, 10:07:23 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:
- fa5a6a
- Parents:
- 005e18
- Location:
- src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Makefile.am
r005e18 r1513a74 10 10 gslvector.cpp \ 11 11 linearsystemofequations.cpp \ 12 Space.cpp \ 12 13 vector.cpp 13 14 … … 15 16 gslvector.hpp \ 16 17 linearsystemofequations.hpp \ 18 Space.hpp \ 17 19 vector.hpp 18 20 … … 127 129 periodentafel.cpp \ 128 130 Plane.cpp \ 129 Space.cpp \130 131 tesselation.cpp \ 131 132 tesselationhelpers.cpp \ … … 166 167 periodentafel.hpp \ 167 168 Plane.hpp \ 168 Space.hpp \169 169 stackclass.hpp \ 170 170 tesselation.hpp \ -
src/analysis_correlation.cpp
r005e18 r1513a74 131 131 checkOtherX = Vector(Othern[0], Othern[1], Othern[2]) + periodicOtherX; 132 132 checkOtherX.MatrixMultiplication(FullMatrix); 133 distance = checkX. Distance(checkOtherX);133 distance = checkX.distance(checkOtherX); 134 134 //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl; 135 135 outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) ); … … 224 224 checkX = Vector(n[0], n[1], n[2]) + periodicX; 225 225 checkX.MatrixMultiplication(FullMatrix); 226 distance = checkX. Distance(*point);226 distance = checkX.distance(*point); 227 227 DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl); 228 228 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) ); -
src/atom.cpp
r005e18 r1513a74 261 261 double atom::DistanceToVector(const Vector &origin) const 262 262 { 263 return origin. Distance(x);263 return origin.distance(x); 264 264 }; 265 265 -
src/atom_trajectoryparticle.cpp
r005e18 r1513a74 49 49 // set forces 50 50 for (int i=NDIM;i++;) 51 Force->Matrix[0][nr][5+i] += 2.*constant*sqrt(Trajectory.R.at(startstep). Distance(Sprinter->Trajectory.R.at(endstep)));51 Force->Matrix[0][nr][5+i] += 2.*constant*sqrt(Trajectory.R.at(startstep).distance(Sprinter->Trajectory.R.at(endstep))); 52 52 }; 53 53 -
src/bond.cpp
r005e18 r1513a74 119 119 double bond::GetDistance() const 120 120 { 121 return (leftatom->node-> Distance(*rightatom->node));121 return (leftatom->node->distance(*rightatom->node)); 122 122 }; 123 123 -
src/molecule_dynamics.cpp
r005e18 r1513a74 48 48 // check whether either is zero() 49 49 if ((Norm1 < MYEPSILON) && (Norm2 < MYEPSILON)) { 50 tmp = Walker->Trajectory.R.at(Params.startstep). Distance(Runner->Trajectory.R.at(Params.startstep));50 tmp = Walker->Trajectory.R.at(Params.startstep).distance(Runner->Trajectory.R.at(Params.startstep)); 51 51 } else if (Norm1 < MYEPSILON) { 52 52 Sprinter = Params.PermutationMap[Walker->nr]; // find first target point … … 66 66 // Log() << Verbose(0) << " and "; 67 67 // Log() << Verbose(0) << trajectory2; 68 tmp = Walker->Trajectory.R.at(Params.startstep). Distance(Runner->Trajectory.R.at(Params.startstep));68 tmp = Walker->Trajectory.R.at(Params.startstep).distance(Runner->Trajectory.R.at(Params.startstep)); 69 69 // Log() << Verbose(0) << " with distance " << tmp << "." << endl; 70 70 } else { // determine distance by finding minimum distance … … 166 166 // first term: distance to target 167 167 Runner = Params.PermutationMap[Walker->nr]; // find target point 168 tmp = (Walker->Trajectory.R.at(Params.startstep). Distance(Runner->Trajectory.R.at(Params.endstep)));168 tmp = (Walker->Trajectory.R.at(Params.startstep).distance(Runner->Trajectory.R.at(Params.endstep))); 169 169 tmp *= Params.IsAngstroem ? 1. : 1./AtomicLengthToAngstroem; 170 170 result += Params.PenaltyConstants[0] * tmp; … … 225 225 while(Runner->next != mol->end) { 226 226 Runner = Runner->next; 227 Params.DistanceList[Walker->nr]->insert( DistancePair(Walker->Trajectory.R.at(Params.startstep). Distance(Runner->Trajectory.R.at(Params.endstep)), Runner) );227 Params.DistanceList[Walker->nr]->insert( DistancePair(Walker->Trajectory.R.at(Params.startstep).distance(Runner->Trajectory.R.at(Params.endstep)), Runner) ); 228 228 } 229 229 } -
src/moleculelist.cpp
r005e18 r1513a74 502 502 if ((Runner->type->Z == 1) && (Runner->nr > Walker->nr) && (Binder->GetOtherAtom(Runner) != Binder->GetOtherAtom(Walker))) { // (hydrogens have only one bonding partner!) 503 503 // 4. evaluate the morse potential for each matrix component and add up 504 distance = Runner->x. Distance(Walker->x);504 distance = Runner->x.distance(Walker->x); 505 505 //Log() << Verbose(0) << "Fragment " << (*ListRunner)->name << ": " << *Runner << "<= " << distance << "=>" << *Walker << ":" << endl; 506 506 for (int k = 0; k < a; k++) { -
src/tesselation.cpp
r005e18 r1513a74 1097 1097 DoLog(1) && (Log() << Verbose(1) << "The following atoms are inside sphere at " << OtherOptCenter << ":" << endl); 1098 1098 for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner) 1099 DoLog(1) && (Log() << Verbose(1) << " " << *(*Runner) << " with distance " << (*Runner)->node-> Distance(OtherOptCenter) << "." << endl);1099 DoLog(1) && (Log() << Verbose(1) << " " << *(*Runner) << " with distance " << (*Runner)->node->distance(OtherOptCenter) << "." << endl); 1100 1100 1101 1101 // remove baseline's endpoints and candidates … … 2050 2050 DoLog(1) && (Log() << Verbose(1) << "The following atoms are inside sphere at " << CandidateLine.OtherOptCenter << ":" << endl); 2051 2051 for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner) 2052 DoLog(1) && (Log() << Verbose(1) << " " << *(*Runner) << " with distance " << (*Runner)->node-> Distance(CandidateLine.OtherOptCenter) << "." << endl);2052 DoLog(1) && (Log() << Verbose(1) << " " << *(*Runner) << " with distance " << (*Runner)->node->distance(CandidateLine.OtherOptCenter) << "." << endl); 2053 2053 2054 2054 // remove triangles's endpoints … … 2066 2066 DoLog(1) && (Log() << Verbose(1) << "External atoms inside of sphere at " << CandidateLine.OtherOptCenter << ":" << endl); 2067 2067 for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner) 2068 DoLog(1) && (Log() << Verbose(1) << " " << *(*Runner) << " with distance " << (*Runner)->node-> Distance(CandidateLine.OtherOptCenter) << "." << endl);2068 DoLog(1) && (Log() << Verbose(1) << " " << *(*Runner) << " with distance " << (*Runner)->node->distance(CandidateLine.OtherOptCenter) << "." << endl); 2069 2069 } 2070 2070 delete (ListofPoints); -
src/tesselationhelpers.cpp
r005e18 r1513a74 88 88 center->at(2) = 0.5 * m14/ m11; 89 89 90 if (fabs(a. Distance(*center) - RADIUS) > MYEPSILON)91 DoeLog(1) && (eLog()<< Verbose(1) << "The given center is further way by " << fabs(a. Distance(*center) - RADIUS) << " from a than RADIUS." << endl);90 if (fabs(a.distance(*center) - RADIUS) > MYEPSILON) 91 DoeLog(1) && (eLog()<< Verbose(1) << "The given center is further way by " << fabs(a.distance(*center) - RADIUS) << " from a than RADIUS." << endl); 92 92 93 93 gsl_matrix_free(A); … … 232 232 alpha = 2.*M_PI - alpha; 233 233 DoLog(1) && (Log() << Verbose(1) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << RelativeOldSphereCenter << " and resulting angle is " << alpha << "." << endl); 234 radius = helper. Distance(RelativeOldSphereCenter);234 radius = helper.distance(RelativeOldSphereCenter); 235 235 helper.ProjectOntoPlane(NormalVector); 236 236 // check whether new center is somewhat away or at least right over the current baseline to prevent intersecting triangles -
src/triangleintersectionlist.cpp
r005e18 r1513a74 146 146 if (DistanceList.empty()) 147 147 for (TriangleVectorMap::const_iterator runner = IntersectionList.begin(); runner != IntersectionList.end(); runner++) 148 DistanceList.insert( pair<double, BoundaryTriangleSet *> (Point-> Distance(*(*runner).second), (*runner).first) );148 DistanceList.insert( pair<double, BoundaryTriangleSet *> (Point->distance(*(*runner).second), (*runner).first) ); 149 149 150 150 //for (DistanceTriangleMap::const_iterator runner = DistanceList.begin(); runner != DistanceList.end(); runner++) -
src/unittests/vectorunittest.cpp
r005e18 r1513a74 159 159 void VectorTest::EuclidianDistancesTest() 160 160 { 161 CPPUNIT_ASSERT_EQUAL( 1., zero. Distance(unit) );162 CPPUNIT_ASSERT_EQUAL( sqrt(2.), otherunit. Distance(unit) );163 CPPUNIT_ASSERT_EQUAL( sqrt(2.), zero. Distance(notunit) );164 CPPUNIT_ASSERT_EQUAL( 1., otherunit. Distance(notunit) );165 CPPUNIT_ASSERT_EQUAL( sqrt(5.), two. Distance(notunit) );161 CPPUNIT_ASSERT_EQUAL( 1., zero.distance(unit) ); 162 CPPUNIT_ASSERT_EQUAL( sqrt(2.), otherunit.distance(unit) ); 163 CPPUNIT_ASSERT_EQUAL( sqrt(2.), zero.distance(notunit) ); 164 CPPUNIT_ASSERT_EQUAL( 1., otherunit.distance(notunit) ); 165 CPPUNIT_ASSERT_EQUAL( sqrt(5.), two.distance(notunit) ); 166 166 } 167 167 -
src/vector.cpp
r005e18 r1513a74 79 79 * \return \f$| x - y |\f$ 80 80 */ 81 double Vector:: Distance(const Vector &y) const81 double Vector::distance(const Vector &y) const 82 82 { 83 83 return (sqrt(DistanceSquared(y))); 84 84 }; 85 86 Vector Vector::getClosestPoint(const Vector &point) const{ 87 // the closest point to a single point space is always the single point itself 88 return *this; 89 } 85 90 86 91 /** Calculates distance between this and another vector in a periodic cell. … … 91 96 double Vector::PeriodicDistance(const Vector &y, const double * const cell_size) const 92 97 { 93 double res = Distance(y), tmp, matrix[NDIM*NDIM];98 double res = distance(y), tmp, matrix[NDIM*NDIM]; 94 99 Vector Shiftedy, TranslationVector; 95 100 int N[NDIM]; … … 115 120 Shiftedy = y + TranslationVector; 116 121 // get distance and compare with minimum so far 117 tmp = Distance(Shiftedy);122 tmp = distance(Shiftedy); 118 123 if (tmp < res) res = tmp; 119 124 } -
src/vector.hpp
r005e18 r1513a74 18 18 19 19 #include "defs.hpp" 20 #include "Space.hpp" 20 21 21 22 /********************************************** declarations *******************************/ … … 24 25 * basically, just a x[3] but with helpful functions 25 26 */ 26 class Vector {27 class Vector : public Space{ 27 28 protected: 28 29 // this struct is used to indicate calls to the Baseconstructor from inside vectors. … … 79 80 80 81 // Methods that are derived directly from other methods 81 double Distance(const Vector &y) const;82 82 double Norm() const; 83 83 double NormSquared() const; … … 93 93 Vector const operator+(const Vector& b) const; 94 94 Vector const operator-(const Vector& b) const; 95 96 // Methods inherited from Space 97 virtual double distance(const Vector &point) const; 98 virtual Vector getClosestPoint(const Vector &point) const; 95 99 96 100 protected:
Note:
See TracChangeset
for help on using the changeset viewer.