- Timestamp:
- Jun 26, 2010, 11:33:17 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:
- f66b67
- Parents:
- 2f1a7a
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_geometry.cpp
r2f1a7a rd0f111 35 35 const Vector *CenterBox = DetermineCenterOfBox(); 36 36 double * const cell_size = World::getInstance().getDomain(); 37 double *M = ReturnFullMatrixforSymmetric(cell_size); 38 double *Minv = InverseMatrix(M); 37 double *M_double = ReturnFullMatrixforSymmetric(cell_size); 38 Matrix M = Matrix(M_double); 39 delete[](M_double); 40 Matrix Minv = M.invert(); 39 41 40 42 // go through all atoms 41 43 ActOnAllVectors( &Vector::SubtractVector, *Center); 42 44 ActOnAllVectors( &Vector::SubtractVector, *CenterBox); 43 ActOnAllVectors( &Vector::WrapPeriodically, (const double *)M, (const double *)Minv);44 45 delete[](M);46 delete[](Minv); 45 BOOST_FOREACH(atom* iter, atoms){ 46 iter->node->WrapPeriodically(M, Minv); 47 } 48 47 49 delete(Center); 48 50 return status; … … 57 59 bool status = true; 58 60 double * const cell_size = World::getInstance().getDomain(); 59 double *M = ReturnFullMatrixforSymmetric(cell_size); 60 double *Minv = InverseMatrix(M); 61 double *M_double = ReturnFullMatrixforSymmetric(cell_size); 62 Matrix M = Matrix(M_double); 63 delete[](M_double); 64 Matrix Minv = M.invert(); 61 65 62 66 // go through all atoms 63 ActOnAllVectors( &Vector::WrapPeriodically, (const double *)M, (const double *)Minv);64 65 delete[](M);66 delete[](Minv); 67 BOOST_FOREACH(atom* iter, atoms){ 68 iter->node->WrapPeriodically(M, Minv); 69 } 70 67 71 return status; 68 72 }; … … 246 250 { 247 251 double * const cell_size = World::getInstance().getDomain(); 248 double *M = ReturnFullMatrixforSymmetric(cell_size); 249 double *Minv = InverseMatrix(M); 252 double *M_double = ReturnFullMatrixforSymmetric(cell_size); 253 Matrix M = Matrix(M_double); 254 delete[](M_double); 255 Matrix Minv = M.invert(); 250 256 251 257 // go through all atoms 252 258 ActOnAllVectors( &Vector::AddVector, *trans); 253 ActOnAllVectors( &Vector::WrapPeriodically, (const double *)M, (const double *)Minv);254 255 delete[](M);256 delete[](Minv); 259 BOOST_FOREACH(atom* iter, atoms){ 260 iter->node->WrapPeriodically(M, Minv); 261 } 262 257 263 }; 258 264 … … 265 271 OBSERVE; 266 272 Plane p(*n,0); 267 BOOST_FOREACH( 273 BOOST_FOREACH(atom* iter, atoms ){ 268 274 (*iter->node) = p.mirrorVector(*iter->node); 269 275 } -
src/vector.cpp
r2f1a7a rd0f111 533 533 * \param *Minv inverse matrix 534 534 */ 535 void Vector::WrapPeriodically(const double * const _M, const double * const _Minv) 536 { 537 Matrix M = Matrix(_M); 538 Matrix Minv = Matrix(_Minv); 535 void Vector::WrapPeriodically(const Matrix &M, const Matrix &Minv) 536 { 539 537 MatrixMultiplication(Minv); 540 538 // truncate to [0,1] for each axis -
src/vector.hpp
r2f1a7a rd0f111 65 65 bool MakeNormalTo(const Vector &y1); 66 66 bool IsInParallelepiped(const Vector &offset, const double * const parallelepiped) const; 67 void WrapPeriodically(const double * const M, const double * constMinv);67 void WrapPeriodically(const Matrix &M, const Matrix &Minv); 68 68 std::pair<Vector,Vector> partition(const Vector&) const; 69 69 std::pair<pointset,Vector> partition(const pointset&) const;
Note:
See TracChangeset
for help on using the changeset viewer.