Ignore:
Timestamp:
Apr 13, 2010, 1:22:42 PM (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:
1bd79e
Parents:
72e7fa
Message:

Prepared interface of Vector Class for transition to VectorComposites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Legacy/oldmenu.cpp

    r72e7fa r273382  
    103103          dialog->queryVector("Enter reference coordinates.",&x,mol->cell_size,true);
    104104          dialog->queryVector("Enter relative coordinates.",&first->x,mol->cell_size,false);
    105           first->x.AddVector(&x);
     105          first->x += x;
    106106          dialog->display();
    107107          delete dialog;
     
    168168          */
    169169          // calc axis vector
    170           x.CopyVector(&second->x);
    171           x.SubtractVector(&third->x);
     170          x= second->x - third->x;
    172171          x.Normalize();
    173172          Log() << Verbose(0) << "x: " << x << endl;
     
    178177
    179178          // rotate vector around first angle
    180           first->x.CopyVector(&x);
     179          first->x = x;
    181180          first->x = RotateVector(first->x,z,b - M_PI);
    182181          Log() << Verbose(0) << "Rotated vector: " << first->x << endl,
    183182          // remove the projection onto the rotation plane of the second angle
    184           n.CopyVector(&y);
    185           n.Scale(first->x.ScalarProduct(&y));
     183          n = y;
     184          n.Scale(first->x.ScalarProduct(y));
    186185          Log() << Verbose(0) << "N1: " << n << endl;
    187           first->x.SubtractVector(&n);
     186          first->x -= n;
    188187          Log() << Verbose(0) << "Subtracted vector: " << first->x << endl;
    189           n.CopyVector(&z);
    190           n.Scale(first->x.ScalarProduct(&z));
     188          n = z;
     189          n.Scale(first->x.ScalarProduct(z));
    191190          Log() << Verbose(0) << "N2: " << n << endl;
    192           first->x.SubtractVector(&n);
     191          first->x -= n;
    193192          Log() << Verbose(0) << "2nd subtracted vector: " << first->x << endl;
    194193
    195194          // rotate another vector around second angle
    196           n.CopyVector(&y);
     195          n = y;
    197196          n = RotateVector(n,x,c - M_PI);
    198197          Log() << Verbose(0) << "2nd Rotated vector: " << n << endl;
    199198
    200199          // add the two linear independent vectors
    201           first->x.AddVector(&n);
     200          first->x += n;
    202201          first->x.Normalize();
    203202          first->x.Scale(a);
    204           first->x.AddVector(&second->x);
     203          first->x += second->x;
    205204
    206205          Log() << Verbose(0) << "resulting coordinates: " << first->x << endl;
     
    277276      }
    278277      mol->CenterEdge(&x);  // make every coordinate positive
    279       mol->Center.AddVector(&y); // translate by boundary
    280       helper.CopyVector(&y);
    281       helper.Scale(2.);
    282       helper.AddVector(&x);
     278      mol->Center += y; // translate by boundary
     279      helper = (2*y)+x;
    283280      mol->SetBoxDimension(&helper);  // update Box of atoms by boundary
    284281      break;
     
    340337      second = mol->AskAtom("Enter second atom: ");
    341338
    342       n.CopyVector((const Vector *)&first->x);
    343       n.SubtractVector((const Vector *)&second->x);
     339      n = first->x - second->x;
    344340      n.Normalize();
    345341      break;
     
    408404      second = mol->AskAtom("Enter second atom: ");
    409405
    410       n.CopyVector((const Vector *)&first->x);
    411       n.SubtractVector((const Vector *)&second->x);
     406      n = first->x - second->x;
    412407      n.Normalize();
    413408      break;
     
    453448        first = second;
    454449        second = first->next;
    455         if (first->x.DistanceSquared((const Vector *)&second->x) > tmp1*tmp1) // distance to first above radius ...
     450        if (first->x.DistanceSquared(second->x) > tmp1*tmp1) // distance to first above radius ...
    456451          mol->RemoveAtom(first);
    457452      }
     
    520515        tmp1 = 0.;
    521516        if (first != second) {
    522           x.CopyVector((const Vector *)&first->x);
    523           x.SubtractVector((const Vector *)&second->x);
     517          x = first->x - second->x;
    524518          tmp1 = x.Norm();
    525519        }
     
    536530      for (int i=NDIM;i--;)
    537531        min[i] = 0.;
    538       x.CopyVector((const Vector *)&first->x);
    539       x.SubtractVector((const Vector *)&second->x);
     532      x = first->x - second->x;
    540533      tmp1 = x.Norm();
    541534      Log() << Verbose(1) << "Distance vector is " << x << "." << "/n"
     
    549542      third  = mol->AskAtom("Enter last atom: ");
    550543      tmp1 = tmp2 = tmp3 = 0.;
    551       x.CopyVector((const Vector *)&first->x);
    552       x.SubtractVector((const Vector *)&second->x);
    553       y.CopyVector((const Vector *)&third->x);
    554       y.SubtractVector((const Vector *)&second->x);
     544      x = first->x - second->x;
     545      y = third->x - second->x;
    555546      Log() << Verbose(0) << "Bond angle between first atom Nr." << first->nr << ", central atom Nr." << second->nr << " and last atom Nr." << third->nr << ": ";
    556       Log() << Verbose(0) << (acos(x.ScalarProduct((const Vector *)&y)/(y.Norm()*x.Norm()))/M_PI*180.) << " degrees" << endl;
     547      Log() << Verbose(0) << (acos(x.ScalarProduct(y)/(y.Norm()*x.Norm()))/M_PI*180.) << " degrees" << endl;
    557548      break;
    558549    case 'd':
     
    777768      y[abs(axis)-1] = mol->cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] * abs(axis)/axis; // last term is for sign, first is for magnitude
    778769      for (int i=1;i<faktor;i++) {  // then add this list with respective translation factor times
    779         x.AddVector(&y); // per factor one cell width further
     770        x += y; // per factor one cell width further
    780771        for (int k=count;k--;) { // go through every atom of the original cell
    781772          first = World::getInstance().createAtom(); // create a new body
    782           first->x.CopyVector(vectors[k]);  // use coordinate of original atom
    783           first->x.AddVector(&x);     // translate the coordinates
     773          first->x = (*vectors[k]) + x;  // use coordinate of original atom
    784774          first->type = Elements[k];  // insert original element
    785775          mol->AddAtom(first);        // and add to the molecule (which increments ElementsInMolecule, AtomCount, ...)
     
    793783      // correct cell size
    794784      if (axis < 0) { // if sign was negative, we have to translate everything
    795         x.Zero();
    796         x.AddVector(&y);
     785        x = y;
    797786        x.Scale(-(faktor-1));
    798787        mol->Translate(&x);
     
    894883        dialog->display();
    895884        delete dialog;
    896         mol->Center.AddVector((const Vector *)&x);
     885        mol->Center += x;
    897886     }
    898887     break;
Note: See TracChangeset for help on using the changeset viewer.