Changeset 3930eb
- Timestamp:
- Dec 19, 2009, 7:31:34 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:
- 71b20e, bd61b41
- Parents:
- 1cf5df
- git-author:
- Frederik Heber <heber@…> (12/19/09 19:29:02)
- git-committer:
- Frederik Heber <heber@…> (12/19/09 19:31:34)
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/analysis_correlation.cpp
r1cf5df r3930eb 10 10 #include "analysis_correlation.hpp" 11 11 #include "element.hpp" 12 #include "info.hpp" 12 13 #include "log.hpp" 13 14 #include "molecule.hpp" … … 28 29 PairCorrelationMap *PairCorrelation(MoleculeListClass * const &molecules, const element * const type1, const element * const type2 ) 29 30 { 31 Info FunctionInfo(__func__); 30 32 PairCorrelationMap *outmap = NULL; 31 33 double distance = 0.; … … 77 79 PairCorrelationMap *PeriodicPairCorrelation(MoleculeListClass * const &molecules, const element * const type1, const element * const type2, const int ranges[NDIM] ) 78 80 { 81 Info FunctionInfo(__func__); 79 82 PairCorrelationMap *outmap = NULL; 80 83 double distance = 0.; … … 154 157 CorrelationToPointMap *CorrelationToPoint(MoleculeListClass * const &molecules, const element * const type, const Vector *point ) 155 158 { 159 Info FunctionInfo(__func__); 156 160 CorrelationToPointMap *outmap = NULL; 157 161 double distance = 0.; … … 190 194 CorrelationToPointMap *PeriodicCorrelationToPoint(MoleculeListClass * const &molecules, const element * const type, const Vector *point, const int ranges[NDIM] ) 191 195 { 196 Info FunctionInfo(__func__); 192 197 CorrelationToPointMap *outmap = NULL; 193 198 double distance = 0.; … … 243 248 CorrelationToSurfaceMap *CorrelationToSurface(MoleculeListClass * const &molecules, const element * const type, const Tesselation * const Surface, const LinkedCell *LC ) 244 249 { 250 Info FunctionInfo(__func__); 245 251 CorrelationToSurfaceMap *outmap = NULL; 246 252 double distance = 0; … … 288 294 CorrelationToSurfaceMap *PeriodicCorrelationToSurface(MoleculeListClass * const &molecules, const element * const type, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] ) 289 295 { 296 Info FunctionInfo(__func__); 290 297 CorrelationToSurfaceMap *outmap = NULL; 291 298 double distance = 0; … … 342 349 double GetBin ( const double value, const double BinWidth, const double BinStart ) 343 350 { 351 Info FunctionInfo(__func__); 344 352 double bin =(double) (floor((value - BinStart)/BinWidth)); 345 353 return (bin*BinWidth+BinStart); … … 353 361 void OutputCorrelation( ofstream * const file, const BinPairMap * const map ) 354 362 { 363 Info FunctionInfo(__func__); 355 364 *file << "# BinStart\tCount" << endl; 356 365 for (BinPairMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) { … … 365 374 void OutputPairCorrelation( ofstream * const file, const PairCorrelationMap * const map ) 366 375 { 376 Info FunctionInfo(__func__); 367 377 *file << "# BinStart\tAtom1\tAtom2" << endl; 368 378 for (PairCorrelationMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) { … … 377 387 void OutputCorrelationToPoint( ofstream * const file, const CorrelationToPointMap * const map ) 378 388 { 389 Info FunctionInfo(__func__); 379 390 *file << "# BinStart\tAtom::x[i]-point.x[i]" << endl; 380 391 for (CorrelationToPointMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) { … … 392 403 void OutputCorrelationToSurface( ofstream * const file, const CorrelationToSurfaceMap * const map ) 393 404 { 405 Info FunctionInfo(__func__); 394 406 *file << "# BinStart\tTriangle" << endl; 395 407 for (CorrelationToSurfaceMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) { -
src/builder.cpp
r1cf5df r3930eb 1410 1410 Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl; 1411 1411 Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl; 1412 Log() << Verbose(0) << "\t-C \tPair Correlation analysis." << endl;1412 Log() << Verbose(0) << "\t-C <Z> <output> <bin output>\tPair Correlation analysis." << endl; 1413 1413 Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl; 1414 1414 Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl; … … 1416 1416 Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl; 1417 1417 Log() << Verbose(0) << "\t-f/F <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl; 1418 Log() << Verbose(0) << "\t-F\tFilling Box with water molecules." << endl; 1418 1419 Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl; 1419 1420 Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl; 1421 Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl; 1420 1422 Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl; 1421 1423 Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl; … … 1575 1577 else { 1576 1578 Log() << Verbose(2) << "File found and parsed." << endl; 1577 // @TODO rather do the dissection afterwards1578 // mol->SetNameFromFilename(argv[argptr]);1579 // molecules->ListOfMolecules.remove(mol);1580 // molecules->DissectMoleculeIntoConnectedSubgraphs(mol,&configuration);1581 // delete(mol);1582 // if (molecules->ListOfMolecules.size() != 0) {1583 // for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++)1584 // if ((*ListRunner)->ActiveFlag) {1585 // mol = *ListRunner;1586 // break;1587 // }1588 // }1589 1579 configPresent = present; 1590 1580 } … … 1665 1655 //argptr+=1; 1666 1656 break; 1657 case 'I': 1658 Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl; 1659 // @TODO rather do the dissection afterwards 1660 molecules->DissectMoleculeIntoConnectedSubgraphs(mol,&configuration); 1661 mol = NULL; 1662 if (molecules->ListOfMolecules.size() != 0) { 1663 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 1664 if ((*ListRunner)->ActiveFlag) { 1665 mol = *ListRunner; 1666 break; 1667 } 1668 } 1669 if (mol == NULL) { 1670 mol = *(molecules->ListOfMolecules.begin()); 1671 mol->ActiveFlag = true; 1672 } 1673 break; 1667 1674 case 'C': 1668 1675 if (ExitFlag == 0) ExitFlag = 1; … … 1672 1679 performCriticalExit(); 1673 1680 } else { 1674 SaveFlag = false;1675 1681 ofstream output(argv[argptr+1]); 1676 1682 ofstream binoutput(argv[argptr+2]); … … 1692 1698 counter = 0; 1693 1699 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) { 1694 Actives[counter ] = (*BigFinder)->ActiveFlag;1700 Actives[counter++] = (*BigFinder)->ActiveFlag; 1695 1701 (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true; 1696 1702 } … … 1705 1711 binoutput.close(); 1706 1712 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) 1707 (*BigFinder)->ActiveFlag = Actives[counter ];1713 (*BigFinder)->ActiveFlag = Actives[counter++]; 1708 1714 Free(&Actives); 1709 1715 delete(LCList); … … 1728 1734 case 'F': 1729 1735 if (ExitFlag == 0) ExitFlag = 1; 1730 if (argptr+ 5>=argc) {1736 if (argptr+6 >=argc) { 1731 1737 ExitFlag = 255; 1732 eLog() << Verbose(0) << "Not enough or invalid arguments given for filling box with water: -F <dist_x> <dist_y> <dist_z> < randatom> <randmol> <DoRotate>" << endl;1738 eLog() << Verbose(0) << "Not enough or invalid arguments given for filling box with water: -F <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>" << endl; 1733 1739 performCriticalExit(); 1734 1740 } else { … … 1740 1746 atom *second = NULL, *third = NULL; 1741 1747 first = new atom(); 1742 first->type = periode->FindElement( 1);1743 first->x. Init(0.441, -0.143, 0.);1748 first->type = periode->FindElement(5); 1749 first->x.Zero(); 1744 1750 filler->AddAtom(first); 1745 second = new atom(); 1746 second->type = periode->FindElement(1); 1747 second->x.Init(-0.464, 1.137, 0.0); 1748 filler->AddAtom(second); 1749 third = new atom(); 1750 third->type = periode->FindElement(8); 1751 third->x.Init(-0.464, 0.177, 0.); 1752 filler->AddAtom(third); 1753 filler->AddBond(first, third, 1); 1754 filler->AddBond(second, third, 1); 1751 // first = new atom(); 1752 // first->type = periode->FindElement(1); 1753 // first->x.Init(0.441, -0.143, 0.); 1754 // filler->AddAtom(first); 1755 // second = new atom(); 1756 // second->type = periode->FindElement(1); 1757 // second->x.Init(-0.464, 1.137, 0.0); 1758 // filler->AddAtom(second); 1759 // third = new atom(); 1760 // third->type = periode->FindElement(8); 1761 // third->x.Init(-0.464, 0.177, 0.); 1762 // filler->AddAtom(third); 1763 // filler->AddBond(first, third, 1); 1764 // filler->AddBond(second, third, 1); 1755 1765 // call routine 1756 1766 double distance[NDIM]; 1757 1767 for (int i=0;i<NDIM;i++) 1758 1768 distance[i] = atof(argv[argptr+i]); 1759 Filling = FillBoxWithMolecule(molecules, filler, configuration, distance, atof(argv[argptr+3]), atof(argv[argptr+4]), ato i(argv[argptr+5]));1769 Filling = FillBoxWithMolecule(molecules, filler, configuration, distance, atof(argv[argptr+3]), atof(argv[argptr+4]), atof(argv[argptr+5]), atoi(argv[argptr+6])); 1760 1770 if (Filling != NULL) { 1771 Filling->ActiveFlag = false; 1761 1772 molecules->insert(Filling); 1762 1773 } -
src/molecule_geometry.cpp
r1cf5df r3930eb 101 101 { 102 102 int Num = 0; 103 atom *ptr = start ->next; // start at first in list103 atom *ptr = start; // start at first in list 104 104 105 105 Center.Zero(); 106 106 107 if (ptr != end) { //list not empty?107 if (ptr->next != end) { //list not empty? 108 108 while (ptr->next != end) { // continue with second if present 109 109 ptr = ptr->next;
Note:
See TracChangeset
for help on using the changeset viewer.