- Timestamp:
- Jun 30, 2010, 12:20:34 PM (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:
- 84c494
- Parents:
- 4b0cbb
- Location:
- src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/atom.cpp
r4b0cbb r9df5c6 112 112 * \return true - is inside, false - is not 113 113 */ 114 bool atom::IsInParallelepiped(const Vector offset, const double *parallelepiped) const114 bool atom::IsInParallelepiped(const Vector offset, const Matrix& parallelepiped) const 115 115 { 116 116 return (node->IsInParallelepiped(offset, parallelepiped)); -
src/atom.hpp
r4b0cbb r9df5c6 66 66 double DistanceToVector(const Vector &origin) const; 67 67 double DistanceSquaredToVector(const Vector &origin) const; 68 bool IsInParallelepiped(const Vector offset, const double *parallelepiped) const;68 bool IsInParallelepiped(const Vector offset, const Matrix ¶llelepiped) const; 69 69 70 70 // getter and setter -
src/molecule.cpp
r4b0cbb r9df5c6 9 9 #include <cstring> 10 10 #include <boost/bind.hpp> 11 #include <boost/foreach.hpp> 11 12 12 13 #include "World.hpp" … … 659 660 * @param three vectors forming the matrix that defines the shape of the parallelpiped 660 661 */ 661 molecule* molecule::CopyMoleculeFromSubRegion(const Vector offset, const double *parallelepiped) const {662 molecule* molecule::CopyMoleculeFromSubRegion(const Vector offset, const Matrix ¶llelepiped) const { 662 663 molecule *copy = World::getInstance().createMolecule(); 663 664 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 } 665 670 666 671 //TODO: copy->BuildInducedSubgraph(this); -
src/molecule.hpp
r4b0cbb r9df5c6 316 316 317 317 molecule *CopyMolecule(); 318 molecule* CopyMoleculeFromSubRegion(const Vector offset, const double *parallelepiped) const;318 molecule* CopyMoleculeFromSubRegion(const Vector offset, const Matrix ¶llelepiped) const; 319 319 320 320 /// Fragment molecule by two different approaches: -
src/unittests/vectorunittest.cpp
r4b0cbb r9df5c6 21 21 #include "Plane.hpp" 22 22 #include "Exceptions/LinearDependenceException.hpp" 23 #include "Matrix.hpp" 23 24 24 25 #ifdef HAVE_TESTRUNNER … … 221 222 void VectorTest::IsInParallelepipedTest() 222 223 { 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; 233 234 234 235 fixture = zero; -
src/vector.cpp
r4b0cbb r9df5c6 601 601 * @param three vectors forming the matrix that defines the shape of the parallelpiped 602 602 */ 603 bool Vector::IsInParallelepiped(const Vector &offset, const double * const_parallelepiped) const604 { 605 Matrix parallelepiped = Matrix(_parallelepiped).invert();603 bool Vector::IsInParallelepiped(const Vector &offset, const Matrix& _parallelepiped) const 604 { 605 Matrix parallelepiped = _parallelepiped.invert(); 606 606 Vector a = parallelepiped * ((*this)-offset); 607 607 bool isInside = true; -
src/vector.hpp
r4b0cbb r9df5c6 62 62 bool GetOneNormalVector(const Vector &x1); 63 63 bool MakeNormalTo(const Vector &y1); 64 bool IsInParallelepiped(const Vector &offset, const double * constparallelepiped) const;64 bool IsInParallelepiped(const Vector &offset, const Matrix& _parallelepiped) const; 65 65 void WrapPeriodically(const Matrix &M, const Matrix &Minv); 66 66 std::pair<Vector,Vector> partition(const Vector&) const;
Note:
See TracChangeset
for help on using the changeset viewer.