Changeset 1024cb for src/config.cpp
- Timestamp:
- May 31, 2010, 5:32:27 PM (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, 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:
- e08c46
- Parents:
- 42af9e (diff), a7b761b (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/31/10 17:29:30)
- git-committer:
- Frederik Heber <heber@…> (05/31/10 17:32:27)
- File:
-
- 1 edited
-
src/config.cpp (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
r42af9e r1024cb 1548 1548 int AtomNo = -1; 1549 1549 int MolNo = 0; 1550 atom *Walker = NULL;1551 1550 FILE *f = NULL; 1552 1551 … … 1561 1560 fprintf(f, "# Created by MoleCuilder\n"); 1562 1561 1563 for (MoleculeList::const_iterator Runner = MolList->ListOfMolecules.begin(); Runner != MolList->ListOfMolecules.end(); Runner++) { 1564 Walker = (*Runner)->start; 1562 for (MoleculeList::const_iterator MolRunner = MolList->ListOfMolecules.begin(); MolRunner != MolList->ListOfMolecules.end(); MolRunner++) { 1565 1563 int *elementNo = new int[MAX_ELEMENTS]; 1566 1564 for (int i=0;i<MAX_ELEMENTS;i++) 1567 1565 elementNo[i] = 0; 1568 1566 AtomNo = 0; 1569 while (Walker->next != (*Runner)->end) { 1570 Walker = Walker->next; 1571 sprintf(name, "%2s%2d",Walker->type->symbol, elementNo[Walker->type->Z]); 1572 elementNo[Walker->type->Z] = (elementNo[Walker->type->Z]+1) % 100; // confine to two digits 1567 for (molecule::const_iterator iter = (*MolRunner)->begin(); iter != (*MolRunner)->end(); ++iter) { 1568 sprintf(name, "%2s%2d",(*iter)->type->symbol, elementNo[(*iter)->type->Z]); 1569 elementNo[(*iter)->type->Z] = (elementNo[(*iter)->type->Z]+1) % 100; // confine to two digits 1573 1570 fprintf(f, 1574 1571 "ATOM %6u %-4s %4s%c%4u %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%2s\n", 1575 Walker->nr, /* atom serial number */1572 (*iter)->nr, /* atom serial number */ 1576 1573 name, /* atom name */ 1577 (* Runner)->name, /* residue name */1574 (*MolRunner)->name, /* residue name */ 1578 1575 'a'+(unsigned char)(AtomNo % 26), /* letter for chain */ 1579 1576 MolNo, /* residue sequence number */ 1580 Walker->node->at(0), /* position X in Angstroem */1581 Walker->node->at(1), /* position Y in Angstroem */1582 Walker->node->at(2), /* position Z in Angstroem */1583 (double) Walker->type->Valence, /* occupancy */1584 (double) Walker->type->NoValenceOrbitals, /* temperature factor */1577 (*iter)->node->at(0), /* position X in Angstroem */ 1578 (*iter)->node->at(1), /* position Y in Angstroem */ 1579 (*iter)->node->at(2), /* position Z in Angstroem */ 1580 (double)(*iter)->type->Valence, /* occupancy */ 1581 (double)(*iter)->type->NoValenceOrbitals, /* temperature factor */ 1585 1582 "0", /* segment identifier */ 1586 Walker->type->symbol, /* element symbol */1583 (*iter)->type->symbol, /* element symbol */ 1587 1584 "0"); /* charge */ 1588 1585 AtomNo++; … … 1604 1601 { 1605 1602 int AtomNo = -1; 1606 atom *Walker = NULL;1607 1603 FILE *f = NULL; 1608 1604 … … 1621 1617 fprintf(f, "# Created by MoleCuilder\n"); 1622 1618 1623 Walker = mol->start;1624 1619 AtomNo = 0; 1625 while (Walker->next != mol->end) { 1626 Walker = Walker->next; 1627 sprintf(name, "%2s%2d",Walker->type->symbol, elementNo[Walker->type->Z]); 1628 elementNo[Walker->type->Z] = (elementNo[Walker->type->Z]+1) % 100; // confine to two digits 1620 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1621 sprintf(name, "%2s%2d",(*iter)->type->symbol, elementNo[(*iter)->type->Z]); 1622 elementNo[(*iter)->type->Z] = (elementNo[(*iter)->type->Z]+1) % 100; // confine to two digits 1629 1623 fprintf(f, 1630 1624 "ATOM %6u %-4s %4s%c%4u %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%2s\n", 1631 Walker->nr, /* atom serial number */1625 (*iter)->nr, /* atom serial number */ 1632 1626 name, /* atom name */ 1633 1627 mol->name, /* residue name */ 1634 1628 'a'+(unsigned char)(AtomNo % 26), /* letter for chain */ 1635 1629 0, /* residue sequence number */ 1636 Walker->node->at(0), /* position X in Angstroem */1637 Walker->node->at(1), /* position Y in Angstroem */1638 Walker->node->at(2), /* position Z in Angstroem */1639 (double) Walker->type->Valence, /* occupancy */1640 (double) Walker->type->NoValenceOrbitals, /* temperature factor */1630 (*iter)->node->at(0), /* position X in Angstroem */ 1631 (*iter)->node->at(1), /* position Y in Angstroem */ 1632 (*iter)->node->at(2), /* position Z in Angstroem */ 1633 (double)(*iter)->type->Valence, /* occupancy */ 1634 (double)(*iter)->type->NoValenceOrbitals, /* temperature factor */ 1641 1635 "0", /* segment identifier */ 1642 Walker->type->symbol, /* element symbol */1636 (*iter)->type->symbol, /* element symbol */ 1643 1637 "0"); /* charge */ 1644 1638 AtomNo++; … … 1658 1652 bool config::SaveTREMOLO(const char * const filename, const molecule * const mol) const 1659 1653 { 1660 atom *Walker = NULL;1661 1654 ofstream *output = NULL; 1662 1655 stringstream * const fname = new stringstream; … … 1671 1664 1672 1665 // scan maximum number of neighbours 1673 Walker = mol->start;1674 1666 int MaxNeighbours = 0; 1675 while (Walker->next != mol->end) { 1676 Walker = Walker->next; 1677 const int count = Walker->ListOfBonds.size(); 1667 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1668 const int count = (*iter)->ListOfBonds.size(); 1678 1669 if (MaxNeighbours < count) 1679 1670 MaxNeighbours = count; 1680 1671 } 1681 *output << "# ATOMDATA Id name resName resSeq x=3 charge type neighbors=" << MaxNeighbours << endl; 1682 1683 Walker = mol->start; 1684 while (Walker->next != mol->end) { 1685 Walker = Walker->next; 1686 *output << Walker->nr << "\t"; 1687 *output << Walker->getName() << "\t"; 1672 *output << "# ATOMDATA Id name resName resSeq x=3 Charge type neighbors=" << MaxNeighbours << endl; 1673 1674 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1675 *output << (*iter)->nr << "\t"; 1676 *output << (*iter)->getName() << "\t"; 1688 1677 *output << mol->name << "\t"; 1689 1678 *output << 0 << "\t"; 1690 *output << Walker->node->at(0) << "\t" << Walker->node->at(1) << "\t" << Walker->node->at(2) << "\t";1691 *output << static_cast<double>( Walker->type->Valence) << "\t";1692 *output << Walker->type->symbol << "\t";1693 for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++)1694 *output << (*runner)->GetOtherAtom( Walker)->nr << "\t";1695 for(int i= Walker->ListOfBonds.size(); i < MaxNeighbours; i++)1679 *output << (*iter)->node->at(0) << "\t" << (*iter)->node->at(1) << "\t" << (*iter)->node->at(2) << "\t"; 1680 *output << static_cast<double>((*iter)->type->Valence) << "\t"; 1681 *output << (*iter)->type->symbol << "\t"; 1682 for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++) 1683 *output << (*runner)->GetOtherAtom(*iter)->nr << "\t"; 1684 for(int i=(*iter)->ListOfBonds.size(); i < MaxNeighbours; i++) 1696 1685 *output << "-\t"; 1697 1686 *output << endl; … … 1714 1703 { 1715 1704 Info FunctionInfo(__func__); 1716 atom *Walker = NULL;1717 1705 ofstream *output = NULL; 1718 1706 stringstream * const fname = new stringstream; … … 1729 1717 int MaxNeighbours = 0; 1730 1718 for (MoleculeList::const_iterator MolWalker = MolList->ListOfMolecules.begin(); MolWalker != MolList->ListOfMolecules.end(); MolWalker++) { 1731 Walker = (*MolWalker)->start; 1732 while (Walker->next != (*MolWalker)->end) { 1733 Walker = Walker->next; 1734 const int count = Walker->ListOfBonds.size(); 1719 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 1720 const int count = (*iter)->ListOfBonds.size(); 1735 1721 if (MaxNeighbours < count) 1736 1722 MaxNeighbours = count; 1737 1723 } 1738 1724 } 1739 *output << "# ATOMDATA Id name resName resSeq x=3 charge type neighbors=" << MaxNeighbours << endl;1725 *output << "# ATOMDATA Id name resName resSeq x=3 Charge type neighbors=" << MaxNeighbours << endl; 1740 1726 1741 1727 // create global to local id map … … 1745 1731 int AtomNo = 1; 1746 1732 for (MoleculeList::const_iterator MolWalker = MolList->ListOfMolecules.begin(); MolWalker != MolList->ListOfMolecules.end(); MolWalker++) { 1747 atom *Walker = (*MolWalker)->start; 1748 while (Walker->next != (*MolWalker)->end) { 1749 Walker = Walker->next; 1750 LocalNotoGlobalNoMap.insert( pair<int,int>(Walker->getId(), AtomNo++) ); 1733 for(molecule::iterator AtomRunner = (*MolWalker)->begin(); AtomRunner != (*MolWalker)->end(); ++AtomRunner) { 1734 LocalNotoGlobalNoMap.insert( pair<int,int>((*AtomRunner)->getId(), AtomNo++) ); 1751 1735 } 1752 1736 MolCounter++; … … 1760 1744 int AtomNo = 0; 1761 1745 for (MoleculeList::const_iterator MolWalker = MolList->ListOfMolecules.begin(); MolWalker != MolList->ListOfMolecules.end(); MolWalker++) { 1762 Walker = (*MolWalker)->start; 1763 while (Walker->next != (*MolWalker)->end) { 1764 Walker = Walker->next; 1765 *output << LocalNotoGlobalNoMap[ Walker->getId() ] << "\t"; 1766 *output << Walker->getName() << "\t"; 1746 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 1747 *output << LocalNotoGlobalNoMap[ (*iter)->getId() ] << "\t"; 1748 *output << (*iter)->getName() << "\t"; 1767 1749 *output << (*MolWalker)->name << "\t"; 1768 1750 *output << MolCounter+1 << "\t"; 1769 *output << Walker->node->at(0) << "\t" << Walker->node->at(1) << "\t" << Walker->node->at(2) << "\t";1770 *output << (double) Walker->type->Valence << "\t";1771 *output << Walker->type->symbol << "\t";1772 for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++)1773 *output << LocalNotoGlobalNoMap[ (*runner)->GetOtherAtom( Walker)->getId() ] << "\t";1774 for(int i= Walker->ListOfBonds.size(); i < MaxNeighbours; i++)1751 *output << (*iter)->node->at(0) << "\t" << (*iter)->node->at(1) << "\t" << (*iter)->node->at(2) << "\t"; 1752 *output << (double)(*iter)->type->Valence << "\t"; 1753 *output << (*iter)->type->symbol << "\t"; 1754 for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++) 1755 *output << LocalNotoGlobalNoMap[ (*runner)->GetOtherAtom((*iter))->getId() ] << "\t"; 1756 for(int i=(*iter)->ListOfBonds.size(); i < MaxNeighbours; i++) 1775 1757 *output << "-\t"; 1776 1758 *output << endl; … … 1813 1795 if (output == NULL) 1814 1796 strcpy(filename,"main_pcp_linux"); 1815 Log() << Verbose(0) << "Saving as pdb input ";1797 Log() << Verbose(0) << "Saving as pdb input ... " << endl; 1816 1798 if (SavePDB(filename, molecules)) 1817 Log() << Verbose(0) << " done." << endl;1799 Log() << Verbose(0) << "\t... done." << endl; 1818 1800 else 1819 Log() << Verbose(0) << " failed." << endl;1801 Log() << Verbose(0) << "\t... failed." << endl; 1820 1802 1821 1803 // then save as tremolo data file … … 1824 1806 if (output == NULL) 1825 1807 strcpy(filename,"main_pcp_linux"); 1826 Log() << Verbose(0) << "Saving as tremolo data input ";1808 Log() << Verbose(0) << "Saving as tremolo data input ... " << endl; 1827 1809 if (SaveTREMOLO(filename, molecules)) 1828 Log() << Verbose(0) << " done." << endl;1810 Log() << Verbose(0) << "\t... done." << endl; 1829 1811 else 1830 Log() << Verbose(0) << " failed." << endl;1812 Log() << Verbose(0) << "\t... failed." << endl; 1831 1813 1832 1814 // translate each to its center and merge all molecules in MoleculeListClass into this molecule … … 1864 1846 output.close(); 1865 1847 output.clear(); 1866 Log() << Verbose(0) << "Saving of config file ";1848 Log() << Verbose(0) << "Saving of config file ... " << endl; 1867 1849 if (Save(filename, periode, mol)) 1868 Log() << Verbose(0) << " successful." << endl;1850 Log() << Verbose(0) << "\t... successful." << endl; 1869 1851 else 1870 Log() << Verbose(0) << " failed." << endl;1852 Log() << Verbose(0) << "\t... failed." << endl; 1871 1853 1872 1854 // and save to xyz file … … 1881 1863 output.open(filename, ios::trunc); 1882 1864 } 1883 Log() << Verbose(0) << "Saving of XYZ file ";1865 Log() << Verbose(0) << "Saving of XYZ file ... " << endl; 1884 1866 if (mol->MDSteps <= 1) { 1885 1867 if (mol->OutputXYZ(&output)) 1886 Log() << Verbose(0) << " successful." << endl;1868 Log() << Verbose(0) << "\t... successful." << endl; 1887 1869 else 1888 Log() << Verbose(0) << " failed." << endl;1870 Log() << Verbose(0) << "\t... failed." << endl; 1889 1871 } else { 1890 1872 if (mol->OutputTrajectoriesXYZ(&output)) 1891 Log() << Verbose(0) << " successful." << endl;1873 Log() << Verbose(0) << "\t... successful." << endl; 1892 1874 else 1893 Log() << Verbose(0) << " failed." << endl;1875 Log() << Verbose(0) << "\t... failed." << endl; 1894 1876 } 1895 1877 output.close(); … … 1901 1883 if (output == NULL) 1902 1884 strcpy(filename,"main_pcp_linux"); 1903 Log() << Verbose(0) << "Saving as mpqc input ";1885 Log() << Verbose(0) << "Saving as mpqc input .. " << endl; 1904 1886 if (SaveMPQC(filename, mol)) 1905 Log() << Verbose(0) << " done." << endl;1887 Log() << Verbose(0) << "\t... done." << endl; 1906 1888 else 1907 Log() << Verbose(0) << " failed." << endl;1889 Log() << Verbose(0) << "\t... failed." << endl; 1908 1890 1909 1891 if (!strcmp(configpath, GetDefaultPath())) {
Note:
See TracChangeset
for help on using the changeset viewer.
