Changeset 8de375 for src/molecule.cpp
- Timestamp:
- May 19, 2010, 6:46:52 PM (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, 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:
- 0fb9f6
- Parents:
- eff648 (diff), bab12a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - git-author:
- Frederik Heber <heber@…> (05/19/10 18:45:23)
- git-committer:
- Frederik Heber <heber@…> (05/19/10 18:46:52)
- File:
-
- 1 edited
-
src/molecule.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/molecule.cpp
reff648 r8de375 135 135 if (pointer->type->Z != 1) 136 136 NoNonHydrogen++; 137 if (pointer->Name == NULL){138 Free(&pointer->Name);139 pointer->Name = Malloc<char>(6, "molecule::AddAtom: *pointer->Name");140 sprintf(pointer->Name, "%2s%02d", pointer->type->symbol, pointer->nr+1);137 if(pointer->getName() == "Unknown"){ 138 stringstream sstr; 139 sstr << pointer->type->symbol << pointer->nr+1; 140 pointer->setName(sstr.str()); 141 141 } 142 142 } … … 157 157 if (pointer != NULL) { 158 158 atom *walker = pointer->clone(); 159 walker->Name = Malloc<char>(strlen(pointer->Name) + 1, "atom::atom: *Name"); 160 strcpy (walker->Name, pointer->Name); 159 stringstream sstr; 160 sstr << pointer->getName(); 161 walker->setName(sstr.str()); 161 162 walker->nr = last_atom++; // increase number within molecule 162 163 add(walker, end); … … 252 253 BondRescale = TopOrigin->type->HBondDistance[TopBond->BondDegree-1]; 253 254 if (BondRescale == -1) { 254 DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin-> Name << "<->" << TopReplacement->Name<< ") of degree " << TopBond->BondDegree << "!" << endl);255 DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->getName() << "<->" << TopReplacement->getName() << ") of degree " << TopBond->BondDegree << "!" << endl); 255 256 return false; 256 257 BondRescale = bondlength; … … 275 276 InBondvector *= BondRescale; // rescale the distance vector to Hydrogen bond length 276 277 FirstOtherAtom->x = TopOrigin->x; // set coordination to origin ... 277 FirstOtherAtom->x = InBondvector; // ... and add distance vector to replacement atom278 FirstOtherAtom->x += InBondvector; // ... and add distance vector to replacement atom 278 279 AllWentWell = AllWentWell && AddAtom(FirstOtherAtom); 279 280 // Log() << Verbose(4) << "Added " << *FirstOtherAtom << " at: "; … … 295 296 SecondOtherAtom = (*Runner)->GetOtherAtom(TopOrigin); 296 297 } else { 297 DoeLog(2) && (eLog()<< Verbose(2) << "Detected more than four bonds for atom " << TopOrigin-> Name);298 DoeLog(2) && (eLog()<< Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->getName()); 298 299 } 299 300 } … … 339 340 bondangle = TopOrigin->type->HBondAngle[1]; 340 341 if (bondangle == -1) { 341 DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin-> Name << "<->" << TopReplacement->Name<< ") of degree " << TopBond->BondDegree << "!" << endl);342 DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->getName() << "<->" << TopReplacement->getName() << ") of degree " << TopBond->BondDegree << "!" << endl); 342 343 return false; 343 344 bondangle = 0; … … 616 617 add(Binder, last); 617 618 } else { 618 DoeLog(1) && (eLog()<< Verbose(1) << "Could not add bond between " << atom1-> Name << " and " << atom2->Name<< " as one or both are not present in the molecule." << endl);619 DoeLog(1) && (eLog()<< Verbose(1) << "Could not add bond between " << atom1->getName() << " and " << atom2->getName() << " as one or both are not present in the molecule." << endl); 619 620 } 620 621 return Binder; … … 695 696 AtomCount--; 696 697 } else 697 DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer-> Name<< " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);698 DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->getName() << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl); 698 699 if (ElementsInMolecule[pointer->type->Z] == 0) // was last atom of this element? 699 700 ElementCount--; … … 713 714 ElementsInMolecule[pointer->type->Z]--; // decrease number of atom of this element 714 715 else 715 DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer-> Name<< " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);716 DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->getName() << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl); 716 717 if (ElementsInMolecule[pointer->type->Z] == 0) // was last atom of this element? 717 718 ElementCount--; … … 915 916 if (Walker->type->Z != 1) // count non-hydrogen atoms whilst at it 916 917 NoNonHydrogen++; 917 Free(&Walker->Name);918 Walker->Name = Malloc<char>(6, "molecule::CountAtoms: *walker->Name");919 sprintf(Walker->Name, "%2s%02d", Walker->type->symbol, Walker->nr+1);920 DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << Walker->nr << " " << Walker-> Name<< "." << endl);918 stringstream sstr; 919 sstr << Walker->type->symbol << Walker->nr+1; 920 Walker->setName(sstr.str()); 921 DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << Walker->nr << " " << Walker->getName() << "." << endl); 921 922 i++; 922 923 }
Note:
See TracChangeset
for help on using the changeset viewer.
