Changes in / [13510b:7ba268]
- Files:
-
- 89 added
- 7 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/AnalysisAction/DipoleAngularCorrelationAction.cpp
r13510b r7ba268 9 9 * DipoleAngularCorrelationAction.cpp 10 10 * 11 * Created on: May 9, 201011 * Created on: Feb 11, 2011 12 12 * Author: heber 13 13 */ … … 23 23 #include "Tesselation/boundary.hpp" 24 24 #include "linkedcell.hpp" 25 #include "CodePatterns/Verbose.hpp"26 25 #include "CodePatterns/Log.hpp" 26 #include "Descriptors/AtomOfMoleculeSelectionDescriptor.hpp" 27 #include "Descriptors/MoleculeFormulaDescriptor.hpp" 27 28 #include "Element/element.hpp" 28 #include "molecule.hpp"29 29 #include "Element/periodentafel.hpp" 30 30 #include "LinearAlgebra/Vector.hpp" 31 #include "molecule.hpp" 31 32 #include "World.hpp" 33 #include "WorldTime.hpp" 32 34 33 35 #include <iostream> 36 #include <map> 34 37 #include <string> 35 38 … … 45 48 Action::state_ptr AnalysisDipoleAngularCorrelationAction::performCall() { 46 49 //int ranges[3] = {1, 1, 1}; 47 ofstream output;48 ofstream binoutput;49 50 string type; 50 BinPairMap *binmap = NULL;51 51 52 52 // obtain information 53 53 getParametersfromValueStorage(); 54 ASSERT(!params.periodic, "AnalysisDipoleAngularCorrelationAction() - periodic case not implemented."); 54 55 55 // execute action 56 output.open(params.outputname.string().c_str()); 57 binoutput.open(params.binoutputname.string().c_str()); 58 DipoleAngularCorrelationMap *correlationmap = NULL; 59 std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules(); 60 DoLog(0) && (Log() << Verbose(0) << "There are " << molecules.size() << " selected molecules." << std::endl); 61 ASSERT(!params.periodic, "AnalysisDipoleAngularCorrelationAction() - periodic case not implemented."); 62 correlationmap = DipoleAngularCorrelation(molecules); 63 OutputCorrelationMap<DipoleAngularCorrelationMap>(&output, correlationmap, OutputDipoleAngularCorrelation_Header, OutputDipoleAngularCorrelation_Value); 64 binmap = BinData( correlationmap, params.BinWidth, params.BinStart, params.BinEnd ); 65 OutputCorrelationMap<BinPairMap> ( &binoutput, binmap, OutputCorrelation_Header, OutputCorrelation_Value ); 66 delete(binmap); 67 delete(correlationmap); 68 output.close(); 69 binoutput.close(); 56 // get selected atoms 57 std::vector<atom*> old_atom_selection = World::getInstance().getSelectedAtoms(); 58 std::vector<molecule*> old_molecule_selection = World::getInstance().getSelectedMolecules(); 59 60 // get current time step 61 const unsigned int oldtime = WorldTime::getTime(); 62 63 // select atoms and obtain zero dipole orientation 64 Formula DipoleFormula(params.DipoleFormula); 65 World::getInstance().setTime(params.timestepzero); 66 World::getInstance().clearMoleculeSelection(); // TODO: This should be done in setTime or where molecules are re-done 67 World::getInstance().selectAllMolecules(MoleculeByFormula(DipoleFormula)); 68 std::vector<molecule *> molecules = World::getInstance().getSelectedMolecules(); 69 std::map<atomId_t, Vector> ZeroVector = CalculateZeroAngularDipole(molecules); 70 71 // go through each step of common trajectory of all atoms in set 72 World::getInstance().clearAtomSelection(); 73 World::getInstance().selectAllAtoms(AtomsByMoleculeSelection()); 74 std::vector<atom *> atoms = World::getInstance().getSelectedAtoms(); 75 ASSERT(!atoms.empty(), 76 "AnalysisDipoleAngularCorrelationAction::performCall() - " 77 +toString(DipoleFormula)+" selects no atoms."); 78 range<size_t> timesteps = getMaximumTrajectoryBounds(atoms); 79 ASSERT(params.timestepzero < timesteps.first, 80 "AnalysisDipoleAngularCorrelationAction::performCall() - time step zero " 81 +toString(params.timestepzero)+" is beyond trajectory range (" 82 +toString(timesteps.first)+") of some atoms."); 83 for (size_t step = params.timestepzero; step < timesteps.first; ++step) { 84 // calculate dipoles relative to zero orientation 85 DipoleAngularCorrelationMap *correlationmap = NULL; 86 correlationmap = DipoleAngularCorrelation(DipoleFormula, step, ZeroVector, DontResetTime); 87 88 // prepare step string in filename 89 std::stringstream stepstream; 90 stepstream << std::setw(4) << std::setfill('0') << step; 91 const std::string stepname(stepstream.str()); 92 93 // output correlation map 94 ofstream output; 95 std::string filename = params.outputname.string()+"."+stepname+".dat"; 96 output.open(filename.c_str()); 97 OutputCorrelationMap<DipoleAngularCorrelationMap>(&output, correlationmap, OutputDipoleAngularCorrelation_Header, OutputDipoleAngularCorrelation_Value); 98 output.close(); 99 100 // bin map 101 BinPairMap *binmap = BinData( correlationmap, params.BinWidth, params.BinStart, params.BinEnd ); 102 103 // free correlation map 104 delete(correlationmap); 105 106 // output binned map 107 ofstream binoutput; 108 std::string binfilename = params.binoutputname.string()+"."+stepname+".dat"; 109 binoutput.open(binfilename.c_str()); 110 OutputCorrelationMap<BinPairMap> ( &binoutput, binmap, OutputCorrelation_Header, OutputCorrelation_Value ); 111 binoutput.close(); 112 113 // free binned map 114 delete(binmap); 115 } 116 117 // reset to old time step 118 World::getInstance().setTime(oldtime); 119 120 // reset to old selections 121 World::getInstance().clearAtomSelection(); 122 BOOST_FOREACH(atom *_atom, old_atom_selection) { 123 World::getInstance().selectAtom(_atom); 124 } 125 World::getInstance().clearMoleculeSelection(); 126 BOOST_FOREACH(molecule *_mol, old_molecule_selection) { 127 World::getInstance().selectMolecule(_mol); 128 } 129 130 // exit 70 131 return Action::success; 71 132 } -
src/Actions/AnalysisAction/DipoleAngularCorrelationAction.def
r13510b r7ba268 2 2 * DipoleAngularCorrelationAction.def 3 3 * 4 * Created on: Aug 25, 20104 * Created on: Feb 11, 2011 5 5 * Author: heber 6 6 */ … … 13 13 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 14 14 // "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value 15 #define paramtypes ( double)(double)(double)(boost::filesystem::path)(boost::filesystem::path)(bool)16 #define paramreferences ( BinStart)(BinWidth)(BinEnd)(outputname)(binoutputname)(periodic)17 #define paramtokens (" bin-start")("bin-width")("bin-end")("output-file")("bin-output-file")("periodic")18 #define paramdescriptions (" start of the first bin")("width of the bins")("start of the last bin")("name of the output file")("name of the bin output file")("system is constraint to periodic boundary conditions")19 #define paramdefaults (NODEFAULT)( "0.5")(NODEFAULT)(NODEFAULT)(NODEFAULT)("0")15 #define paramtypes (std::string)(double)(double)(double)(boost::filesystem::path)(boost::filesystem::path)(bool)(unsigned int) 16 #define paramreferences (DipoleFormula)(BinStart)(BinWidth)(BinEnd)(outputname)(binoutputname)(periodic)(timestepzero) 17 #define paramtokens ("dipole-angular-correlation")("bin-start")("bin-width")("bin-end")("output-file")("bin-output-file")("periodic")("time-step-zero") 18 #define paramdescriptions ("formula of molecules to calculate dipole of")("start of the first bin")("width of the bins")("start of the last bin")("name of the output file")("name of the bin output file")("system is constraint to periodic boundary conditions")("initial time step to correlate following ones against") 19 #define paramdefaults (NODEFAULT)(NODEFAULT)("0.5")(NODEFAULT)(NODEFAULT)(NODEFAULT)("0")("0") 20 20 21 21 // some defines for all the names, you may use ACTION, STATE and PARAMS … … 24 24 #define MENUPOSITION 3 25 25 #define ACTIONNAME DipoleAngularCorrelation 26 #define TOKEN "dipole- correlation"26 #define TOKEN "dipole-angular-correlation" 27 27 28 28 // finally the information stored in the ActionTrait specialization -
src/Actions/AnalysisAction/DipoleAngularCorrelationAction.hpp
r13510b r7ba268 2 2 * DipoleAngularCorrelationAction.hpp 3 3 * 4 * Created on: May 9, 20104 * Created on: Feb 11, 2011 5 5 * Author: heber 6 6 */ -
src/Actions/Makefile.am
r13510b r7ba268 88 88 ANALYSISACTIONSOURCE = \ 89 89 Actions/AnalysisAction/DipoleAngularCorrelationAction.cpp \ 90 Actions/AnalysisAction/DipoleCorrelationAction.cpp \ 90 91 Actions/AnalysisAction/MolecularVolumeAction.cpp \ 91 92 Actions/AnalysisAction/PairCorrelationAction.cpp \ … … 95 96 ANALYSISACTIONHEADER = \ 96 97 Actions/AnalysisAction/DipoleAngularCorrelationAction.hpp \ 98 Actions/AnalysisAction/DipoleCorrelationAction.hpp \ 97 99 Actions/AnalysisAction/MolecularVolumeAction.hpp \ 98 100 Actions/AnalysisAction/PairCorrelationAction.hpp \ … … 102 104 ANALYSISACTIONDEFS = \ 103 105 Actions/AnalysisAction/DipoleAngularCorrelationAction.def \ 106 Actions/AnalysisAction/DipoleCorrelationAction.def \ 104 107 Actions/AnalysisAction/MolecularVolumeAction.def \ 105 108 Actions/AnalysisAction/PairCorrelationAction.def \ -
src/Analysis/analysis_correlation.cpp
r13510b r7ba268 22 22 #include <iostream> 23 23 #include <iomanip> 24 #include <limits> 24 25 25 26 #include "atom.hpp" … … 30 31 #include "CodePatterns/Info.hpp" 31 32 #include "CodePatterns/Log.hpp" 33 #include "CodePatterns/Verbose.hpp" 34 #include "Descriptors/AtomOfMoleculeSelectionDescriptor.hpp" 35 #include "Descriptors/MoleculeFormulaDescriptor.hpp" 36 #include "Descriptors/MoleculeOfAtomSelectionDescriptor.hpp" 32 37 #include "Formula.hpp" 38 #include "LinearAlgebra/Vector.hpp" 39 #include "LinearAlgebra/RealSpaceMatrix.hpp" 33 40 #include "molecule.hpp" 34 41 #include "Tesselation/tesselation.hpp" … … 36 43 #include "Tesselation/triangleintersectionlist.hpp" 37 44 #include "World.hpp" 38 #include "LinearAlgebra/Vector.hpp" 39 #include "LinearAlgebra/RealSpaceMatrix.hpp" 40 #include "CodePatterns/Verbose.hpp" 41 #include "World.hpp" 42 #include "Box.hpp" 45 #include "WorldTime.hpp" 43 46 44 47 #include "analysis_correlation.hpp" … … 67 70 // go through all bonds 68 71 const BondList& ListOfBonds = (*atomiter)->getListOfBonds(); 72 ASSERT(ListOfBonds.begin() != ListOfBonds.end(), 73 "getDipole() - no bonds in molecule!"); 69 74 for (BondList::const_iterator bonditer = ListOfBonds.begin(); 70 75 bonditer != ListOfBonds.end(); … … 78 83 BondDipoleVector.Normalize(); 79 84 BondDipoleVector *= DeltaEN; 85 LOG(3,"INFO: Dipole vector from bond " << **bonditer << " is " << BondDipoleVector); 80 86 DipoleVector += BondDipoleVector; 81 87 SumOfVectors++; … … 83 89 } 84 90 } 85 DipoleVector *= 1./(double)SumOfVectors; 91 LOG(3,"INFO: Sum over all bond dipole vectors is " 92 << DipoleVector << " with " << SumOfVectors << " in total."); 93 if (SumOfVectors != 0) 94 DipoleVector *= 1./(double)SumOfVectors; 86 95 DoLog(1) && (Log() << Verbose(1) << "Resulting dipole vector is " << DipoleVector << std::endl); 87 96 … … 89 98 }; 90 99 100 /** Calculate minimum and maximum amount of trajectory steps by going through given atomic trajectories. 101 * \param vector of atoms whose trajectories to check for [min,max] 102 * \return range with [min, max] 103 */ 104 range<size_t> getMaximumTrajectoryBounds(const std::vector<atom *> &atoms) 105 { 106 // get highest trajectory size 107 LOG(0,"STATUS: Retrieving maximum amount of time steps ..."); 108 if (atoms.size() == 0) 109 return range<size_t>(0,0); 110 size_t max_timesteps = std::numeric_limits<size_t>::min(); 111 size_t min_timesteps = std::numeric_limits<size_t>::max(); 112 BOOST_FOREACH(atom *_atom, atoms) { 113 if (_atom->getTrajectorySize() > max_timesteps) 114 max_timesteps = _atom->getTrajectorySize(); 115 if (_atom->getTrajectorySize() < min_timesteps) 116 min_timesteps = _atom->getTrajectorySize(); 117 } 118 LOG(1,"INFO: Minimum number of time steps found is " << min_timesteps); 119 LOG(1,"INFO: Maximum number of time steps found is " << max_timesteps); 120 121 return range<size_t>(min_timesteps, max_timesteps); 122 } 123 124 /** Calculates the angular dipole zero orientation from current time step. 125 * \param molecules vector of molecules to calculate dipoles of 126 * \return map with orientation vector for each atomic id given in \a atoms. 127 */ 128 std::map<atomId_t, Vector> CalculateZeroAngularDipole(const std::vector<molecule *> &molecules) 129 { 130 // get zero orientation for each molecule. 131 LOG(0,"STATUS: Calculating dipoles for current time step ..."); 132 std::map<atomId_t, Vector> ZeroVector; 133 BOOST_FOREACH(molecule *_mol, molecules) { 134 const Vector Dipole = getDipole(_mol->begin(), _mol->end()); 135 for(molecule::const_iterator iter = _mol->begin(); iter != _mol->end(); ++iter) 136 ZeroVector[(*iter)->getId()] = Dipole; 137 LOG(2,"INFO: Zero alignment for molecule " << _mol->getId() << " is " << Dipole); 138 } 139 LOG(1,"INFO: We calculated zero orientation for a total of " << molecules.size() << " molecule(s)."); 140 141 return ZeroVector; 142 } 143 91 144 /** Calculates the dipole angular correlation for given molecule type. 145 * Calculate the change of the dipole orientation angle over time. 146 * Note given element order is unimportant (i.e. g(Si, O) === g(O, Si)) 147 * Angles are given in degrees. 148 * \param &atoms list of atoms of the molecules taking part (Note: molecules may 149 * change over time as bond structure is recalculated, hence we need the atoms) 150 * \param timestep time step to calculate angular correlation for (relative to 151 * \a ZeroVector) 152 * \param ZeroVector map with Zero orientation vector for each atom in \a atoms. 153 * \param DontResetTime don't reset time to old value (triggers re-creation of bond system) 154 * \return Map of doubles with values the pair of the two atoms. 155 */ 156 DipoleAngularCorrelationMap *DipoleAngularCorrelation( 157 const Formula &DipoleFormula, 158 const size_t timestep, 159 const std::map<atomId_t, Vector> &ZeroVector, 160 const enum ResetWorldTime DoTimeReset 161 ) 162 { 163 Info FunctionInfo(__func__); 164 DipoleAngularCorrelationMap *outmap = new DipoleAngularCorrelationMap; 165 166 unsigned int oldtime = 0; 167 if (DoTimeReset == DoResetTime) { 168 // store original time step 169 oldtime = WorldTime::getTime(); 170 } 171 172 // set time step 173 LOG(0,"STATUS: Stepping onto to time step " << timestep << "."); 174 World::getInstance().setTime(timestep); 175 176 // get all molecules for this time step 177 World::getInstance().clearMoleculeSelection(); 178 World::getInstance().selectAllMolecules(MoleculeByFormula(DipoleFormula)); 179 std::vector<molecule *> molecules = World::getInstance().getSelectedMolecules(); 180 LOG(1,"INFO: There are " << molecules.size() << " molecules for time step " << timestep << "."); 181 182 // calculate dipoles for each 183 LOG(0,"STATUS: Calculating dipoles for time step " << timestep << " ..."); 184 size_t i=0; 185 size_t Counter_rejections = 0; 186 BOOST_FOREACH(molecule *_mol, molecules) { 187 const Vector Dipole = getDipole(_mol->begin(), _mol->end()); 188 LOG(3,"INFO: Dipole vector at time step " << timestep << " for for molecule " 189 << _mol->getId() << " is " << Dipole); 190 // check that all atoms are valid (zeroVector known) 191 molecule::const_iterator iter = _mol->begin(); 192 for(; iter != _mol->end(); ++iter) { 193 if (!ZeroVector.count((*iter)->getId())) 194 break; 195 } 196 if (iter != _mol->end()) { 197 ELOG(2, "Skipping molecule " << _mol->getName() << " as not all atoms have a valid zeroVector."); 198 ++Counter_rejections; 199 continue; 200 } else 201 iter = _mol->begin(); 202 std::map<atomId_t, Vector>::const_iterator zeroValue = ZeroVector.find((*iter)->getId()); //due to iter is const 203 double angle = 0.; 204 LOG(2, "INFO: ZeroVector of first atom " << **iter << " is " 205 << zeroValue->second << "."); 206 LOG(4, "INFO: Squared norm of difference vector is " 207 << (zeroValue->second - Dipole).NormSquared() << "."); 208 if ((zeroValue->second - Dipole).NormSquared() > MYEPSILON) 209 angle = Dipole.Angle(zeroValue->second) * (180./M_PI); 210 else 211 LOG(2, "INFO: Both vectors (almost) coincide, numerically unstable, angle set to zero."); 212 LOG(1,"INFO: Resulting relative angle for molecule " << _mol->getName() 213 << " is " << angle << "."); 214 outmap->insert ( make_pair (angle, *iter ) ); 215 ++i; 216 } 217 ASSERT(Counter_rejections <= molecules.size(), 218 "DipoleAngularCorrelation() - more rejections ("+toString(Counter_rejections) 219 +") than there are molecules ("+toString(molecules.size())+")."); 220 LOG(1,"INFO: " << Counter_rejections << " molecules have been rejected in time step " << timestep << "."); 221 222 LOG(0,"STATUS: Done with calculating dipoles."); 223 224 if (DoTimeReset == DoResetTime) { 225 // re-set to original time step again 226 World::getInstance().setTime(oldtime); 227 } 228 229 // and return results 230 return outmap; 231 }; 232 233 /** Calculates the dipole correlation for given molecule type. 234 * I.e. we calculate how the angle between any two given dipoles in the 235 * systems behaves. Sort of pair correlation but distance is replaced by 236 * the orientation distance, i.e. an angle. 92 237 * Note given element order is unimportant (i.e. g(Si, O) === g(O, Si)) 93 238 * Angles are given in degrees. … … 95 240 * \return Map of doubles with values the pair of the two atoms. 96 241 */ 97 Dipole AngularCorrelationMap *DipoleAngularCorrelation(std::vector<molecule *> &molecules)242 DipoleCorrelationMap *DipoleCorrelation(std::vector<molecule *> &molecules) 98 243 { 99 244 Info FunctionInfo(__func__); 100 Dipole AngularCorrelationMap *outmap = new DipoleAngularCorrelationMap;245 DipoleCorrelationMap *outmap = new DipoleCorrelationMap; 101 246 // double distance = 0.; 102 247 // Box &domain = World::getInstance().getDomain(); … … 107 252 } 108 253 109 outmap = new DipoleAngularCorrelationMap;110 254 for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); 111 255 MolWalker != molecules.end(); ++MolWalker) { … … 168 312 outmap = new PairCorrelationMap; 169 313 for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); MolWalker != molecules.end(); MolWalker++){ 170 DoLog(2) && (Log()<< Verbose(2) << "Current molecule is " << *MolWalker<< "." << endl);314 DoLog(2) && (Log()<< Verbose(2) << "Current molecule is " << (*MolWalker)->getName() << "." << endl); 171 315 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 172 316 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl); 173 317 for (std::vector<molecule *>::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules.end(); MolOtherWalker++){ 174 DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker<< "." << endl);318 DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << (*MolOtherWalker)->getName() << "." << endl); 175 319 for (molecule::const_iterator runner = (*MolOtherWalker)->begin(); runner != (*MolOtherWalker)->end(); ++runner) { 176 320 DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl); … … 503 647 void OutputDipoleAngularCorrelation_Header( ofstream * const file ) 504 648 { 505 *file << "\t Atom1\tAtom2";506 }; 507 508 /** Prints values stored in Dipole AngularCorrelationMap iterator.649 *file << "\tFirstAtomOfMolecule"; 650 }; 651 652 /** Prints values stored in DipoleCorrelationMap iterator. 509 653 * 510 654 * @param file stream to print to … … 512 656 */ 513 657 void OutputDipoleAngularCorrelation_Value( ofstream * const file, DipoleAngularCorrelationMap::const_iterator &runner ) 658 { 659 *file << *(runner->second); 660 }; 661 662 663 /** Adds header part that is unique to DipoleAngularCorrelationMap. 664 * 665 * @param file stream to print to 666 */ 667 void OutputDipoleCorrelation_Header( ofstream * const file ) 668 { 669 *file << "\tMolecule"; 670 }; 671 672 /** Prints values stored in DipoleCorrelationMap iterator. 673 * 674 * @param file stream to print to 675 * @param runner iterator pointing at values to print 676 */ 677 void OutputDipoleCorrelation_Value( ofstream * const file, DipoleCorrelationMap::const_iterator &runner ) 514 678 { 515 679 *file << runner->second.first->getId() << "\t" << runner->second.second->getId(); -
src/Analysis/analysis_correlation.hpp
r13510b r7ba268 31 31 #include "CodePatterns/Info.hpp" 32 32 #include "CodePatterns/Log.hpp" 33 #include "CodePatterns/Range.hpp" 33 34 #include "CodePatterns/Verbose.hpp" 34 35 #include "Helpers/helpers.hpp" … … 46 47 47 48 typedef multimap<double, pair<atom *, atom *> > PairCorrelationMap; 48 typedef multimap<double, pair<molecule *, molecule *> > DipoleAngularCorrelationMap; 49 typedef multimap<double, atom * > DipoleAngularCorrelationMap; 50 typedef multimap<double, pair<molecule *, molecule *> > DipoleCorrelationMap; 49 51 typedef multimap<double, pair<atom *, const Vector *> > CorrelationToPointMap; 50 52 typedef multimap<double, pair<atom *, BoundaryTriangleSet *> > CorrelationToSurfaceMap; 51 53 typedef map<double, int> BinPairMap; 52 54 55 enum ResetWorldTime { 56 DontResetTime, 57 DoResetTime 58 }; 59 53 60 /********************************************** declarations *******************************/ 54 61 55 DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector<molecule *> &molecules); 62 range<size_t> getMaximumTrajectoryBounds(const std::vector<atom *> &atoms); 63 std::map<atomId_t, Vector> CalculateZeroAngularDipole(const std::vector<molecule *> &molecules); 64 65 DipoleAngularCorrelationMap *DipoleAngularCorrelation(const Formula &DipoleFormula, const size_t timestep, const std::map<atomId_t, Vector> &ZeroVector, const enum ResetWorldTime DoTimeReset = DontResetTime); 66 DipoleCorrelationMap *DipoleCorrelation(std::vector<molecule *> &molecules); 56 67 PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements); 57 68 CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point ); … … 65 76 void OutputDipoleAngularCorrelation_Header( ofstream * const file ); 66 77 void OutputDipoleAngularCorrelation_Value( ofstream * const file, DipoleAngularCorrelationMap::const_iterator &runner ); 78 void OutputDipoleCorrelation_Header( ofstream * const file ); 79 void OutputDipoleCorrelation_Value( ofstream * const file, DipoleCorrelationMap::const_iterator &runner ); 67 80 void OutputPairCorrelation_Header( ofstream * const file ); 68 81 void OutputPairCorrelation_Value( ofstream * const file, PairCorrelationMap::const_iterator &runner ); -
src/World.cpp
r13510b r7ba268 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" … … 38 37 #include "Descriptors/SelectiveIterator_impl.hpp" 39 38 #include "Element/periodentafel.hpp" 39 #include "Graph/DepthFirstSearchAnalysis.hpp" 40 40 #include "Helpers/defs.hpp" 41 41 #include "LinearAlgebra/RealSpaceMatrix.hpp" … … 138 138 // set new time 139 139 WorldTime::setTime(_step); 140 // re-instantiate bond structure 141 //FragmentationSubgraphDissection(); 140 // TODO: removed when BondGraph creates the adjacency 141 // 1. remove all of World's molecules 142 for (MoleculeIterator iter = getMoleculeIter(); 143 getMoleculeIter() != moleculeEnd(); 144 iter = getMoleculeIter()) { 145 getMolecules()->erase(*iter); 146 destroyMolecule(*iter); 147 } 148 // 2. (re-)create bondgraph 149 AtomComposite Set = getAllAtoms(); 150 BG->CreateAdjacency(Set); 151 152 // 3. scan for connected subgraphs => molecules 153 DepthFirstSearchAnalysis DFS; 154 DFS(); 155 DFS.UpdateMoleculeStructure(); 142 156 } 143 157 } -
tests/regression/Analysis/testsuite-analysis.at
r13510b r7ba268 16 16 m4_include(Analysis/PrincipalAxisSystem/testsuite-analysis-principal-axis-system.at) 17 17 18 # angular dipole correlation - empty19 m4_include(Analysis/ AngularDipoleCorrelation-Empty/testsuite-analysis-angular-dipole-correlation-empty.at)18 # dipole angular correlation 19 m4_include(Analysis/DipoleAngularCorrelation/testsuite-analysis-dipole-angular-correlation.at) 20 20 21 # angular dipole correlation - discrete angles 22 m4_include(Analysis/AngularDipoleCorrelation-DiscreteAngles/testsuite-analysis-angular-dipole-correlation-discrete-angles.at) 21 # dipole correlation - empty 22 m4_include(Analysis/DipoleCorrelation-Empty/testsuite-analysis-dipole-correlation-empty.at) 23 24 # dipole correlation - discrete angles 25 m4_include(Analysis/DipoleCorrelation-DiscreteAngles/testsuite-analysis-dipole-correlation-discrete-angles.at) -
tests/regression/Makefile.am
r13510b r7ba268 33 33 $(srcdir)/Atoms/Translation/testsuite-atoms-translation.at \ 34 34 $(srcdir)/Analysis/testsuite-analysis.at \ 35 $(srcdir)/Analysis/DipoleAngularCorrelation/testsuite-analysis-dipole-angular-correlation.at \ 36 $(srcdir)/Analysis/DipoleCorrelation-Empty/testsuite-analysis-dipole-correlation-empty.at \ 37 $(srcdir)/Analysis/DipoleCorrelation-DiscreteAngles/testsuite-analysis-dipole-correlation-discrete-angles.at \ 35 38 $(srcdir)/Analysis/PairCorrelation/testsuite-analysis-pair-correlation.at \ 36 39 $(srcdir)/Analysis/PairCorrelation-RangeTest/testsuite-analysis-pair-correlation-range-test.at \ … … 38 41 $(srcdir)/Analysis/SurfaceCorrelation/testsuite-analysis-surface-correlation.at \ 39 42 $(srcdir)/Analysis/PrincipalAxisSystem/testsuite-analysis-principal-axis-system.at \ 40 $(srcdir)/Analysis/AngularDipoleCorrelation-Empty/testsuite-analysis-angular-dipole-correlation-empty.at \41 $(srcdir)/Analysis/AngularDipoleCorrelation-DiscreteAngles/testsuite-analysis-angular-dipole-correlation-discrete-angles.at \42 43 $(srcdir)/Domain/testsuite-domain.at \ 43 44 $(srcdir)/Domain/BoundInBox/testsuite-domain-bound-in-box.at \
Note:
See TracChangeset
for help on using the changeset viewer.