Changeset d4c9ae


Ignore:
Timestamp:
May 20, 2010, 3:51:14 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
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:
93dfc7b
Parents:
5702280
Message:

Removed the DistanceToPlane method in the Vector class in favor of a method that computes the distance to arbitrary spaces

Location:
src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/Plane.cpp

    r5702280 rd4c9ae  
    9191  offset = normalVector->ScalarProduct(_offsetVector);
    9292}
     93
     94/**
     95 * copy constructor
     96 */
     97Plane::Plane(const Plane& plane) :
     98  normalVector(new Vector(*plane.normalVector)),
     99  offset(plane.offset)
     100{}
     101
    93102
    94103Plane::~Plane()
  • src/Plane.hpp

    r5702280 rd4c9ae  
    2626  Plane(const Vector &_normalVector, double _offset)  throw(ZeroVectorException);
    2727  Plane(const Vector &_normalVector, const Vector &_offsetVector) throw(ZeroVectorException);
     28  Plane(const Plane& plane);
    2829  virtual ~Plane();
    2930
  • src/molecule_fragmentation.cpp

    r5702280 rd4c9ae  
    593593    MolecularWalker = MolecularWalker->next;
    594594    // fill the bond structure of the individually stored subgraphs
    595   MolecularWalker->FillBondStructureFromReference(this, FragmentCounter, ListOfLocalAtoms, false);  // we want to keep the created ListOfLocalAtoms
     595    MolecularWalker->FillBondStructureFromReference(this, FragmentCounter, ListOfLocalAtoms, false);  // we want to keep the created ListOfLocalAtoms
    596596    DoLog(0) && (Log() << Verbose(0) << "Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl);
    597597    LocalBackEdgeStack = new StackClass<bond *> (MolecularWalker->Leaf->BondCount);
     
    16721672  while (flag) {
    16731673    // remove bonds that are beyond bonddistance
    1674     for(int i=NDIM;i--;)
    1675       Translationvector[i] = 0.;
     1674    Translationvector.Zero();
    16761675    // scan all bonds
    16771676    Binder = first;
     
    17261725    //delete(CompStack);
    17271726  }
    1728 
    17291727  // free allocated space from ReturnFullMatrixforSymmetric()
    17301728  delete(AtomStack);
  • src/tesselation.cpp

    r5702280 rd4c9ae  
    2121#include "Plane.hpp"
    2222#include "Exceptions/LinearDependenceException.hpp"
     23#include "Helpers/Assert.hpp"
    2324
    2425class molecule;
     
    680681  center->Scale(1. / 3.);
    681682  DoLog(1) && (Log() << Verbose(1) << "INFO: Center is at " << *center << "." << endl);
     683}
     684
     685/**
     686 * gets the Plane defined by the three triangle Basepoints
     687 */
     688Plane BoundaryTriangleSet::getPlane() const{
     689  ASSERT(endpoints[0] && endpoints[1] && endpoints[2], "Triangle not fully defined");
     690
     691  return Plane(*endpoints[0]->node->node,
     692               *endpoints[1]->node->node,
     693               *endpoints[2]->node->node);
    682694}
    683695
  • src/tesselation.hpp

    r5702280 rd4c9ae  
    3838class PointCloud;
    3939class Tesselation;
     40class Plane;
    4041
    4142/********************************************** definitions *********************************/
     
    165166    bool IsPresentTupel(const BoundaryPointSet * const Points[3]) const;
    166167    bool IsPresentTupel(const BoundaryTriangleSet * const T) const;
     168
     169    Plane getPlane() const;
    167170
    168171    class BoundaryPointSet *endpoints[3];
  • src/tesselationhelpers.cpp

    r5702280 rd4c9ae  
    1616#include "vector_ops.hpp"
    1717#include "verbose.hpp"
     18#include "Plane.hpp"
    1819
    1920double DetGet(gsl_matrix * const A, const int inPlace)
     
    687688    return -1;
    688689  }
    689   distance = x->DistanceToPlane(triangle->NormalVector, *triangle->endpoints[0]->node->node);
     690  distance = x->DistanceToSpace(triangle->getPlane());
    690691  return distance;
    691692};
  • src/vector.cpp

    r5702280 rd4c9ae  
    266266 * \return distance to plane
    267267 */
    268 double Vector::DistanceToPlane(const Vector &PlaneNormal, const Vector &PlaneOffset) const
    269 {
    270   return GetDistanceVectorToPlane(PlaneNormal,PlaneOffset).Norm();
     268double Vector::DistanceToSpace(const Space &space) const
     269{
     270  return space.distance(*this);
    271271};
    272272
  • src/vector.hpp

    r5702280 rd4c9ae  
    4040  double DistanceSquared(const Vector &y) const;
    4141  Vector GetDistanceVectorToPlane(const Vector &PlaneNormal, const Vector &PlaneOffset) const;
    42   double DistanceToPlane(const Vector &PlaneNormal, const Vector &PlaneOffset) const;
     42  double DistanceToSpace(const Space& space) const;
    4343  double PeriodicDistance(const Vector &y, const double * const cell_size) const;
    4444  double PeriodicDistanceSquared(const Vector &y, const double * const cell_size) const;
Note: See TracChangeset for help on using the changeset viewer.