Changeset e9b8bb for src/molecules.cpp
- Timestamp:
- Aug 6, 2008, 9:02:01 AM (16 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:
- 5e0d1f
- Parents:
- d7e30c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecules.cpp
rd7e30c re9b8bb 18 18 double sum = 0.; 19 19 struct LSQ_params *par = (struct LSQ_params *)params; 20 vector **vectors = par->vectors;20 Vector **vectors = par->vectors; 21 21 int num = par->num; 22 22 … … 180 180 atom *FirstOtherAtom = NULL, *SecondOtherAtom = NULL, *ThirdOtherAtom = NULL; // pointer to hydrogen atoms to be added 181 181 double b,l,d,f,g, alpha, factors[NDIM]; // hold temporary values in triple bond case for coordination determination 182 vector Orthovector1, Orthovector2; // temporary vectors in coordination construction183 vector InBondvector; // vector in direction of *Bond182 Vector Orthovector1, Orthovector2; // temporary vectors in coordination construction 183 Vector InBondvector; // vector in direction of *Bond 184 184 bond *Binder = NULL; 185 185 double *matrix; … … 587 587 * \param *dim vector class 588 588 */ 589 void molecule::SetBoxDimension( vector *dim)589 void molecule::SetBoxDimension(Vector *dim) 590 590 { 591 591 cell_size[0] = dim->x[0]; … … 601 601 * \param *BoxLengths box lengths 602 602 */ 603 bool molecule::CenterInBox(ofstream *out, vector *BoxLengths)603 bool molecule::CenterInBox(ofstream *out, Vector *BoxLengths) 604 604 { 605 605 bool status = true; 606 606 atom *ptr = NULL; 607 vector *min = new vector;608 vector *max = new vector;607 Vector *min = new Vector; 608 Vector *max = new Vector; 609 609 610 610 // gather min and max for each axis … … 651 651 * \param *max coordinates of other edge, specifying box dimensions. 652 652 */ 653 void molecule::CenterEdge(ofstream *out, vector *max)654 { 655 vector *min = new vector;653 void molecule::CenterEdge(ofstream *out, Vector *max) 654 { 655 Vector *min = new Vector; 656 656 657 657 // *out << Verbose(3) << "Begin of CenterEdge." << endl; … … 690 690 * \param *center return vector for translation vector 691 691 */ 692 void molecule::CenterOrigin(ofstream *out, vector *center)692 void molecule::CenterOrigin(ofstream *out, Vector *center) 693 693 { 694 694 int Num = 0; … … 713 713 * \return pointer to center of gravity vector 714 714 */ 715 vector * molecule::DetermineCenterOfGravity(ofstream *out)715 Vector * molecule::DetermineCenterOfGravity(ofstream *out) 716 716 { 717 717 atom *ptr = start->next; // start at first in list 718 vector *a = new vector();719 vector tmp;718 Vector *a = new Vector(); 719 Vector tmp; 720 720 double Num = 0; 721 721 … … 742 742 * \param *center return vector for translation vector 743 743 */ 744 void molecule::CenterGravity(ofstream *out, vector *center)744 void molecule::CenterGravity(ofstream *out, Vector *center) 745 745 { 746 746 if (center == NULL) { … … 769 769 * \param trans[] translation vector. 770 770 */ 771 void molecule::Translate(const vector *trans)771 void molecule::Translate(const Vector *trans) 772 772 { 773 773 atom *ptr = start; … … 782 782 * \param n[] normal vector of mirror plane. 783 783 */ 784 void molecule::Mirror(const vector *n)784 void molecule::Mirror(const Vector *n) 785 785 { 786 786 atom *ptr = start; … … 795 795 * \param Center reference to return vector 796 796 */ 797 void molecule::DetermineCenter( vector &Center)797 void molecule::DetermineCenter(Vector &Center) 798 798 { 799 799 atom *Walker = start; … … 802 802 double tmp; 803 803 bool flag; 804 vector Testvector, Translationvector;804 Vector Testvector, Translationvector; 805 805 806 806 do { … … 867 867 atom *ptr = start; // start at first in list 868 868 double InertiaTensor[NDIM*NDIM]; 869 vector *CenterOfGravity = DetermineCenterOfGravity(out);869 Vector *CenterOfGravity = DetermineCenterOfGravity(out); 870 870 871 871 CenterGravity(out, CenterOfGravity); … … 878 878 while (ptr->next != end) { 879 879 ptr = ptr->next; 880 vector x;880 Vector x; 881 881 x.CopyVector(&ptr->x); 882 882 //x.SubtractVector(CenterOfGravity); … … 934 934 while (ptr->next != end) { 935 935 ptr = ptr->next; 936 vector x;936 Vector x; 937 937 x.CopyVector(&ptr->x); 938 938 //x.SubtractVector(CenterOfGravity); … … 1060 1060 * \param n[] alignment vector. 1061 1061 */ 1062 void molecule::Align( vector *n)1062 void molecule::Align(Vector *n) 1063 1063 { 1064 1064 atom *ptr = start; 1065 1065 double alpha, tmp; 1066 vector z_axis;1066 Vector z_axis; 1067 1067 z_axis.x[0] = 0.; 1068 1068 z_axis.x[1] = 0.; … … 1168 1168 * \return true - is within, false - out of cell 1169 1169 */ 1170 bool molecule::CheckBounds(const vector *x) const1170 bool molecule::CheckBounds(const Vector *x) const 1171 1171 { 1172 1172 bool result = true; … … 1188 1188 { 1189 1189 double res = 0, t; 1190 vector a,b,c,d;1190 Vector a,b,c,d; 1191 1191 struct lsq_params *par = (struct lsq_params *)params; 1192 1192 atom *ptr = par->mol->start; … … 1209 1209 d.Scale(&t); 1210 1210 c.SubtractVector(&d); // ... yielding distance vector 1211 res += d.ScalarProduct((const vector *)&d); // add squared distance1211 res += d.ScalarProduct((const Vector *)&d); // add squared distance 1212 1212 } 1213 1213 } … … 1542 1542 double distance, MinDistance, MaxDistance; 1543 1543 double *matrix = ReturnFullMatrixforSymmetric(cell_size); 1544 vector x;1544 Vector x; 1545 1545 1546 1546 BondDistance = bonddistance; // * ((IsAngstroem) ? 1. : 1./AtomicLengthToAngstroem); … … 3925 3925 enum Shading *ColorList = NULL; 3926 3926 double tmp; 3927 vector Translationvector;3927 Vector Translationvector; 3928 3928 //class StackClass<atom *> *CompStack = NULL; 3929 3929 class StackClass<atom *> *AtomStack = new StackClass<atom *>(AtomCount); … … 4326 4326 int flag; 4327 4327 double *Distances = NULL, *OtherDistances = NULL; 4328 vector CenterOfGravity, OtherCenterOfGravity;4328 Vector CenterOfGravity, OtherCenterOfGravity; 4329 4329 size_t *PermMap = NULL, *OtherPermMap = NULL; 4330 4330 int *PermutationMap = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.