- Timestamp:
- Oct 6, 2011, 7:11:55 AM (13 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:
- 8b8a5b
- Parents:
- 8990879
- git-author:
- Frederik Heber <heber@…> (04/30/11 13:10:10)
- git-committer:
- Frederik Heber <heber@…> (10/06/11 07:11:55)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/PdbParser.cpp
r8990879 r473237 382 382 * Note that ListOfBonds of WorldTime::CurrentTime is used. 383 383 * 384 * Also, we fill up the CONECT line to extend over 80 chars. 385 * 384 386 * \param *file where to write neighbor information to 385 387 * \param MaxnumberOfNeighbors of neighbors … … 388 390 void PdbParser::writeNeighbors(ostream* file, int MaxnumberOfNeighbors, atom* currentAtom) { 389 391 int MaxNo = MaxnumberOfNeighbors; 392 int charsleft = 80; 390 393 const BondList & ListOfBonds = currentAtom->getListOfBonds(); 391 394 if (!ListOfBonds.empty()) { … … 394 397 *file << "CONECT"; 395 398 *file << setw(5) << getSerial(currentAtom->getId()); 399 charsleft = 80-6-5; 396 400 MaxNo = 0; 397 401 } 398 402 *file << setw(5) << getSerial((*currentBond)->GetOtherAtom(currentAtom)->getId()); 403 charsleft -= 5; 399 404 MaxNo++; 400 if (MaxNo == MaxnumberOfNeighbors) 405 if (MaxNo == MaxnumberOfNeighbors) { 406 for (;charsleft > 0; charsleft--) 407 *file << ' '; 401 408 *file << "\n"; 409 } 402 410 } 403 if (MaxNo != MaxnumberOfNeighbors) 411 if (MaxNo != MaxnumberOfNeighbors) { 412 for (;charsleft > 0; charsleft--) 413 *file << ' '; 404 414 *file << "\n"; 415 } 405 416 } 406 417 } … … 688 699 ASSERT(length >=16, 689 700 "PdbParser::readNeighbors() - CONECT entry has not enough entries: "+line+"!"); 690 //output = "Split line:|";691 //output += line.substr(6,5) + "|";701 output = "Split line:|"; 702 output += line.substr(6,5) + "|"; 692 703 const size_t id = toSize_t(line.substr(6,5)); 693 704 for (size_t index = 11; index <= 26; index+=5) { 694 705 if (index+5 <= length) { 695 // output += line.substr(index,5) + "|"; 696 const size_t otherid = toSize_t(line.substr(index,5)); 697 ListOfNeighbors.push_back(otherid); 706 output += line.substr(index,5) + "|"; 707 // search for digits 708 int otherid = -1; 709 PdbAtomInfoContainer::ScanKey(otherid, line.substr(index,5)); 710 if (otherid >= 0) 711 ListOfNeighbors.push_back((size_t)otherid); 698 712 } else { 699 713 break; 700 714 } 701 715 } 702 // DoLog(2) && (Log() << Verbose(2) << output << std::endl);716 LOG(4, output); 703 717 704 718 // add neighbours 705 719 atom *_atom = World::getInstance().getAtom(AtomById(getSerial(id))); 720 LOG(2, "STATUS: Atom " << _atom->getId() << " gets " << ListOfNeighbors.size() << " more neighbours."); 706 721 for (std::list<size_t>::const_iterator iter = ListOfNeighbors.begin(); 707 722 iter != ListOfNeighbors.end(); 708 723 ++iter) { 709 // DoLog(1) && (Log() << Verbose(1) << "Adding Bond (" << getAtomId(id) << "," << getAtomId(*iter) << ")" << std::endl);710 724 atom * const _Otheratom = World::getInstance().getAtom(AtomById(getSerial(*iter))); 725 LOG(3, "INFO: Adding Bond (" << *_atom << "," << *_Otheratom << ")"); 711 726 _atom->addBond(_step, _Otheratom); 712 727 }
Note:
See TracChangeset
for help on using the changeset viewer.