Ignore:
Timestamp:
Jul 31, 2010, 3:23:10 PM (15 years ago)
Author:
Frederik Heber <heber@…>
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, Candidate_v1.7.0, 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:
8f4df1
Parents:
5fbaeb
Message:

Member variable Vector and element of class atom are now private.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/analysis_bonds.cpp

    r5fbaeb rd74077  
    6060  int AtomNo = 0;
    6161  for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    62     if ((*iter)->type == type1)
     62    if ((*iter)->getType() == type1)
    6363      for (BondList::const_iterator BondRunner = (*iter)->ListOfBonds.begin(); BondRunner != (*iter)->ListOfBonds.end(); BondRunner++)
    64         if ((*BondRunner)->GetOtherAtom((*iter))->type == type2) {
     64        if ((*BondRunner)->GetOtherAtom((*iter))->getType() == type2) {
    6565          const double distance = (*BondRunner)->GetDistanceSquared();
    6666          if (Min > distance)
     
    8787 * \return angle between \a *first and \a *second, both relative to origin at \a *origin.
    8888 */
    89 double CalculateAngle(Vector *first, Vector *central, Vector *second)
     89double CalculateAngle(const Vector &first, const Vector &central, const Vector &second)
    9090{
    9191  Vector OHBond;
    9292  Vector OOBond;
    9393
    94   OHBond = (*first) - (*central);
    95   OOBond = (*second) - (*central);
     94  OHBond = first - central;
     95  OOBond = second - central;
    9696  const double angle = OHBond.Angle(OOBond);
    9797  return angle;
     
    110110
    111111  // check angle
    112   if (CalculateAngle(&Hydrogen->x, &Oxygen->x, &OtherOxygen->x) < M_PI*(30./180.)) {
     112  if (CalculateAngle(Hydrogen->getPosition(), Oxygen->getPosition(), OtherOxygen->getPosition()) < M_PI*(30./180.)) {
    113113    return true;
    114114  } else {
     
    138138        molecule::iterator Runner = (*MolRunner)->begin();
    139139        for(;Runner!=(*MolRunner)->end();++Runner){
    140           if (((*Walker)->type->Z  == 8) && ((*Runner)->type->Z  == 8)) {
     140          if (((*Walker)->getType()->Z  == 8) && ((*Runner)->getType()->Z  == 8)) {
    141141            // check distance
    142             const double distance = (*Runner)->x.DistanceSquared((*Walker)->x);
     142            const double distance = (*Runner)->DistanceSquared(*(*Walker));
    143143            if ((distance > MYEPSILON) && (distance < HBRIDGEDISTANCE*HBRIDGEDISTANCE)) { // distance >0 means  different atoms
    144144              // on other atom(Runner) we check for bond to interface element and
     
    152152                atom * const OtherAtom = (*BondRunner)->GetOtherAtom(*Runner);
    153153                // if hydrogen, check angle to be greater(!) than 30 degrees
    154                 if (OtherAtom->type->Z == 1) {
    155                   const double angle = CalculateAngle(&OtherAtom->x, &(*Runner)->x, &(*Walker)->x);
     154                if (OtherAtom->getType()->Z == 1) {
     155                  const double angle = CalculateAngle(OtherAtom->getPosition(), (*Runner)->getPosition(), (*Walker)->getPosition());
    156156                  OtherHydrogenFlag = OtherHydrogenFlag && (angle > M_PI*(30./180.) + MYEPSILON);
    157157                  Otherangle += angle;
    158158                  OtherHydrogens++;
    159159                }
    160                 InterfaceFlag = InterfaceFlag || (OtherAtom->type == InterfaceElement);
    161                 Interface2Flag = Interface2Flag || (OtherAtom->type == Interface2Element);
     160                InterfaceFlag = InterfaceFlag || (OtherAtom->getType() == InterfaceElement);
     161                Interface2Flag = Interface2Flag || (OtherAtom->getType() == Interface2Element);
    162162              }
    163163              DoLog(1) && (Log() << Verbose(1) << "Otherangle is " << Otherangle << " for " << OtherHydrogens << " hydrogens." << endl);
     
    177177                for (BondList::const_iterator BondRunner = (*Walker)->ListOfBonds.begin(); BondRunner != (*Walker)->ListOfBonds.end(); BondRunner++) {
    178178                  atom * const OtherAtom = (*BondRunner)->GetOtherAtom(*Walker);
    179                   if (OtherAtom->type->Z == 1) {
     179                  if (OtherAtom->getType()->Z == 1) {
    180180                    // check angle
    181181                    if (CheckHydrogenBridgeBondAngle(*Walker, OtherAtom, *Runner)) {
    182                       DoLog(1) && (Log() << Verbose(1) << (*Walker)->getName() << ", " << OtherAtom->getName() << " and " << (*Runner)->getName() << " has a hydrogen bridge bond with distance " << sqrt(distance) << " and angle " << CalculateAngle(&OtherAtom->x, &(*Walker)->x, &(*Runner)->x)*(180./M_PI) << "." << endl);
     182                      DoLog(1) && (Log() << Verbose(1) << (*Walker)->getName() << ", " << OtherAtom->getName() << " and " << (*Runner)->getName() << " has a hydrogen bridge bond with distance " << sqrt(distance) << " and angle " << CalculateAngle(OtherAtom->getPosition(), (*Walker)->getPosition(), (*Runner)->getPosition())*(180./M_PI) << "." << endl);
    183183                      count++;
    184184                      break;
     
    210210    for(;Walker!=(*MolWalker)->end();++Walker){
    211211      atom * theAtom = *Walker;
    212       if ((theAtom->type == first) || (theAtom->type == second)) {  // first element matches
     212      if ((theAtom->getType() == first) || (theAtom->getType() == second)) {  // first element matches
    213213        for (BondList::const_iterator BondRunner = theAtom->ListOfBonds.begin(); BondRunner != theAtom->ListOfBonds.end(); BondRunner++) {
    214214          atom * const OtherAtom = (*BondRunner)->GetOtherAtom(theAtom);
    215           if (((OtherAtom->type == first) || (OtherAtom->type == second)) && (theAtom->nr < OtherAtom->nr)) {
     215          if (((OtherAtom->getType() == first) || (OtherAtom->getType() == second)) && (theAtom->nr < OtherAtom->nr)) {
    216216            count++;
    217217            DoLog(1) && (Log() << Verbose(1) << first->name << "-" << second->name << " bond found between " << *Walker << " and " << *OtherAtom << "." << endl);
     
    246246    for(;Walker!=(*MolWalker)->end();++Walker){
    247247      atom *theAtom = *Walker;
    248       if (theAtom->type == second) {  // first element matches
     248      if (theAtom->getType() == second) {  // first element matches
    249249        for (int i=0;i<2;i++)
    250250          MatchFlag[i] = false;
     
    252252          atom * const OtherAtom = (*BondRunner)->GetOtherAtom(theAtom);
    253253          for (int i=0;i<2;i++)
    254             if ((!MatchFlag[i]) && (OtherAtom->type == ElementArray[i])) {
     254            if ((!MatchFlag[i]) && (OtherAtom->getType() == ElementArray[i])) {
    255255              MatchFlag[i] = true;
    256256              break;  // each bonding atom can match at most one element we are looking for
Note: See TracChangeset for help on using the changeset viewer.