Changeset 9df5c6 for src


Ignore:
Timestamp:
Jun 30, 2010, 12:20:34 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:
84c494
Parents:
4b0cbb
Message:

Made the Vector::IsInParallelepiped() method take a matrix instead of a double*

Location:
src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/atom.cpp

    r4b0cbb r9df5c6  
    112112 * \return true - is inside, false - is not
    113113 */
    114 bool atom::IsInParallelepiped(const Vector offset, const double *parallelepiped) const
     114bool atom::IsInParallelepiped(const Vector offset, const Matrix& parallelepiped) const
    115115{
    116116  return (node->IsInParallelepiped(offset, parallelepiped));
  • src/atom.hpp

    r4b0cbb r9df5c6  
    6666  double DistanceToVector(const Vector &origin) const;
    6767  double DistanceSquaredToVector(const Vector &origin) const;
    68   bool IsInParallelepiped(const Vector offset, const double *parallelepiped) const;
     68  bool IsInParallelepiped(const Vector offset, const Matrix &parallelepiped) const;
    6969
    7070  // getter and setter
  • src/molecule.cpp

    r4b0cbb r9df5c6  
    99#include <cstring>
    1010#include <boost/bind.hpp>
     11#include <boost/foreach.hpp>
    1112
    1213#include "World.hpp"
     
    659660 * @param three vectors forming the matrix that defines the shape of the parallelpiped
    660661 */
    661 molecule* molecule::CopyMoleculeFromSubRegion(const Vector offset, const double *parallelepiped) const {
     662molecule* molecule::CopyMoleculeFromSubRegion(const Vector offset, const Matrix &parallelepiped) const {
    662663  molecule *copy = World::getInstance().createMolecule();
    663664
    664   ActOnCopyWithEachAtomIfTrue ( &molecule::AddCopyAtom, copy, &atom::IsInParallelepiped, offset, parallelepiped );
     665  BOOST_FOREACH(atom *iter,atoms){
     666    if(iter->IsInParallelepiped(offset,parallelepiped)){
     667      copy->AddCopyAtom(iter);
     668    }
     669  }
    665670
    666671  //TODO: copy->BuildInducedSubgraph(this);
  • src/molecule.hpp

    r4b0cbb r9df5c6  
    316316
    317317  molecule *CopyMolecule();
    318   molecule* CopyMoleculeFromSubRegion(const Vector offset, const double *parallelepiped) const;
     318  molecule* CopyMoleculeFromSubRegion(const Vector offset, const Matrix &parallelepiped) const;
    319319
    320320  /// Fragment molecule by two different approaches:
  • src/unittests/vectorunittest.cpp

    r4b0cbb r9df5c6  
    2121#include "Plane.hpp"
    2222#include "Exceptions/LinearDependenceException.hpp"
     23#include "Matrix.hpp"
    2324
    2425#ifdef HAVE_TESTRUNNER
     
    221222void VectorTest::IsInParallelepipedTest()
    222223{
    223   double parallelepiped[NDIM*NDIM];
    224   parallelepiped[0] = 1;
    225   parallelepiped[1] = 0;
    226   parallelepiped[2] = 0;
    227   parallelepiped[3] = 0;
    228   parallelepiped[4] = 1;
    229   parallelepiped[5] = 0;
    230   parallelepiped[6] = 0;
    231   parallelepiped[7] = 0;
    232   parallelepiped[8] = 1;
     224  Matrix parallelepiped;
     225  parallelepiped.at(0,0) = 1;
     226  parallelepiped.at(1,0) = 0;
     227  parallelepiped.at(2,0) = 0;
     228  parallelepiped.at(0,1) = 0;
     229  parallelepiped.at(1,1) = 1;
     230  parallelepiped.at(2,1) = 0;
     231  parallelepiped.at(0,2) = 0;
     232  parallelepiped.at(1,2) = 0;
     233  parallelepiped.at(2,2) = 1;
    233234
    234235  fixture = zero;
  • src/vector.cpp

    r4b0cbb r9df5c6  
    601601 * @param three vectors forming the matrix that defines the shape of the parallelpiped
    602602 */
    603 bool Vector::IsInParallelepiped(const Vector &offset, const double * const _parallelepiped) const
    604 {
    605   Matrix parallelepiped = Matrix(_parallelepiped).invert();
     603bool Vector::IsInParallelepiped(const Vector &offset, const Matrix& _parallelepiped) const
     604{
     605  Matrix parallelepiped = _parallelepiped.invert();
    606606  Vector a = parallelepiped * ((*this)-offset);
    607607  bool isInside = true;
  • src/vector.hpp

    r4b0cbb r9df5c6  
    6262  bool GetOneNormalVector(const Vector &x1);
    6363  bool MakeNormalTo(const Vector &y1);
    64   bool IsInParallelepiped(const Vector &offset, const double * const parallelepiped) const;
     64  bool IsInParallelepiped(const Vector &offset, const Matrix& _parallelepiped) const;
    6565  void WrapPeriodically(const Matrix &M, const Matrix &Minv);
    6666  std::pair<Vector,Vector> partition(const Vector&) const;
Note: See TracChangeset for help on using the changeset viewer.