Changes in / [13510b:7ba268]


Ignore:
Files:
89 added
7 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AnalysisAction/DipoleAngularCorrelationAction.cpp

    r13510b r7ba268  
    99 * DipoleAngularCorrelationAction.cpp
    1010 *
    11  *  Created on: May 9, 2010
     11 *  Created on: Feb 11, 2011
    1212 *      Author: heber
    1313 */
     
    2323#include "Tesselation/boundary.hpp"
    2424#include "linkedcell.hpp"
    25 #include "CodePatterns/Verbose.hpp"
    2625#include "CodePatterns/Log.hpp"
     26#include "Descriptors/AtomOfMoleculeSelectionDescriptor.hpp"
     27#include "Descriptors/MoleculeFormulaDescriptor.hpp"
    2728#include "Element/element.hpp"
    28 #include "molecule.hpp"
    2929#include "Element/periodentafel.hpp"
    3030#include "LinearAlgebra/Vector.hpp"
     31#include "molecule.hpp"
    3132#include "World.hpp"
     33#include "WorldTime.hpp"
    3234
    3335#include <iostream>
     36#include <map>
    3437#include <string>
    3538
     
    4548Action::state_ptr AnalysisDipoleAngularCorrelationAction::performCall() {
    4649  //int ranges[3] = {1, 1, 1};
    47   ofstream output;
    48   ofstream binoutput;
    4950  string type;
    50   BinPairMap *binmap = NULL;
    5151
    5252  // obtain information
    5353  getParametersfromValueStorage();
     54  ASSERT(!params.periodic, "AnalysisDipoleAngularCorrelationAction() - periodic case not implemented.");
    5455
    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
    70131  return Action::success;
    71132}
  • src/Actions/AnalysisAction/DipoleAngularCorrelationAction.def

    r13510b r7ba268  
    22 * DipoleAngularCorrelationAction.def
    33 *
    4  *  Created on: Aug 25, 2010
     4 *  Created on: Feb 11, 2011
    55 *      Author: heber
    66 */
     
    1313// ValueStorage by the token "Z" -> first column: int, Z, "Z"
    1414// "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")
    2020
    2121// some defines for all the names, you may use ACTION, STATE and PARAMS
     
    2424#define MENUPOSITION 3
    2525#define ACTIONNAME DipoleAngularCorrelation
    26 #define TOKEN "dipole-correlation"
     26#define TOKEN "dipole-angular-correlation"
    2727
    2828// finally the information stored in the ActionTrait specialization
  • src/Actions/AnalysisAction/DipoleAngularCorrelationAction.hpp

    r13510b r7ba268  
    22 * DipoleAngularCorrelationAction.hpp
    33 *
    4  *  Created on: May 9, 2010
     4 *  Created on: Feb 11, 2011
    55 *      Author: heber
    66 */
  • src/Actions/Makefile.am

    r13510b r7ba268  
    8888ANALYSISACTIONSOURCE = \
    8989  Actions/AnalysisAction/DipoleAngularCorrelationAction.cpp \
     90  Actions/AnalysisAction/DipoleCorrelationAction.cpp \
    9091  Actions/AnalysisAction/MolecularVolumeAction.cpp \
    9192  Actions/AnalysisAction/PairCorrelationAction.cpp \
     
    9596ANALYSISACTIONHEADER = \
    9697  Actions/AnalysisAction/DipoleAngularCorrelationAction.hpp \
     98  Actions/AnalysisAction/DipoleCorrelationAction.hpp \
    9799  Actions/AnalysisAction/MolecularVolumeAction.hpp \
    98100  Actions/AnalysisAction/PairCorrelationAction.hpp \
     
    102104ANALYSISACTIONDEFS = \
    103105  Actions/AnalysisAction/DipoleAngularCorrelationAction.def \
     106  Actions/AnalysisAction/DipoleCorrelationAction.def \
    104107  Actions/AnalysisAction/MolecularVolumeAction.def \
    105108  Actions/AnalysisAction/PairCorrelationAction.def \
  • src/Analysis/analysis_correlation.cpp

    r13510b r7ba268  
    2222#include <iostream>
    2323#include <iomanip>
     24#include <limits>
    2425
    2526#include "atom.hpp"
     
    3031#include "CodePatterns/Info.hpp"
    3132#include "CodePatterns/Log.hpp"
     33#include "CodePatterns/Verbose.hpp"
     34#include "Descriptors/AtomOfMoleculeSelectionDescriptor.hpp"
     35#include "Descriptors/MoleculeFormulaDescriptor.hpp"
     36#include "Descriptors/MoleculeOfAtomSelectionDescriptor.hpp"
    3237#include "Formula.hpp"
     38#include "LinearAlgebra/Vector.hpp"
     39#include "LinearAlgebra/RealSpaceMatrix.hpp"
    3340#include "molecule.hpp"
    3441#include "Tesselation/tesselation.hpp"
     
    3643#include "Tesselation/triangleintersectionlist.hpp"
    3744#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"
    4346
    4447#include "analysis_correlation.hpp"
     
    6770    // go through all bonds
    6871    const BondList& ListOfBonds = (*atomiter)->getListOfBonds();
     72    ASSERT(ListOfBonds.begin() != ListOfBonds.end(),
     73        "getDipole() - no bonds in molecule!");
    6974    for (BondList::const_iterator bonditer = ListOfBonds.begin();
    7075        bonditer != ListOfBonds.end();
     
    7883        BondDipoleVector.Normalize();
    7984        BondDipoleVector *= DeltaEN;
     85        LOG(3,"INFO: Dipole vector from bond " << **bonditer << " is " << BondDipoleVector);
    8086        DipoleVector += BondDipoleVector;
    8187        SumOfVectors++;
     
    8389    }
    8490  }
    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;
    8695  DoLog(1) && (Log() << Verbose(1) << "Resulting dipole vector is " << DipoleVector << std::endl);
    8796
     
    8998};
    9099
     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 */
     104range<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 */
     128std::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
    91144/** 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 */
     156DipoleAngularCorrelationMap *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.
    92237 * Note given element order is unimportant (i.e. g(Si, O) === g(O, Si))
    93238 * Angles are given in degrees.
     
    95240 * \return Map of doubles with values the pair of the two atoms.
    96241 */
    97 DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector<molecule *> &molecules)
     242DipoleCorrelationMap *DipoleCorrelation(std::vector<molecule *> &molecules)
    98243{
    99244  Info FunctionInfo(__func__);
    100   DipoleAngularCorrelationMap *outmap = new DipoleAngularCorrelationMap;
     245  DipoleCorrelationMap *outmap = new DipoleCorrelationMap;
    101246//  double distance = 0.;
    102247//  Box &domain = World::getInstance().getDomain();
     
    107252  }
    108253
    109   outmap = new DipoleAngularCorrelationMap;
    110254  for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin();
    111255      MolWalker != molecules.end(); ++MolWalker) {
     
    168312  outmap = new PairCorrelationMap;
    169313  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);
    171315    for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
    172316      DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
    173317      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);
    175319        for (molecule::const_iterator runner = (*MolOtherWalker)->begin(); runner != (*MolOtherWalker)->end(); ++runner) {
    176320          DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl);
     
    503647void OutputDipoleAngularCorrelation_Header( ofstream * const file )
    504648{
    505   *file << "\tAtom1\tAtom2";
    506 };
    507 
    508 /** Prints values stored in DipoleAngularCorrelationMap iterator.
     649  *file << "\tFirstAtomOfMolecule";
     650};
     651
     652/** Prints values stored in DipoleCorrelationMap iterator.
    509653 *
    510654 * @param file stream to print to
     
    512656 */
    513657void 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 */
     667void 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 */
     677void OutputDipoleCorrelation_Value( ofstream * const file, DipoleCorrelationMap::const_iterator &runner )
    514678{
    515679  *file << runner->second.first->getId() << "\t" << runner->second.second->getId();
  • src/Analysis/analysis_correlation.hpp

    r13510b r7ba268  
    3131#include "CodePatterns/Info.hpp"
    3232#include "CodePatterns/Log.hpp"
     33#include "CodePatterns/Range.hpp"
    3334#include "CodePatterns/Verbose.hpp"
    3435#include "Helpers/helpers.hpp"
     
    4647
    4748typedef multimap<double, pair<atom *, atom *> > PairCorrelationMap;
    48 typedef multimap<double, pair<molecule *, molecule *> > DipoleAngularCorrelationMap;
     49typedef multimap<double, atom * > DipoleAngularCorrelationMap;
     50typedef multimap<double, pair<molecule *, molecule *> > DipoleCorrelationMap;
    4951typedef multimap<double, pair<atom *, const Vector *> > CorrelationToPointMap;
    5052typedef multimap<double, pair<atom *, BoundaryTriangleSet *> > CorrelationToSurfaceMap;
    5153typedef map<double, int> BinPairMap;
    5254
     55enum ResetWorldTime {
     56  DontResetTime,
     57  DoResetTime
     58};
     59
    5360/********************************************** declarations *******************************/
    5461
    55 DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector<molecule *> &molecules);
     62range<size_t> getMaximumTrajectoryBounds(const std::vector<atom *> &atoms);
     63std::map<atomId_t, Vector> CalculateZeroAngularDipole(const std::vector<molecule *> &molecules);
     64
     65DipoleAngularCorrelationMap *DipoleAngularCorrelation(const Formula &DipoleFormula, const size_t timestep, const std::map<atomId_t, Vector> &ZeroVector, const enum ResetWorldTime DoTimeReset = DontResetTime);
     66DipoleCorrelationMap *DipoleCorrelation(std::vector<molecule *> &molecules);
    5667PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements);
    5768CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point );
     
    6576void OutputDipoleAngularCorrelation_Header( ofstream * const file );
    6677void OutputDipoleAngularCorrelation_Value( ofstream * const file, DipoleAngularCorrelationMap::const_iterator &runner );
     78void OutputDipoleCorrelation_Header( ofstream * const file );
     79void OutputDipoleCorrelation_Value( ofstream * const file, DipoleCorrelationMap::const_iterator &runner );
    6780void OutputPairCorrelation_Header( ofstream * const file );
    6881void OutputPairCorrelation_Value( ofstream * const file, PairCorrelationMap::const_iterator &runner );
  • src/World.cpp

    r13510b r7ba268  
    2525
    2626#include "Actions/ActionTraits.hpp"
    27 //#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
    2827#include "Actions/ManipulateAtomsProcess.hpp"
    2928#include "atom.hpp"
     
    3837#include "Descriptors/SelectiveIterator_impl.hpp"
    3938#include "Element/periodentafel.hpp"
     39#include "Graph/DepthFirstSearchAnalysis.hpp"
    4040#include "Helpers/defs.hpp"
    4141#include "LinearAlgebra/RealSpaceMatrix.hpp"
     
    138138    // set new time
    139139    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();
    142156  }
    143157}
  • tests/regression/Analysis/testsuite-analysis.at

    r13510b r7ba268  
    1616m4_include(Analysis/PrincipalAxisSystem/testsuite-analysis-principal-axis-system.at)
    1717
    18 # angular dipole correlation - empty
    19 m4_include(Analysis/AngularDipoleCorrelation-Empty/testsuite-analysis-angular-dipole-correlation-empty.at)
     18# dipole angular correlation
     19m4_include(Analysis/DipoleAngularCorrelation/testsuite-analysis-dipole-angular-correlation.at)
    2020
    21 # angular dipole correlation - discrete angles
    22 m4_include(Analysis/AngularDipoleCorrelation-DiscreteAngles/testsuite-analysis-angular-dipole-correlation-discrete-angles.at)
     21# dipole correlation - empty
     22m4_include(Analysis/DipoleCorrelation-Empty/testsuite-analysis-dipole-correlation-empty.at)
     23
     24# dipole correlation - discrete angles
     25m4_include(Analysis/DipoleCorrelation-DiscreteAngles/testsuite-analysis-dipole-correlation-discrete-angles.at)
  • tests/regression/Makefile.am

    r13510b r7ba268  
    3333        $(srcdir)/Atoms/Translation/testsuite-atoms-translation.at \
    3434        $(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 \
    3538        $(srcdir)/Analysis/PairCorrelation/testsuite-analysis-pair-correlation.at \
    3639        $(srcdir)/Analysis/PairCorrelation-RangeTest/testsuite-analysis-pair-correlation-range-test.at \
     
    3841        $(srcdir)/Analysis/SurfaceCorrelation/testsuite-analysis-surface-correlation.at \
    3942        $(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 \
    4243        $(srcdir)/Domain/testsuite-domain.at \
    4344        $(srcdir)/Domain/BoundInBox/testsuite-domain-bound-in-box.at \
Note: See TracChangeset for help on using the changeset viewer.