Changeset 5108e1
- Timestamp:
- Jun 30, 2010, 9:00:19 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:
- 1da5f5
- Parents:
- 4d206f
- Location:
- src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/WorldAction/RepeatBoxAction.cpp
r4d206f r5108e1 99 99 DoeLog(1) && (eLog()<< Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl); 100 100 x = y; 101 x .MatrixMultiplication(M);101 x *= M; 102 102 newmol = World::getInstance().createMolecule(); 103 103 molecules->insert(newmol); -
src/analysis_correlation.cpp
r4d206f r5108e1 142 142 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 143 143 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl); 144 periodicX = *(*iter)->node; 145 periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 144 periodicX = FullInverseMatrix * (*(*iter)->node); // x now in [0,1)^3 146 145 // go through every range in xyz and get distance 147 146 for (n[0]=-ranges[0]; n[0] <= ranges[0]; n[0]++) 148 147 for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++) 149 148 for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) { 150 checkX = Vector(n[0], n[1], n[2]) + periodicX; 151 checkX.MatrixMultiplication(FullMatrix); 149 checkX = FullMatrix * (Vector(n[0], n[1], n[2]) + periodicX); 152 150 for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++){ 153 151 if ((*MolOtherWalker)->ActiveFlag) { … … 158 156 for (set <pair<element *, element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner) 159 157 if ((PairRunner->first == (**iter).type) && (PairRunner->second == (**runner).type)) { 160 periodicOtherX = *(*runner)->node; 161 periodicOtherX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 158 periodicOtherX = FullInverseMatrix * (*(*runner)->node); // x now in [0,1)^3 162 159 // go through every range in xyz and get distance 163 160 for (Othern[0]=-ranges[0]; Othern[0] <= ranges[0]; Othern[0]++) 164 161 for (Othern[1]=-ranges[1]; Othern[1] <= ranges[1]; Othern[1]++) 165 162 for (Othern[2]=-ranges[2]; Othern[2] <= ranges[2]; Othern[2]++) { 166 checkOtherX = Vector(Othern[0], Othern[1], Othern[2]) + periodicOtherX; 167 checkOtherX.MatrixMultiplication(FullMatrix); 163 checkOtherX = FullMatrix * (Vector(Othern[0], Othern[1], Othern[2]) + periodicOtherX); 168 164 distance = checkX.distance(checkOtherX); 169 165 //Log() << Verbose(1) <<"Inserting " << *(*iter) << " and " << *(*runner) << endl; … … 252 248 for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type) 253 249 if ((*type == NULL) || ((*iter)->type == *type)) { 254 periodicX = *(*iter)->node; 255 periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 250 periodicX = FullInverseMatrix * (*(*iter)->node); // x now in [0,1)^3 256 251 // go through every range in xyz and get distance 257 252 for (n[0]=-ranges[0]; n[0] <= ranges[0]; n[0]++) 258 253 for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++) 259 254 for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) { 260 checkX = Vector(n[0], n[1], n[2]) + periodicX; 261 checkX.MatrixMultiplication(FullMatrix); 255 checkX = FullMatrix * (Vector(n[0], n[1], n[2]) + periodicX); 262 256 distance = checkX.distance(*point); 263 257 DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl); … … 356 350 for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type) 357 351 if ((*type == NULL) || ((*iter)->type == *type)) { 358 periodicX = *(*iter)->node; 359 periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 352 periodicX = FullInverseMatrix * (*(*iter)->node); // x now in [0,1)^3 360 353 // go through every range in xyz and get distance 361 354 ShortestDistance = -1.; … … 363 356 for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++) 364 357 for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) { 365 checkX = Vector(n[0], n[1], n[2]) + periodicX; 366 checkX.MatrixMultiplication(FullMatrix); 358 checkX = FullMatrix * (Vector(n[0], n[1], n[2]) + periodicX); 367 359 TriangleIntersectionList Intersections(&checkX,Surface,LC); 368 360 distance = Intersections.GetSmallestDistance(); -
src/boundary.cpp
r4d206f r5108e1 800 800 801 801 // calculate filler grid in [0,1]^3 802 FillerDistance = Vector(distance[0], distance[1], distance[2]); 803 FillerDistance.MatrixMultiplication(MInverse); 802 FillerDistance = MInverse * Vector(distance[0], distance[1], distance[2]); 804 803 for(int i=0;i<NDIM;i++) 805 804 N[i] = (int) ceil(1./FillerDistance[i]); … … 814 813 for (n[2] = 0; n[2] < N[2]; n[2]++) { 815 814 // calculate position of current grid vector in untransformed box 816 CurrentPosition = Vector((double)n[0]/(double)N[0], (double)n[1]/(double)N[1], (double)n[2]/(double)N[2]); 817 CurrentPosition.MatrixMultiplication(M); 815 CurrentPosition = M * Vector((double)n[0]/(double)N[0], (double)n[1]/(double)N[1], (double)n[2]/(double)N[2]); 818 816 // create molecule random translation vector ... 819 817 for (int i=0;i<NDIM;i++) … … 850 848 Inserter = (*iter)->x; 851 849 if (DoRandomRotation) 852 Inserter .MatrixMultiplication(Rotations);850 Inserter *= Rotations; 853 851 Inserter += AtomTranslations + FillerTranslations + CurrentPosition; 854 852 855 853 // check whether inserter is inside box 856 Inserter .MatrixMultiplication(MInverse);854 Inserter *= MInverse; 857 855 FillIt = true; 858 856 for (int i=0;i<NDIM;i++) 859 857 FillIt = FillIt && (Inserter[i] >= -MYEPSILON) && ((Inserter[i]-1.) <= MYEPSILON); 860 Inserter .MatrixMultiplication(M);858 Inserter *= M; 861 859 862 860 // Check whether point is in- or outside -
src/ellipsoid.cpp
r4d206f r5108e1 61 61 Matrix.set(1,2, sin(theta)*cos(phi)); 62 62 Matrix.set(2,2, cos(theta)); 63 helper .MatrixMultiplication(Matrix);63 helper *= Matrix; 64 64 helper.ScaleAll(InverseLength); 65 65 //Log() << Verbose(4) << "Transformed RefPoint is at " << helper << "." << endl; … … 83 83 Matrix.set(1,2, sin(theta)*cos(phi)); 84 84 Matrix.set(2,2, cos(theta)); 85 helper .MatrixMultiplication(Matrix);85 helper *= Matrix; 86 86 //Log() << Verbose(4) << "Intersection is at " << helper << "." << endl; 87 87 -
src/molecule.cpp
r4d206f r5108e1 309 309 } 310 310 matrix = ReturnFullMatrixforSymmetric(cell_size); 311 Orthovector1 .MatrixMultiplication(matrix);311 Orthovector1 *= matrix; 312 312 InBondvector -= Orthovector1; // subtract just the additional translation 313 313 bondlength = InBondvector.Norm(); -
src/molecule_fragmentation.cpp
r4d206f r5108e1 1750 1750 Translationvector[i] = (tmp < 0) ? +1. : -1.; 1751 1751 } 1752 Translationvector .MatrixMultiplication(matrix);1752 Translationvector *= matrix; 1753 1753 //Log() << Verbose(3) << "Translation vector is "; 1754 1754 Log() << Verbose(0) << Translationvector << endl; -
src/molecule_geometry.cpp
r4d206f r5108e1 156 156 const double *cell_size = World::getInstance().getDomain(); 157 157 Matrix M = ReturnFullMatrixforSymmetric(cell_size); 158 a->MatrixMultiplication(M);158 (*a) *= M; 159 159 160 160 return a; … … 287 287 if ((*iter)->type->Z != 1) { 288 288 #endif 289 Testvector = (*iter)->x; 290 Testvector.MatrixMultiplication(inversematrix); 289 Testvector = inversematrix * (*iter)->x; 291 290 Translationvector.Zero(); 292 291 for (BondList::const_iterator Runner = (*iter)->ListOfBonds.begin(); Runner != (*iter)->ListOfBonds.end(); (++Runner)) { … … 305 304 } 306 305 Testvector += Translationvector; 307 Testvector .MatrixMultiplication(matrix);306 Testvector *= matrix; 308 307 Center += Testvector; 309 308 Log() << Verbose(1) << "vector is: " << Testvector << endl; … … 312 311 for (BondList::const_iterator Runner = (*iter)->ListOfBonds.begin(); Runner != (*iter)->ListOfBonds.end(); (++Runner)) { 313 312 if ((*Runner)->GetOtherAtom((*iter))->type->Z == 1) { 314 Testvector = (*Runner)->GetOtherAtom((*iter))->x; 315 Testvector.MatrixMultiplication(inversematrix); 313 Testvector = inversematrix * (*Runner)->GetOtherAtom((*iter))->x; 316 314 Testvector += Translationvector; 317 Testvector .MatrixMultiplication(matrix);315 Testvector *= matrix; 318 316 Center += Testvector; 319 317 Log() << Verbose(1) << "Hydrogen vector is: " << Testvector << endl; … … 386 384 // the eigenvectors specify the transformation matrix 387 385 Matrix M = Matrix(evec->data); 388 ActOnAllVectors( &Vector::MatrixMultiplication, static_cast<const Matrix>(M)); 386 BOOST_FOREACH(atom* iter, atoms){ 387 (*iter->node) *= M; 388 } 389 389 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 390 390 -
src/vector.cpp
r4d206f r5108e1 125 125 for (N[2]=-1;N[2]<=1;N[2]++) { 126 126 // create the translation vector 127 TranslationVector.Zero(); 128 for (int i=NDIM;i--;) 129 TranslationVector[i] = (double)N[i]; 130 TranslationVector.MatrixMultiplication(matrix); 127 TranslationVector = matrix * Vector(N[0],N[1],N[2]); 131 128 // add onto the original vector to compare with 132 129 Shiftedy = y + TranslationVector; … … 470 467 void Vector::WrapPeriodically(const Matrix &M, const Matrix &Minv) 471 468 { 472 MatrixMultiplication(Minv);469 *this *= Minv; 473 470 // truncate to [0,1] for each axis 474 471 for (int i=0;i<NDIM;i++) { … … 479 476 at(i) += 1.; 480 477 } 481 MatrixMultiplication(M);478 *this *= M; 482 479 }; 483 480 … … 498 495 return make_pair(res,helper); 499 496 } 500 501 /** Do a matrix multiplication.502 * \param *matrix NDIM_NDIM array503 */504 void Vector::MatrixMultiplication(const Matrix &M)505 {506 (*this) *= M;507 };508 497 509 498 /** Creates this vector as the b y *factors' components scaled linear combination of the given three. … … 615 604 bool Vector::IsInParallelepiped(const Vector &offset, const double * const _parallelepiped) const 616 605 { 617 Vector a = (*this)-offset;618 606 Matrix parallelepiped = Matrix(_parallelepiped).invert(); 619 a.MatrixMultiplication(parallelepiped);607 Vector a = parallelepiped * ((*this)-offset); 620 608 bool isInside = true; 621 609 -
src/vector.hpp
r4d206f r5108e1 60 60 void ScaleAll(const double *factor); 61 61 void Scale(const double factor); 62 void MatrixMultiplication(const Matrix &M);63 62 bool GetOneNormalVector(const Vector &x1); 64 63 bool MakeNormalTo(const Vector &y1);
Note:
See TracChangeset
for help on using the changeset viewer.