Changeset d9e1d1
- Timestamp:
- Apr 23, 2021, 8:34:11 PM (5 years ago)
- Branches:
- Candidate_v1.7.0, stable
- Children:
- ef0f8f
- Parents:
- addb51
- git-author:
- Frederik Heber <frederik.heber@…> (10/03/20 21:20:26)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/23/21 20:34:11)
- Files:
-
- 4 edited
-
doc/userguide/userguide.xml (modified) (1 diff)
-
src/Actions/AnalysisAction/PairCorrelationAction.cpp (modified) (1 diff)
-
src/Actions/AnalysisAction/PairCorrelationAction.def (modified) (2 diffs)
-
tests/regression/Analysis/PairCorrelation/testsuite-analysis-pair-correlation.at (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
doc/userguide/userguide.xml
raddb51 rd9e1d1 1743 1743 of a hydrogen and an oxygen atom can be found within its distance 1744 1744 interval. These data files can be used for plotting the distribution right away in order to check on the correlation between the elements.</para> 1745 <para>The action may also be called with just a single element in the 1746 option <emphasis>elements</emphasis>. This will then trigger a pair 1747 correlation between all atoms of this element and the set of 1748 currently selected atoms.</para> 1745 1749 </section> 1746 1750 <section xml:id="analysis.dipole-correlation"> -
src/Actions/AnalysisAction/PairCorrelationAction.cpp
raddb51 rd9e1d1 68 68 binoutput.open(params.binoutputname.get().string().c_str()); 69 69 PairCorrelationMap *correlationmap = NULL; 70 ASSERT(params.elements.get().size() == 2, 71 "AnalysisPairCorrelationAction::performCall() - Exactly two elements are required for pair correlation."); 72 std::vector<const element *>::const_iterator elemiter = params.elements.get().begin(); 73 const World::ConstAtomComposite atoms_first = 74 const_cast<const World &>(World::getInstance()).getAllAtoms(AtomByType(*(elemiter++))); 75 const World::ConstAtomComposite atoms_second = 76 const_cast<const World &>(World::getInstance()).getAllAtoms(AtomByType(*(elemiter++))); 77 ASSERT(elemiter == params.elements.get().end(), 78 "AnalysisPairCorrelationAction::performCall() - Exactly two elements are required for pair correlation."); 70 World::ConstAtomComposite atoms_first; 71 World::ConstAtomComposite atoms_second; 72 if (params.elements.get().size() == 2) { 73 std::vector<const element *>::const_iterator elemiter = params.elements.get().begin(); 74 atoms_first = World::getConstInstance().getAllAtoms(AtomByType(*(elemiter++))); 75 if (elemiter != params.elements.get().end()) { 76 atoms_second = World::getConstInstance().getAllAtoms(AtomByType(*(elemiter++))); 77 } else { 78 atoms_second = World::getConstInstance().getSelectedAtoms(); 79 } 80 } else if (params.elements.get().size() == 1) { 81 std::vector<const element *>::const_iterator elemiter = params.elements.get().begin(); 82 atoms_first = World::getConstInstance().getSelectedAtoms(); 83 atoms_second = World::getConstInstance().getAllAtoms(AtomByType(*(elemiter++))); 84 } else { 85 STATUS("Either one or two elements must be given."); 86 return Action::failure; 87 } 79 88 double max_distance = params.BinEnd.get(); 80 89 if (params.BinEnd.get() <= 0.) { -
src/Actions/AnalysisAction/PairCorrelationAction.def
raddb51 rd9e1d1 29 29 #define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(0.5))(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(false)) 30 30 #define paramvalids \ 31 (STLVectorValidator< std::vector<const element *> >( 2,2, ElementValidator())) \31 (STLVectorValidator< std::vector<const element *> >(1,2, ElementValidator())) \ 32 32 (BoxLengthValidator()) \ 33 33 (BoxLengthValidator()) \ … … 45 45 46 46 // finally the information stored in the ActionTrait specialization 47 #define DESCRIPTION "pair correlation analysis between two elements"47 #define DESCRIPTION "pair correlation analysis between all atoms of two given elements, or between the selected atoms and the atoms of the single given element" 48 48 #define SHORTFORM "C" -
tests/regression/Analysis/PairCorrelation/testsuite-analysis-pair-correlation.at
raddb51 rd9e1d1 35 35 AT_CLEANUP 36 36 37 38 AT_SETUP([Analysis - pair correlation against element]) 39 AT_KEYWORDS([analysis correlation pair-correlation element]) 40 41 # here, we correlate all atoms against all of a single element 42 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Analysis/PairCorrelation/pre/test.conf .], 0) 43 AT_CHECK([../../molecuilder -i test.conf -v 3 --set-boundary-conditions Wrap Wrap Wrap --pair-correlation --elements 8 --output-file output.csv --bin-output-file bin_output.csv --bin-start 0 --bin-end 20], 0, [stdout], [stderr]) 44 AT_CHECK([fgrep "Begin of PairCorrelation" stdout], 0, [ignore], [ignore]) 45 #AT_CHECK([file=output.csv; diff $file ${abs_top_srcdir}/tests/regression/Analysis/PairCorrelation/post/output.csv], 0, [ignore], [ignore]) 46 AT_CHECK([file=bin_output.csv; diff $file ${abs_top_srcdir}/tests/regression/Analysis/PairCorrelation/post/bin_output.csv], 0, [ignore], [ignore]) 47 sum=0; 48 for num in `tail -n 41 bin_output.csv | awk -F" " {'print $4'}`; do 49 let sum=$sum+$num; 50 done; 51 # 31 oxygens on 62 hydrogens yields 1922 values 52 AT_CHECK([test $sum -eq 1922], 0, [ignore], [ignore]) 53 54 AT_CLEANUP 55 56
Note:
See TracChangeset
for help on using the changeset viewer.
