- Timestamp:
- Jun 9, 2010, 3:08:46 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, 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:
- 31b09e
- Parents:
- 1e6913
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MapOfActions.cpp
r1e6913 r58bbd3 50 50 v = boost::any(BoxValue(BV)); 51 51 } 52 53 52 54 53 /** Constructor of class MapOfActions. … … 85 84 DescriptionMap["nonconvex-envelope"] = "create the non-convex envelope for a molecule"; 86 85 DescriptionMap["molecular-volume"] = "calculate the volume of a given molecule"; 87 DescriptionMap["pair-correlation"] = "pair correlation analysis between two elements"; 88 DescriptionMap["pair-correlation-point"] = "pair correlation analysis between atoms of a element to a given point"; 89 DescriptionMap["pair-correlation-surface"] = "pair correlation analysis between atoms of a given element and a surface"; 86 DescriptionMap["pair-correlation"] = "pair correlation analysis between two elements, element and point or element and surface"; 90 87 DescriptionMap["parse-xyz"] = "parse xyz file into World"; 91 88 DescriptionMap["principal-axis-system"] = "calculate the principal axis system of the specified molecule"; … … 113 110 DescriptionMap["distances"] = "list of three of distances in space, one for each axis direction"; 114 111 DescriptionMap["DoRotate"] = "whether to rotate or just report angles"; 115 DescriptionMap["element"] = "set of elements"; 112 DescriptionMap["element"] = "single element"; 113 DescriptionMap["elements"] = "set of elements"; 116 114 DescriptionMap["end-mol"] = "last or end step"; 117 115 DescriptionMap["input"] = "name of input file"; … … 120 118 DescriptionMap["MaxDistance"] = "maximum distance in space"; 121 119 DescriptionMap["molecule-by-id"] = "index of a molecule"; 120 DescriptionMap["molecule-by-name"] = "name of a molecule"; 122 121 DescriptionMap["order"] = "order of a discretization, dissection, ..."; 123 122 DescriptionMap["output-file"] = "name of the output file"; … … 146 145 ShortFormMap["linear-interpolate"] = "L"; 147 146 ShortFormMap["nonconvex-envelope"] = "N"; 148 ShortFormMap["pair-correlation"] = "CE"; 149 ShortFormMap["pair-correlation-point"] = "CP"; 150 ShortFormMap["pair-correlation-surface"] = "CS"; 147 ShortFormMap["pair-correlation"] = "C"; 151 148 ShortFormMap["parse-xyz"] = "p"; 152 149 ShortFormMap["remove-atom"] = "r"; … … 188 185 TypeMap["nonconvex-envelope"] = Molecule; 189 186 TypeMap["parse-xyz"] = String; 187 TypeMap["pair-correlation"] = String; 190 188 TypeMap["principal-axis-system"] = Axis; 191 189 TypeMap["remove-atom"] = Atom; … … 208 206 TypeMap["bin-end"] = Double; 209 207 TypeMap["bin-start"] = Double; 208 TypeMap["bin-width"] = Double; 210 209 TypeMap["distance"] = Double; 211 210 TypeMap["distances"] = Vector; … … 217 216 TypeMap["MaxDistance"] = Double; 218 217 TypeMap["molecule-by-id"] = Molecule; 218 TypeMap["molecule-by-name"] = Molecule; 219 219 TypeMap["order"] = Integer; 220 220 TypeMap["output-file"] = String; … … 224 224 // default values for any action that needs one (always string!) 225 225 DefaultValue["molecule-by-id"] = "-1"; 226 DefaultValue["bin-width"] = "0.5"; 227 DefaultValue["periodic"] = "0"; 226 228 227 229 … … 240 242 // generic.insert("default-molname"); 241 243 generic.insert("depth-first-search"); 242 // generic.insert("element-d b");244 // generic.insert("element-d<b"); 243 245 // generic.insert("fastparsing"); 244 246 generic.insert("fill-molecule"); … … 248 250 // generic.insert("molecular-volume"); 249 251 // generic.insert("nonconvex-envelope"); 250 // generic.insert("pair-correlation"); 251 // generic.insert("pair-correlation-point"); 252 // generic.insert("pair-correlation-surface"); 252 generic.insert("pair-correlation"); 253 253 // generic.insert("parse-xyz"); 254 254 // generic.insert("principal-axis-system"); … … 269 269 generic.insert("version"); 270 270 // // list of generic values 271 // generic.insert("bin-output-file");272 // generic.insert("bin-end");273 // generic.insert("bin-start");274 271 // generic.insert("distance"); 275 272 // generic.insert("distances"); … … 278 275 generic.insert("input"); 279 276 // generic.insert("length"); 280 // generic.insert("output-file");281 // generic.insert("periodic");282 // generic.insert("position");283 277 // generic.insert("start-mol"); 284 278 … … 287 281 288 282 // hidden arguments 283 generic.insert("bin-end"); 284 generic.insert("bin-output-file"); 285 generic.insert("bin-start"); 286 generic.insert("bin-width"); 289 287 generic.insert("distance"); 290 288 generic.insert("DoRotate"); 291 289 generic.insert("distances"); 290 generic.insert("element"); 291 generic.insert("elements"); 292 292 generic.insert("lengths"); 293 293 generic.insert("MaxDistance"); 294 294 generic.insert("molecule-by-id"); 295 generic.insert("molecule-by-name"); 295 296 generic.insert("order"); 297 generic.insert("output-file"); 298 generic.insert("periodic"); 299 generic.insert("position"); 296 300 } 297 301 -
src/analysis_correlation.cpp
r1e6913 r58bbd3 179 179 } 180 180 181 // outmap = new PairCorrelationMap;182 // for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)183 // if ((*MolWalker)->ActiveFlag) {184 // double * FullMatrix = ReturnFullMatrixforSymmetric(World::getInstance().getDomain());185 // double * FullInverseMatrix = InverseMatrix(FullMatrix);186 // DoeLog(2) && (eLog()<< Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);187 // for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {188 // DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);189 // if ((type1 == NULL) || ((*iter)->type == type1)) {190 // periodicX = *(*iter)->node;191 // periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3192 // // go through every range in xyz and get distance193 // for (n[0]=-ranges[0]; n[0] <= ranges[0]; n[0]++)194 // for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)195 // for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) {196 // checkX = Vector(n[0], n[1], n[2]) + periodicX;197 // checkX.MatrixMultiplication(FullMatrix);198 // for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++)199 // if ((*MolOtherWalker)->ActiveFlag) {200 // DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl);201 // for (molecule::const_iterator runner = (*MolOtherWalker)->begin(); runner != (*MolOtherWalker)->end(); ++runner) {202 // DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl);203 // if ((*iter)->nr < (*runner)->nr)204 // if ((type2 == NULL) || ((*runner)->type == type2)) {205 // periodicOtherX = *(*runner)->node;206 // periodicOtherX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3207 // // go through every range in xyz and get distance208 // for (Othern[0]=-ranges[0]; Othern[0] <= ranges[0]; Othern[0]++)209 // for (Othern[1]=-ranges[1]; Othern[1] <= ranges[1]; Othern[1]++)210 // for (Othern[2]=-ranges[2]; Othern[2] <= ranges[2]; Othern[2]++) {211 // checkOtherX = Vector(Othern[0], Othern[1], Othern[2]) + periodicOtherX;212 // checkOtherX.MatrixMultiplication(FullMatrix);213 // distance = checkX.distance(checkOtherX);214 // //Log() << Verbose(1) <<"Inserting " << *(*iter) << " and " << *(*runner) << endl;215 // outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> ((*iter), (*runner)) ) );216 // }217 // }218 // }219 // }220 // }221 // }222 // }223 // delete[](FullMatrix);224 // delete[](FullInverseMatrix);225 // }226 227 181 return outmap; 228 182 }; … … 239 193 CorrelationToPointMap *outmap = NULL; 240 194 double distance = 0.; 195 double *cell_size = World::getInstance().getDomain(); 241 196 242 197 if (molecules->ListOfMolecules.empty()) { … … 254 209 for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type) 255 210 if ((*type == NULL) || ((*iter)->type == *type)) { 256 distance = (*iter)->node->PeriodicDistance(*point, World::getInstance().getDomain());211 distance = (*iter)->node->PeriodicDistance(*point, cell_size); 257 212 DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl); 258 213 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> ((*iter), point) ) ); -
src/builder.cpp
r1e6913 r58bbd3 1763 1763 switch(argv[argptr][0]) { 1764 1764 case 'E': 1765 { 1766 if ((argptr+6 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (!IsValidNumber(argv[argptr+2])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-') || (argv[argptr+4][0] == '-')) { 1767 ExitFlag = 255; 1768 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C E <Z1> <Z2> <output> <bin output> <binstart> <binend>" << endl); 1769 performCriticalExit(); 1770 } else { 1771 ofstream output(argv[argptr+3]); 1772 ofstream binoutput(argv[argptr+4]); 1773 const double BinStart = atof(argv[argptr+5]); 1774 const double BinEnd = atof(argv[argptr+6]); 1775 1776 std::vector<element *> elements; 1777 elements.push_back(periode->FindElement((const int) atoi(argv[argptr+1]))); 1778 elements.push_back(periode->FindElement((const int) atoi(argv[argptr+2]))); 1779 PairCorrelationMap *correlationmap = NULL; 1780 if (periodic) 1781 correlationmap = PeriodicPairCorrelation(molecules, elements, ranges); 1782 else 1783 correlationmap = PairCorrelation(molecules, elements); 1784 OutputPairCorrelation(&output, correlationmap); 1785 BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd ); 1786 OutputCorrelation ( &binoutput, binmap ); 1787 output.close(); 1788 binoutput.close(); 1789 delete(binmap); 1790 delete(correlationmap); 1791 argptr+=7; 1792 } 1793 } 1765 ArgcList.insert(argptr-1); 1766 ArgcList.insert(argptr); 1767 ArgcList.insert(argptr+1); 1768 ArgcList.insert(argptr+2); 1769 ArgcList.insert(argptr+3); 1770 ArgcList.insert(argptr+4); 1771 ArgcList.insert(argptr+5); 1772 ArgcList.insert(argptr+6); 1773 ArgcList.insert(argptr+7); 1774 ArgcList.insert(argptr+8); 1775 ArgcList.insert(argptr+9); 1776 ArgcList.insert(argptr+10); 1777 ArgcList.insert(argptr+11); 1778 argptr+=12; 1794 1779 break; 1795 1780 1796 1781 case 'P': 1797 { 1798 if ((argptr+8 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+7])) || (!IsValidNumber(argv[argptr+8])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-') || (argv[argptr+4][0] == '-') || (argv[argptr+5][0] == '-') || (argv[argptr+6][0] == '-')) { 1799 ExitFlag = 255; 1800 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C P <Z1> <x> <y> <z> <output> <bin output> <binstart> <binend>" << endl); 1801 performCriticalExit(); 1802 } else { 1803 ofstream output(argv[argptr+5]); 1804 ofstream binoutput(argv[argptr+6]); 1805 const double BinStart = atof(argv[argptr+7]); 1806 const double BinEnd = atof(argv[argptr+8]); 1807 1808 std::vector<element *> elements; 1809 elements.push_back(periode->FindElement((const int) atoi(argv[argptr+1]))); 1810 Vector *Point = new Vector((const double) atof(argv[argptr+1]),(const double) atof(argv[argptr+2]),(const double) atof(argv[argptr+3])); 1811 CorrelationToPointMap *correlationmap = NULL; 1812 if (periodic) 1813 correlationmap = PeriodicCorrelationToPoint(molecules, elements, Point, ranges); 1814 else 1815 correlationmap = CorrelationToPoint(molecules, elements, Point); 1816 OutputCorrelationToPoint(&output, correlationmap); 1817 BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd ); 1818 OutputCorrelation ( &binoutput, binmap ); 1819 output.close(); 1820 binoutput.close(); 1821 delete(Point); 1822 delete(binmap); 1823 delete(correlationmap); 1824 argptr+=9; 1825 } 1826 } 1782 ArgcList.insert(argptr-1); 1783 ArgcList.insert(argptr); 1784 ArgcList.insert(argptr+1); 1785 ArgcList.insert(argptr+2); 1786 ArgcList.insert(argptr+3); 1787 ArgcList.insert(argptr+4); 1788 ArgcList.insert(argptr+5); 1789 ArgcList.insert(argptr+6); 1790 ArgcList.insert(argptr+7); 1791 ArgcList.insert(argptr+8); 1792 ArgcList.insert(argptr+9); 1793 ArgcList.insert(argptr+10); 1794 ArgcList.insert(argptr+11); 1795 ArgcList.insert(argptr+12); 1796 ArgcList.insert(argptr+13); 1797 ArgcList.insert(argptr+14); 1798 argptr+=15; 1827 1799 break; 1828 1800 1829 1801 case 'S': 1830 { 1831 if ((argptr+6 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-')) { 1832 ExitFlag = 255; 1833 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C S <Z> <output> <bin output> <BinWidth> <BinStart> <BinEnd>" << endl); 1834 performCriticalExit(); 1835 } else { 1836 ofstream output(argv[argptr+2]); 1837 ofstream binoutput(argv[argptr+3]); 1838 const double radius = 4.; 1839 const double BinWidth = atof(argv[argptr+4]); 1840 const double BinStart = atof(argv[argptr+5]); 1841 const double BinEnd = atof(argv[argptr+6]); 1842 double LCWidth = 20.; 1843 if (BinEnd > 0) { 1844 if (BinEnd > 2.*radius) 1845 LCWidth = BinEnd; 1846 else 1847 LCWidth = 2.*radius; 1848 } 1849 1850 // get the boundary 1851 class molecule *Boundary = NULL; 1852 class Tesselation *TesselStruct = NULL; 1853 const LinkedCell *LCList = NULL; 1854 // find biggest molecule 1855 int counter = 0; 1856 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) { 1857 if ((Boundary == NULL) || (Boundary->getAtomCount() < (*BigFinder)->getAtomCount())) { 1858 Boundary = *BigFinder; 1859 } 1860 counter++; 1861 } 1862 bool *Actives = new bool[counter]; 1863 counter = 0; 1864 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) { 1865 Actives[counter++] = (*BigFinder)->ActiveFlag; 1866 (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true; 1867 } 1868 LCList = new LinkedCell(Boundary, LCWidth); 1869 std::vector<element *> elements; 1870 elements.push_back(periode->FindElement((const int) atoi(argv[argptr+1]))); 1871 FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL); 1872 CorrelationToSurfaceMap *surfacemap = NULL; 1873 if (periodic) 1874 surfacemap = PeriodicCorrelationToSurface( molecules, elements, TesselStruct, LCList, ranges); 1875 else 1876 surfacemap = CorrelationToSurface( molecules, elements, TesselStruct, LCList); 1877 OutputCorrelationToSurface(&output, surfacemap); 1878 // check whether radius was appropriate 1879 { 1880 double start; double end; 1881 GetMinMax( surfacemap, start, end); 1882 if (LCWidth < end) 1883 DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell width is smaller than the found range of values! Bins can only be correct up to: " << radius << "." << endl); 1884 } 1885 BinPairMap *binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd ); 1886 OutputCorrelation ( &binoutput, binmap ); 1887 output.close(); 1888 binoutput.close(); 1889 counter = 0; 1890 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) 1891 (*BigFinder)->ActiveFlag = Actives[counter++]; 1892 delete[](Actives); 1893 delete(LCList); 1894 delete(TesselStruct); 1895 delete(binmap); 1896 delete(surfacemap); 1897 argptr+=7; 1898 } 1899 } 1802 ArgcList.insert(argptr-1); 1803 ArgcList.insert(argptr); 1804 ArgcList.insert(argptr+1); 1805 ArgcList.insert(argptr+2); 1806 ArgcList.insert(argptr+3); 1807 ArgcList.insert(argptr+4); 1808 ArgcList.insert(argptr+5); 1809 ArgcList.insert(argptr+6); 1810 ArgcList.insert(argptr+7); 1811 ArgcList.insert(argptr+8); 1812 ArgcList.insert(argptr+9); 1813 ArgcList.insert(argptr+10); 1814 ArgcList.insert(argptr+11); 1815 ArgcList.insert(argptr+12); 1816 ArgcList.insert(argptr+13); 1817 ArgcList.insert(argptr+14); 1818 argptr+=15; 1900 1819 break; 1901 1820 -
src/moleculelist.cpp
r1e6913 r58bbd3 799 799 strncat(molecules[i]->name, number, MAXSTRINGSIZE - strlen(mol->name) - 1); 800 800 } 801 DoLog(1) && (Log() << Verbose(1) << "MolName is " << molecules[i]->name << endl);801 DoLog(1) && (Log() << Verbose(1) << "MolName is " << molecules[i]->name << ", id is " << molecules[i]->getId() << endl); 802 802 for (molecule::iterator iter = MolecularWalker->Leaf->begin(); iter != MolecularWalker->Leaf->end(); ++iter) { 803 803 DoLog(1) && (Log() << Verbose(1) << **iter << endl);
Note:
See TracChangeset
for help on using the changeset viewer.