Changeset d0f111 for src


Ignore:
Timestamp:
Jun 26, 2010, 11:33:17 AM (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:
f66b67
Parents:
2f1a7a
Message:

Changed Vector::WrapPeriodically to use matrixes instead of double*

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_geometry.cpp

    r2f1a7a rd0f111  
    3535  const Vector *CenterBox = DetermineCenterOfBox();
    3636  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();
    3941
    4042  // go through all atoms
    4143  ActOnAllVectors( &Vector::SubtractVector, *Center);
    4244  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
    4749  delete(Center);
    4850  return status;
     
    5759  bool status = true;
    5860  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();
    6165
    6266  // 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
    6771  return status;
    6872};
     
    246250{
    247251  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();
    250256
    251257  // go through all atoms
    252258  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
    257263};
    258264
     
    265271  OBSERVE;
    266272  Plane p(*n,0);
    267   BOOST_FOREACH( atom* iter, atoms ){
     273  BOOST_FOREACH(atom* iter, atoms ){
    268274    (*iter->node) = p.mirrorVector(*iter->node);
    269275  }
  • src/vector.cpp

    r2f1a7a rd0f111  
    533533 * \param *Minv inverse matrix
    534534 */
    535 void Vector::WrapPeriodically(const double * const _M, const double * const _Minv)
    536 {
    537   Matrix M = Matrix(_M);
    538   Matrix Minv = Matrix(_Minv);
     535void Vector::WrapPeriodically(const Matrix &M, const Matrix &Minv)
     536{
    539537  MatrixMultiplication(Minv);
    540538  // truncate to [0,1] for each axis
  • src/vector.hpp

    r2f1a7a rd0f111  
    6565  bool MakeNormalTo(const Vector &y1);
    6666  bool IsInParallelepiped(const Vector &offset, const double * const parallelepiped) const;
    67   void WrapPeriodically(const double * const M, const double * const Minv);
     67  void WrapPeriodically(const Matrix &M, const Matrix &Minv);
    6868  std::pair<Vector,Vector> partition(const Vector&) const;
    6969  std::pair<pointset,Vector> partition(const pointset&) const;
Note: See TracChangeset for help on using the changeset viewer.