Changeset 4b8630
- Timestamp:
- Oct 25, 2011, 3:31:54 PM (13 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:
- be0c61
- Parents:
- 4fc828
- git-author:
- Frederik Heber <heber@…> (02/19/11 00:09:43)
- git-committer:
- Frederik Heber <heber@…> (10/25/11 15:31:54)
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/AnalysisAction/DipoleAngularCorrelationAction.cpp
r4fc828 r4b8630 56 56 binoutput.open(params.binoutputname.string().c_str()); 57 57 DipoleAngularCorrelationMap *correlationmap = NULL; 58 std::vector< molecule*> molecules = World::getInstance().getSelectedMolecules();59 LOG(0, "STATUS: There are " << molecules.size() << " selected molecules.");58 std::vector<atom*> atoms = World::getInstance().getSelectedAtoms(); 59 LOG(0, "STATUS: There are " << atoms.size() << " selected atoms."); 60 60 ASSERT(!params.periodic, "AnalysisDipoleAngularCorrelationAction() - periodic case not implemented."); 61 correlationmap = DipoleAngularCorrelation( molecules);61 correlationmap = DipoleAngularCorrelation(atoms); 62 62 OutputCorrelationMap<DipoleAngularCorrelationMap>(&output, correlationmap, OutputDipoleAngularCorrelation_Header, OutputDipoleAngularCorrelation_Value); 63 63 binmap = BinData( correlationmap, params.BinWidth, params.BinStart, params.BinEnd ); -
src/Analysis/analysis_correlation.cpp
r4fc828 r4b8630 31 31 #include "CodePatterns/Log.hpp" 32 32 #include "CodePatterns/Verbose.hpp" 33 #include "Descriptors/MoleculeOfAtomSelectionDescriptor.hpp" 33 34 #include "Formula.hpp" 34 35 #include "LinearAlgebra/Vector.hpp" … … 98 99 * Note given element order is unimportant (i.e. g(Si, O) === g(O, Si)) 99 100 * Angles are given in degrees. 100 * \param *molecules vector of molecules 101 * \param &atoms list of atoms of the molecules taking part (Note: molecules may 102 * change over time as bond structure is recalculated, hence we need the atoms) 101 103 * \return Map of doubles with values the pair of the two atoms. 102 104 */ 103 DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector< molecule *> &molecules)105 DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector<atom *> &atoms) 104 106 { 105 107 Info FunctionInfo(__func__); 106 108 DipoleAngularCorrelationMap *outmap = new DipoleAngularCorrelationMap; 107 // double distance = 0.; 108 // Box &domain = World::getInstance().getDomain(); 109 // 110 if (molecules.empty()) { 111 DoeLog(1) && (eLog()<< Verbose(1) <<"No molecule given." << endl); 112 return outmap; 113 } 109 std::set<molecule *> molecules; 114 110 115 111 // store original time step 116 112 const unsigned int oldtime = WorldTime::getTime(); 117 113 World::getInstance().setTime(0); 114 // calculate molecules for this time step 115 BOOST_FOREACH(atom *_atom, atoms) 116 molecules.insert(_atom->getMolecule()); 118 117 119 118 BOOST_FOREACH(atom *_atom, World::getInstance().getAllAtoms()) … … 155 154 for (size_t step = 1; step < max_timesteps; ++step) { 156 155 World::getInstance().setTime(step); 156 // recalculate molecules for this time step 157 molecules.clear(); 158 BOOST_FOREACH(atom *_atom, atoms) 159 molecules.insert(_atom->getMolecule()); 157 160 size_t i=0; 158 161 BOOST_FOREACH(molecule *_mol, molecules) { … … 161 164 const double angle = Dipole.Angle(ZeroVector[i]) * (180./M_PI); 162 165 LOG(1,"INFO: Resulting relative angle for molecule " << _mol->getId() << " is " << angle << "."); 163 outmap->insert ( make_pair (angle, _mol) );166 outmap->insert ( make_pair (angle, *_mol->begin() ) ); 164 167 ++i; 165 168 } … … 591 594 void OutputDipoleAngularCorrelation_Header( ofstream * const file ) 592 595 { 593 *file << "\t Molecule";596 *file << "\tFirstAtomOfMolecule"; 594 597 }; 595 598 … … 601 604 void OutputDipoleAngularCorrelation_Value( ofstream * const file, DipoleAngularCorrelationMap::const_iterator &runner ) 602 605 { 603 *file << runner->second->get Id();606 *file << runner->second->getName(); 604 607 }; 605 608 -
src/Analysis/analysis_correlation.hpp
r4fc828 r4b8630 46 46 47 47 typedef multimap<double, pair<atom *, atom *> > PairCorrelationMap; 48 typedef multimap<double, molecule* > DipoleAngularCorrelationMap;48 typedef multimap<double, atom * > DipoleAngularCorrelationMap; 49 49 typedef multimap<double, pair<molecule *, molecule *> > DipoleCorrelationMap; 50 50 typedef multimap<double, pair<atom *, const Vector *> > CorrelationToPointMap; … … 54 54 /********************************************** declarations *******************************/ 55 55 56 DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector< molecule *> &molecules);56 DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector<atom *> &atoms); 57 57 DipoleCorrelationMap *DipoleCorrelation(std::vector<molecule *> &molecules); 58 58 PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements); -
src/World.cpp
r4fc828 r4b8630 25 25 26 26 #include "Actions/ActionTraits.hpp" 27 //#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"28 27 #include "Actions/ManipulateAtomsProcess.hpp" 29 28 #include "atom.hpp" … … 37 36 #include "Descriptors/MoleculeDescriptor_impl.hpp" 38 37 #include "Descriptors/SelectiveIterator_impl.hpp" 38 #include "Graph/DepthFirstSearchAnalysis.hpp" 39 39 #include "Helpers/defs.hpp" 40 40 #include "LinearAlgebra/RealSpaceMatrix.hpp" … … 137 137 // set new time 138 138 WorldTime::setTime(_step); 139 // re-instantiate bond structure 140 //FragmentationSubgraphDissection(); 139 // TODO: removed when BondGraph creates the adjacency 140 // 1. remove all of World's molecules 141 for (MoleculeIterator iter = getMoleculeIter(); 142 getMoleculeIter() != moleculeEnd(); 143 iter = getMoleculeIter()) { 144 getMolecules()->erase(*iter); 145 destroyMolecule(*iter); 146 } 147 // 2. (re-)create bondgraph 148 AtomComposite Set = getAllAtoms(); 149 BG->CreateAdjacency(Set); 150 151 // 3. scan for connected subgraphs => molecules 152 DepthFirstSearchAnalysis DFS; 153 DFS(); 154 DFS.UpdateMoleculeStructure(); 141 155 } 142 156 } -
tests/regression/Analysis/DipoleAngularCorrelation/testsuite-analysis-dipole-angular-correlation.at
r4fc828 r4b8630 4 4 AT_KEYWORDS([analysis dipole correlation pdb dipole-angular-correlation]) 5 5 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Analysis/DipoleAngularCorrelation/pre/watermulti_X.pdb .], 0) 6 AT_CHECK([../../molecuilder -v 4 -i watermulti_X.pdb -o pdb --select-molecules-by-formula H2O -- dipole-angular-correlation --bin-start -5 --bin-width 10. --bin-end 184.5 --output-file water_values_X.dat --bin-output-file water_histogram_X.dat], 0, [stdout], [stderr])6 AT_CHECK([../../molecuilder -v 4 -i watermulti_X.pdb -o pdb --select-molecules-by-formula H2O --select-molecules-atoms --dipole-angular-correlation --bin-start -5 --bin-width 10. --bin-end 184.5 --output-file water_values_X.dat --bin-output-file water_histogram_X.dat], 0, [stdout], [stderr]) 7 7 AT_CHECK([file=water_histogram_X.dat; diff $file ${abs_top_srcdir}/tests/regression/Analysis/DipoleAngularCorrelation/post/$file], 0, [ignore], [ignore]) 8 8 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Analysis/DipoleAngularCorrelation/pre/watermulti_Y.pdb .], 0) 9 AT_CHECK([../../molecuilder -v 4 -i watermulti_Y.pdb -o pdb --select-molecules-by-formula H2O -- dipole-angular-correlation --bin-start -5 --bin-width 10. --bin-end 184.5 --output-file water_values_Y.dat --bin-output-file water_histogram_Y.dat], 0, [stdout], [stderr])9 AT_CHECK([../../molecuilder -v 4 -i watermulti_Y.pdb -o pdb --select-molecules-by-formula H2O --select-molecules-atoms --dipole-angular-correlation --bin-start -5 --bin-width 10. --bin-end 184.5 --output-file water_values_Y.dat --bin-output-file water_histogram_Y.dat], 0, [stdout], [stderr]) 10 10 AT_CHECK([file=water_histogram_Y.dat; diff $file ${abs_top_srcdir}/tests/regression/Analysis/DipoleAngularCorrelation/post/$file], 0, [ignore], [ignore]) 11 11 AT_CLEANUP 12 12 13 AT_SETUP([Analysis - dipole angular correlation on XYZs]) 14 AT_KEYWORDS([analysis dipole correlation xyz dipole-angular-correlation]) 15 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Analysis/DipoleAngularCorrelation/pre/watermulti_X.xyz .], 0) 16 AT_CHECK([../../molecuilder -v 4 -i watermulti_X.xyz -o xyz -I --select-molecules-by-formula H2O --select-molecules-atoms --dipole-angular-correlation --bin-start -5 --bin-width 10. --bin-end 184.5 --output-file water_values_X.dat --bin-output-file water_histogram_X.dat], 0, [stdout], [stderr]) 17 AT_CHECK([file=water_histogram_X.dat; diff $file ${abs_top_srcdir}/tests/regression/Analysis/DipoleAngularCorrelation/post/$file], 0, [ignore], [ignore]) 18 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Analysis/DipoleAngularCorrelation/pre/watermulti_Y.xyz .], 0) 19 AT_CHECK([../../molecuilder -v 4 -i watermulti_Y.xyz -o xyz -I --select-molecules-by-formula H2O --select-molecules-atoms --dipole-angular-correlation --bin-start -5 --bin-width 10. --bin-end 184.5 --output-file water_values_Y.dat --bin-output-file water_histogram_Y.dat], 0, [stdout], [stderr]) 20 AT_CHECK([file=water_histogram_Y.dat; diff $file ${abs_top_srcdir}/tests/regression/Analysis/DipoleAngularCorrelation/post/$file], 0, [ignore], [ignore]) 21 AT_CLEANUP 22
Note:
See TracChangeset
for help on using the changeset viewer.