Changeset 9879f6 for src/config.cpp
- Timestamp:
- Mar 5, 2010, 10:16:47 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, 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:
- d3347e
- Parents:
- e87acf
- git-author:
- Frederik Heber <heber@…> (03/05/10 10:08:44)
- git-committer:
- Frederik Heber <heber@…> (03/05/10 10:16:47)
- File:
-
- 1 edited
-
src/config.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
re87acf r9879f6 1542 1542 int AtomNo = -1; 1543 1543 int MolNo = 0; 1544 atom *Walker = NULL;1545 1544 FILE *f = NULL; 1546 1545 … … 1555 1554 fprintf(f, "# Created by MoleCuilder\n"); 1556 1555 1557 for (MoleculeList::const_iterator Runner = MolList->ListOfMolecules.begin(); Runner != MolList->ListOfMolecules.end(); Runner++) { 1558 Walker = (*Runner)->start; 1556 for (MoleculeList::const_iterator MolRunner = MolList->ListOfMolecules.begin(); MolRunner != MolList->ListOfMolecules.end(); MolRunner++) { 1559 1557 int *elementNo = Calloc<int>(MAX_ELEMENTS, "config::SavePDB - elementNo"); 1560 1558 AtomNo = 0; 1561 while (Walker->next != (*Runner)->end) { 1562 Walker = Walker->next; 1563 sprintf(name, "%2s%2d",Walker->type->symbol, elementNo[Walker->type->Z]); 1564 elementNo[Walker->type->Z] = (elementNo[Walker->type->Z]+1) % 100; // confine to two digits 1559 for (molecule::const_iterator iter = (*MolRunner)->begin(); iter != (*MolRunner)->end(); ++iter) { 1560 sprintf(name, "%2s%2d",(*iter)->type->symbol, elementNo[(*iter)->type->Z]); 1561 elementNo[(*iter)->type->Z] = (elementNo[(*iter)->type->Z]+1) % 100; // confine to two digits 1565 1562 fprintf(f, 1566 1563 "ATOM %6u %-4s %4s%c%4u %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%2s\n", 1567 Walker->nr, /* atom serial number */1564 (*iter)->nr, /* atom serial number */ 1568 1565 name, /* atom name */ 1569 (* Runner)->name, /* residue name */1566 (*MolRunner)->name, /* residue name */ 1570 1567 'a'+(unsigned char)(AtomNo % 26), /* letter for chain */ 1571 1568 MolNo, /* residue sequence number */ 1572 Walker->node->x[0], /* position X in Angstroem */1573 Walker->node->x[1], /* position Y in Angstroem */1574 Walker->node->x[2], /* position Z in Angstroem */1575 (double) Walker->type->Valence, /* occupancy */1576 (double) Walker->type->NoValenceOrbitals, /* temperature factor */1569 (*iter)->node->x[0], /* position X in Angstroem */ 1570 (*iter)->node->x[1], /* position Y in Angstroem */ 1571 (*iter)->node->x[2], /* position Z in Angstroem */ 1572 (double)(*iter)->type->Valence, /* occupancy */ 1573 (double)(*iter)->type->NoValenceOrbitals, /* temperature factor */ 1577 1574 "0", /* segment identifier */ 1578 Walker->type->symbol, /* element symbol */1575 (*iter)->type->symbol, /* element symbol */ 1579 1576 "0"); /* charge */ 1580 1577 AtomNo++; … … 1596 1593 { 1597 1594 int AtomNo = -1; 1598 atom *Walker = NULL;1599 1595 FILE *f = NULL; 1600 1596 … … 1611 1607 fprintf(f, "# Created by MoleCuilder\n"); 1612 1608 1613 Walker = mol->start;1614 1609 AtomNo = 0; 1615 while (Walker->next != mol->end) { 1616 Walker = Walker->next; 1617 sprintf(name, "%2s%2d",Walker->type->symbol, elementNo[Walker->type->Z]); 1618 elementNo[Walker->type->Z] = (elementNo[Walker->type->Z]+1) % 100; // confine to two digits 1610 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1611 sprintf(name, "%2s%2d",(*iter)->type->symbol, elementNo[(*iter)->type->Z]); 1612 elementNo[(*iter)->type->Z] = (elementNo[(*iter)->type->Z]+1) % 100; // confine to two digits 1619 1613 fprintf(f, 1620 1614 "ATOM %6u %-4s %4s%c%4u %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%2s\n", 1621 Walker->nr, /* atom serial number */1615 (*iter)->nr, /* atom serial number */ 1622 1616 name, /* atom name */ 1623 1617 mol->name, /* residue name */ 1624 1618 'a'+(unsigned char)(AtomNo % 26), /* letter for chain */ 1625 1619 0, /* residue sequence number */ 1626 Walker->node->x[0], /* position X in Angstroem */1627 Walker->node->x[1], /* position Y in Angstroem */1628 Walker->node->x[2], /* position Z in Angstroem */1629 (double) Walker->type->Valence, /* occupancy */1630 (double) Walker->type->NoValenceOrbitals, /* temperature factor */1620 (*iter)->node->x[0], /* position X in Angstroem */ 1621 (*iter)->node->x[1], /* position Y in Angstroem */ 1622 (*iter)->node->x[2], /* position Z in Angstroem */ 1623 (double)(*iter)->type->Valence, /* occupancy */ 1624 (double)(*iter)->type->NoValenceOrbitals, /* temperature factor */ 1631 1625 "0", /* segment identifier */ 1632 Walker->type->symbol, /* element symbol */1626 (*iter)->type->symbol, /* element symbol */ 1633 1627 "0"); /* charge */ 1634 1628 AtomNo++; … … 1647 1641 bool config::SaveTREMOLO(const char * const filename, const molecule * const mol) const 1648 1642 { 1649 atom *Walker = NULL;1650 1643 ofstream *output = NULL; 1651 1644 stringstream * const fname = new stringstream; … … 1660 1653 1661 1654 // scan maximum number of neighbours 1662 Walker = mol->start;1663 1655 int MaxNeighbours = 0; 1664 while (Walker->next != mol->end) { 1665 Walker = Walker->next; 1666 const int count = Walker->ListOfBonds.size(); 1656 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1657 const int count = (*iter)->ListOfBonds.size(); 1667 1658 if (MaxNeighbours < count) 1668 1659 MaxNeighbours = count; 1669 1660 } 1670 *output << "# ATOMDATA Id name resName resSeq x=3 charge type neighbors=" << MaxNeighbours << endl; 1671 1672 Walker = mol->start; 1673 while (Walker->next != mol->end) { 1674 Walker = Walker->next; 1675 *output << Walker->nr << "\t"; 1676 *output << Walker->Name << "\t"; 1661 *output << "# ATOMDATA Id name resName resSeq x=3 Charge type neighbors=" << MaxNeighbours << endl; 1662 1663 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1664 *output << (*iter)->nr << "\t"; 1665 *output << (*iter)->Name << "\t"; 1677 1666 *output << mol->name << "\t"; 1678 1667 *output << 0 << "\t"; 1679 *output << Walker->node->x[0] << "\t" << Walker->node->x[1] << "\t" << Walker->node->x[2] << "\t"; 1680 *output << (double)Walker->type->Valence << "\t"; 1681 *output << Walker->type->symbol << "\t"; 1682 for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++) 1683 *output << (*runner)->GetOtherAtom(Walker)->nr << "\t"; 1684 for(int i=Walker->ListOfBonds.size(); i < MaxNeighbours; i++) 1668 for (int i=0;i<NDIM;i++) 1669 *output << (*iter)->node->x[i] << "\t"; 1670 *output << (double)(*iter)->type->Valence << "\t"; 1671 *output << (*iter)->type->symbol << "\t"; 1672 for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++) 1673 *output << (*runner)->GetOtherAtom((*iter))->nr << "\t"; 1674 for(int i=(*iter)->ListOfBonds.size(); i < MaxNeighbours; i++) 1685 1675 *output << "-\t"; 1686 1676 *output << endl; … … 1701 1691 bool config::SaveTREMOLO(const char * const filename, const MoleculeListClass * const MolList) const 1702 1692 { 1703 atom *Walker = NULL;1704 1693 ofstream *output = NULL; 1705 1694 stringstream * const fname = new stringstream; … … 1716 1705 int MaxNeighbours = 0; 1717 1706 for (MoleculeList::const_iterator MolWalker = MolList->ListOfMolecules.begin(); MolWalker != MolList->ListOfMolecules.end(); MolWalker++) { 1718 Walker = (*MolWalker)->start; 1719 while (Walker->next != (*MolWalker)->end) { 1720 Walker = Walker->next; 1721 const int count = Walker->ListOfBonds.size(); 1707 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 1708 const int count = (*iter)->ListOfBonds.size(); 1722 1709 if (MaxNeighbours < count) 1723 1710 MaxNeighbours = count; 1724 1711 } 1725 1712 } 1726 *output << "# ATOMDATA Id name resName resSeq x=3 charge type neighbors=" << MaxNeighbours << endl;1713 *output << "# ATOMDATA Id name resName resSeq x=3 Charge type neighbors=" << MaxNeighbours << endl; 1727 1714 1728 1715 // create global to local id map … … 1745 1732 int AtomNo = 0; 1746 1733 for (MoleculeList::const_iterator MolWalker = MolList->ListOfMolecules.begin(); MolWalker != MolList->ListOfMolecules.end(); MolWalker++) { 1747 Walker = (*MolWalker)->start; 1748 while (Walker->next != (*MolWalker)->end) { 1749 Walker = Walker->next; 1734 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 1750 1735 *output << AtomNo << "\t"; 1751 *output << Walker->Name << "\t";1736 *output << (*iter)->Name << "\t"; 1752 1737 *output << (*MolWalker)->name << "\t"; 1753 1738 *output << MolCounter << "\t"; 1754 *output << Walker->node->x[0] << "\t" << Walker->node->x[1] << "\t" << Walker->node->x[2] << "\t"; 1755 *output << (double)Walker->type->Valence << "\t"; 1756 *output << Walker->type->symbol << "\t"; 1757 for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++) 1758 *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom(Walker)->nr ] << "\t"; 1759 for(int i=Walker->ListOfBonds.size(); i < MaxNeighbours; i++) 1739 for (int i=0;i<NDIM;i++) 1740 *output << (*iter)->node->x[i] << "\t"; 1741 *output << (double)(*iter)->type->Valence << "\t"; 1742 *output << (*iter)->type->symbol << "\t"; 1743 for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++) 1744 *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom((*iter))->nr ] << "\t"; 1745 for(int i=(*iter)->ListOfBonds.size(); i < MaxNeighbours; i++) 1760 1746 *output << "-\t"; 1761 1747 *output << endl;
Note:
See TracChangeset
for help on using the changeset viewer.
