Changeset a7b761b for src/config.cpp
- Timestamp:
- May 27, 2010, 10:46:54 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, Candidate_v1.7.0, Candidate_v1.7.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:
- 1024cb
- Parents:
- 8f215d (diff), 05a97c (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. - File:
-
- 1 edited
-
src/config.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
r8f215d ra7b761b 1547 1547 int AtomNo = -1; 1548 1548 int MolNo = 0; 1549 atom *Walker = NULL;1550 1549 FILE *f = NULL; 1551 1550 … … 1560 1559 fprintf(f, "# Created by MoleCuilder\n"); 1561 1560 1562 for (MoleculeList::const_iterator Runner = MolList->ListOfMolecules.begin(); Runner != MolList->ListOfMolecules.end(); Runner++) { 1563 Walker = (*Runner)->start; 1561 for (MoleculeList::const_iterator MolRunner = MolList->ListOfMolecules.begin(); MolRunner != MolList->ListOfMolecules.end(); MolRunner++) { 1564 1562 int *elementNo = Calloc<int>(MAX_ELEMENTS, "config::SavePDB - elementNo"); 1565 1563 AtomNo = 0; 1566 while (Walker->next != (*Runner)->end) { 1567 Walker = Walker->next; 1568 sprintf(name, "%2s%2d",Walker->type->symbol, elementNo[Walker->type->Z]); 1569 elementNo[Walker->type->Z] = (elementNo[Walker->type->Z]+1) % 100; // confine to two digits 1564 for (molecule::const_iterator iter = (*MolRunner)->begin(); iter != (*MolRunner)->end(); ++iter) { 1565 sprintf(name, "%2s%2d",(*iter)->type->symbol, elementNo[(*iter)->type->Z]); 1566 elementNo[(*iter)->type->Z] = (elementNo[(*iter)->type->Z]+1) % 100; // confine to two digits 1570 1567 fprintf(f, 1571 1568 "ATOM %6u %-4s %4s%c%4u %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%2s\n", 1572 Walker->nr, /* atom serial number */1569 (*iter)->nr, /* atom serial number */ 1573 1570 name, /* atom name */ 1574 (* Runner)->name, /* residue name */1571 (*MolRunner)->name, /* residue name */ 1575 1572 'a'+(unsigned char)(AtomNo % 26), /* letter for chain */ 1576 1573 MolNo, /* residue sequence number */ 1577 Walker->node->at(0), /* position X in Angstroem */1578 Walker->node->at(1), /* position Y in Angstroem */1579 Walker->node->at(2), /* position Z in Angstroem */1580 (double) Walker->type->Valence, /* occupancy */1581 (double) Walker->type->NoValenceOrbitals, /* temperature factor */1574 (*iter)->node->at(0), /* position X in Angstroem */ 1575 (*iter)->node->at(1), /* position Y in Angstroem */ 1576 (*iter)->node->at(2), /* position Z in Angstroem */ 1577 (double)(*iter)->type->Valence, /* occupancy */ 1578 (double)(*iter)->type->NoValenceOrbitals, /* temperature factor */ 1582 1579 "0", /* segment identifier */ 1583 Walker->type->symbol, /* element symbol */1580 (*iter)->type->symbol, /* element symbol */ 1584 1581 "0"); /* charge */ 1585 1582 AtomNo++; … … 1601 1598 { 1602 1599 int AtomNo = -1; 1603 atom *Walker = NULL;1604 1600 FILE *f = NULL; 1605 1601 … … 1616 1612 fprintf(f, "# Created by MoleCuilder\n"); 1617 1613 1618 Walker = mol->start;1619 1614 AtomNo = 0; 1620 while (Walker->next != mol->end) { 1621 Walker = Walker->next; 1622 sprintf(name, "%2s%2d",Walker->type->symbol, elementNo[Walker->type->Z]); 1623 elementNo[Walker->type->Z] = (elementNo[Walker->type->Z]+1) % 100; // confine to two digits 1615 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1616 sprintf(name, "%2s%2d",(*iter)->type->symbol, elementNo[(*iter)->type->Z]); 1617 elementNo[(*iter)->type->Z] = (elementNo[(*iter)->type->Z]+1) % 100; // confine to two digits 1624 1618 fprintf(f, 1625 1619 "ATOM %6u %-4s %4s%c%4u %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%2s\n", 1626 Walker->nr, /* atom serial number */1620 (*iter)->nr, /* atom serial number */ 1627 1621 name, /* atom name */ 1628 1622 mol->name, /* residue name */ 1629 1623 'a'+(unsigned char)(AtomNo % 26), /* letter for chain */ 1630 1624 0, /* residue sequence number */ 1631 Walker->node->at(0), /* position X in Angstroem */1632 Walker->node->at(1), /* position Y in Angstroem */1633 Walker->node->at(2), /* position Z in Angstroem */1634 (double) Walker->type->Valence, /* occupancy */1635 (double) Walker->type->NoValenceOrbitals, /* temperature factor */1625 (*iter)->node->at(0), /* position X in Angstroem */ 1626 (*iter)->node->at(1), /* position Y in Angstroem */ 1627 (*iter)->node->at(2), /* position Z in Angstroem */ 1628 (double)(*iter)->type->Valence, /* occupancy */ 1629 (double)(*iter)->type->NoValenceOrbitals, /* temperature factor */ 1636 1630 "0", /* segment identifier */ 1637 Walker->type->symbol, /* element symbol */1631 (*iter)->type->symbol, /* element symbol */ 1638 1632 "0"); /* charge */ 1639 1633 AtomNo++; … … 1653 1647 bool config::SaveTREMOLO(const char * const filename, const molecule * const mol) const 1654 1648 { 1655 atom *Walker = NULL;1656 1649 ofstream *output = NULL; 1657 1650 stringstream * const fname = new stringstream; … … 1666 1659 1667 1660 // scan maximum number of neighbours 1668 Walker = mol->start;1669 1661 int MaxNeighbours = 0; 1670 while (Walker->next != mol->end) { 1671 Walker = Walker->next; 1672 const int count = Walker->ListOfBonds.size(); 1662 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1663 const int count = (*iter)->ListOfBonds.size(); 1673 1664 if (MaxNeighbours < count) 1674 1665 MaxNeighbours = count; 1675 1666 } 1676 *output << "# ATOMDATA Id name resName resSeq x=3 charge type neighbors=" << MaxNeighbours << endl; 1677 1678 Walker = mol->start; 1679 while (Walker->next != mol->end) { 1680 Walker = Walker->next; 1681 *output << Walker->nr << "\t"; 1682 *output << Walker->getName() << "\t"; 1667 *output << "# ATOMDATA Id name resName resSeq x=3 Charge type neighbors=" << MaxNeighbours << endl; 1668 1669 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1670 *output << (*iter)->nr << "\t"; 1671 *output << (*iter)->getName() << "\t"; 1683 1672 *output << mol->name << "\t"; 1684 1673 *output << 0 << "\t"; 1685 *output << Walker->node->at(0) << "\t" << Walker->node->at(1) << "\t" << Walker->node->at(2) << "\t";1686 *output << static_cast<double>( Walker->type->Valence) << "\t";1687 *output << Walker->type->symbol << "\t";1688 for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++)1689 *output << (*runner)->GetOtherAtom( Walker)->nr << "\t";1690 for(int i= Walker->ListOfBonds.size(); i < MaxNeighbours; i++)1674 *output << (*iter)->node->at(0) << "\t" << (*iter)->node->at(1) << "\t" << (*iter)->node->at(2) << "\t"; 1675 *output << static_cast<double>((*iter)->type->Valence) << "\t"; 1676 *output << (*iter)->type->symbol << "\t"; 1677 for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++) 1678 *output << (*runner)->GetOtherAtom(*iter)->nr << "\t"; 1679 for(int i=(*iter)->ListOfBonds.size(); i < MaxNeighbours; i++) 1691 1680 *output << "-\t"; 1692 1681 *output << endl; … … 1708 1697 bool config::SaveTREMOLO(const char * const filename, const MoleculeListClass * const MolList) const 1709 1698 { 1710 atom *Walker = NULL;1711 1699 ofstream *output = NULL; 1712 1700 stringstream * const fname = new stringstream; … … 1723 1711 int MaxNeighbours = 0; 1724 1712 for (MoleculeList::const_iterator MolWalker = MolList->ListOfMolecules.begin(); MolWalker != MolList->ListOfMolecules.end(); MolWalker++) { 1725 Walker = (*MolWalker)->start; 1726 while (Walker->next != (*MolWalker)->end) { 1727 Walker = Walker->next; 1728 const int count = Walker->ListOfBonds.size(); 1713 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 1714 const int count = (*iter)->ListOfBonds.size(); 1729 1715 if (MaxNeighbours < count) 1730 1716 MaxNeighbours = count; 1731 1717 } 1732 1718 } 1733 *output << "# ATOMDATA Id name resName resSeq x=3 charge type neighbors=" << MaxNeighbours << endl;1719 *output << "# ATOMDATA Id name resName resSeq x=3 Charge type neighbors=" << MaxNeighbours << endl; 1734 1720 1735 1721 // create global to local id map … … 1752 1738 int AtomNo = 0; 1753 1739 for (MoleculeList::const_iterator MolWalker = MolList->ListOfMolecules.begin(); MolWalker != MolList->ListOfMolecules.end(); MolWalker++) { 1754 Walker = (*MolWalker)->start; 1755 while (Walker->next != (*MolWalker)->end) { 1756 Walker = Walker->next; 1740 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 1757 1741 *output << AtomNo+1 << "\t"; 1758 *output << Walker->getName() << "\t";1742 *output << (*iter)->getName() << "\t"; 1759 1743 *output << (*MolWalker)->name << "\t"; 1760 1744 *output << MolCounter+1 << "\t"; 1761 *output << Walker->node->at(0) << "\t" << Walker->node->at(1) << "\t" << Walker->node->at(2) << "\t";1762 *output << (double) Walker->type->Valence << "\t";1763 *output << Walker->type->symbol << "\t";1764 for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++)1765 *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom( Walker)->nr ]+1 << "\t";1766 for(int i= Walker->ListOfBonds.size(); i < MaxNeighbours; i++)1745 *output << (*iter)->node->at(0) << "\t" << (*iter)->node->at(1) << "\t" << (*iter)->node->at(2) << "\t"; 1746 *output << (double)(*iter)->type->Valence << "\t"; 1747 *output << (*iter)->type->symbol << "\t"; 1748 for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++) 1749 *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom(*iter)->nr ]+1 << "\t"; 1750 for(int i=(*iter)->ListOfBonds.size(); i < MaxNeighbours; i++) 1767 1751 *output << "-\t"; 1768 1752 *output << endl;
Note:
See TracChangeset
for help on using the changeset viewer.
