Changes in / [23bade:b8d15ba]


Ignore:
Files:
3 added
2 deleted
27 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AtomAction/AddAction.cpp

    r23bade rb8d15ba  
    1010#include "Actions/AtomAction/AddAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
     12#include "Descriptors/AtomIdDescriptor.hpp"
    1213#include "atom.hpp"
    1314#include "element.hpp"
     
    2627#include "UIElements/Dialog.hpp"
    2728#include "Actions/ValueStorage.hpp"
     29
     30// memento to remember the state when undoing
     31
     32class AtomAddState : public ActionState {
     33public:
     34  AtomAddState(const Vector &_position, const element *_elemental, const atomId_t _id) :
     35    position(_position),
     36    elemental(_elemental),
     37    id(_id)
     38  {}
     39  Vector position;
     40  const element *elemental;
     41  atomId_t id;
     42};
    2843
    2944const char AtomAddAction::NAME[] = "add-atom";
     
    7085    (*iter)->AddAtom(first);
    7186  }
    72   return Action::success;
     87  return Action::state_ptr(new AtomAddState(position, elemental, first->getId()));
    7388}
    7489
    7590Action::state_ptr AtomAddAction::performUndo(Action::state_ptr _state) {
    76 //  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
     91  AtomAddState *state = assert_cast<AtomAddState*>(_state.get());
    7792
    78   return Action::failure;
    79 //  string newName = state->mol->getName();
    80 //  state->mol->setName(state->lastName);
    81 //
    82 //  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
     93  DoLog(1) && (Log() << Verbose(1) << "Removing atom with id " << state->id << "." << endl);
     94  World::getInstance().destroyAtom(state->id);
     95
     96  return Action::state_ptr(_state);
    8397}
    8498
    8599Action::state_ptr AtomAddAction::performRedo(Action::state_ptr _state){
    86   return Action::failure;
     100  AtomAddState *state = assert_cast<AtomAddState*>(_state.get());
     101
     102  atom * first = World::getInstance().createAtom();
     103  first->setType(state->elemental);
     104  first->setPosition(state->position);
     105  DoLog(1) && (Log() << Verbose(1) << "Re-adding new atom with element " << state->elemental->getName() << " at " << state->position << "." << endl);
     106  // TODO: remove when all of World's atoms are stored.
     107  std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
     108  if (!molecules.empty()) {
     109    std::vector<molecule *>::iterator iter = molecules.begin();
     110    (*iter)->AddAtom(first);
     111  }
     112  if (first->getId() != state->id)
     113    if (!first->changeId(state->id))
     114      return Action::failure;
     115  return Action::state_ptr(_state);
    87116}
    88117
    89118bool AtomAddAction::canUndo() {
    90   return false;
     119  return true;
    91120}
    92121
    93122bool AtomAddAction::shouldUndo() {
    94   return false;
     123  return true;
    95124}
    96125
  • src/Actions/AtomAction/ChangeElementAction.cpp

    r23bade rb8d15ba  
    1010#include "Actions/AtomAction/ChangeElementAction.hpp"
    1111#include "Actions/ActionRegistry.hpp"
     12#include "Descriptors/AtomIdDescriptor.hpp"
    1213#include "atom.hpp"
    1314#include "element.hpp"
     
    1920
    2021#include <iostream>
     22#include <map>
    2123#include <string>
    2224
     
    2628#include "UIElements/Dialog.hpp"
    2729#include "Actions/ValueStorage.hpp"
     30
     31typedef std::map<int, const element *> ElementMap;
     32
     33// memento to remember the state when undoing
     34
     35class AtomChangeElementState : public ActionState {
     36public:
     37  AtomChangeElementState(ElementMap _Elements, const element *_elemental) :
     38    Elements(_Elements),
     39    elemental(_elemental)
     40  {}
     41  ElementMap Elements;
     42  const element *elemental;
     43};
    2844
    2945const char AtomChangeElementAction::NAME[] = "change-element";
     
    5672  ValueStorage::getInstance().queryCurrentValue(NAME, elemental);
    5773
     74  // create undo state
     75  ElementMap Elements;
     76  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
     77    Elements.insert(std::pair<int, const element *> (iter->second->getId(), iter->second->getType()));
     78  }
     79  AtomChangeElementState *UndoState = new AtomChangeElementState(Elements, elemental);
     80
    5881  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    5982    first = iter->second;
     
    6487    mol->AddAtom(first);  // add atom to ensure correctness of formula
    6588  }
    66   return Action::success;
     89  return Action::state_ptr(UndoState);
    6790}
    6891
    6992Action::state_ptr AtomChangeElementAction::performUndo(Action::state_ptr _state) {
    70 //  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
     93  AtomChangeElementState *state = assert_cast<AtomChangeElementState*>(_state.get());
     94  atom *first = NULL;
     95  molecule *mol = NULL;
    7196
    72   return Action::failure;
    73 //  string newName = state->mol->getName();
    74 //  state->mol->setName(state->lastName);
    75 //
    76 //  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
     97  for(ElementMap::const_iterator iter = state->Elements.begin(); iter != state->Elements.end(); ++iter) {
     98    first = World::getInstance().getAtom(AtomById(iter->first));
     99    mol = first->getMolecule();
     100    first->removeFromMolecule(); // remove atom
     101    first->setType(iter->second);
     102    mol->AddAtom(first);  // add atom to ensure correctness of formula
     103  }
     104
     105  return Action::state_ptr(_state);
    77106}
    78107
    79108Action::state_ptr AtomChangeElementAction::performRedo(Action::state_ptr _state){
    80   return Action::failure;
     109  AtomChangeElementState *state = assert_cast<AtomChangeElementState*>(_state.get());
     110  atom *first = NULL;
     111  molecule *mol = NULL;
     112
     113  for(ElementMap::const_iterator iter = state->Elements.begin(); iter != state->Elements.end(); ++iter) {
     114    first = World::getInstance().getAtom(AtomById(iter->first));
     115    mol = first->getMolecule();
     116    first->removeFromMolecule(); // remove atom
     117    first->setType(state->elemental);
     118    mol->AddAtom(first);  // add atom to ensure correctness of formula
     119  }
     120
     121  return Action::state_ptr(_state);
    81122}
    82123
    83124bool AtomChangeElementAction::canUndo() {
    84   return false;
     125  return true;
    85126}
    86127
    87128bool AtomChangeElementAction::shouldUndo() {
    88   return false;
     129  return true;
    89130}
    90131
  • src/Actions/AtomAction/RemoveAction.cpp

    r23bade rb8d15ba  
    1111#include "Actions/ActionRegistry.hpp"
    1212#include "atom.hpp"
     13#include "AtomicInfo.hpp"
    1314#include "Descriptors/AtomDescriptor.hpp"
    1415#include "Helpers/Log.hpp"
     
    2526#include "UIElements/Dialog.hpp"
    2627#include "Actions/ValueStorage.hpp"
     28
     29// memento to remember the state when undoing
     30
     31class AtomRemoveState : public ActionState {
     32public:
     33  AtomRemoveState(std::vector<AtomicInfo> _Walkers) :
     34    Walkers(_Walkers)
     35  {}
     36  std::vector<AtomicInfo> Walkers;
     37};
    2738
    2839const char AtomRemoveAction::NAME[] = "remove-atom";
     
    5061  atom *first = NULL;
    5162
    52   std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
     63  // create undo state
     64  std::vector<AtomicInfo> Walkers;
     65  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
     66    Walkers.push_back(AtomicInfo(*(iter->second)));
     67  }
     68  AtomRemoveState *UndoState = new AtomRemoveState(Walkers);
     69
     70  // remove all selected atoms
     71//  std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
    5372  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    5473    first = iter->second;
    5574    DoLog(1) && (Log() << Verbose(1) << "Removing atom " << first->getId() << "." << endl);
    56     // TODO: this is not necessary when atoms and their storing to file are handled by the World
    57     // simply try to erase in every molecule found
    58     for (std::vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end(); ++iter) {
    59       (*iter)->erase(first);
    60     }
     75//    // TODO: this is not necessary when atoms and their storing to file are handled by the World
     76//    // simply try to erase in every molecule found
     77//    for (std::vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end(); ++iter) {
     78//      (*iter)->erase(first);
     79//    }
    6180    World::getInstance().destroyAtom(first);
    6281  }
    63   return Action::success;
     82  return Action::state_ptr(UndoState);
    6483}
    6584
    6685Action::state_ptr AtomRemoveAction::performUndo(Action::state_ptr _state) {
    67 //  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
     86  AtomRemoveState *state = assert_cast<AtomRemoveState*>(_state.get());
    6887
    69   return Action::failure;
    70 //  string newName = state->mol->getName();
    71 //  state->mol->setName(state->lastName);
    72 //
    73 //  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
     88  size_t i=0;
     89  for (; i<state->Walkers.size(); ++i) {
     90    // re-create the atom
     91    DoLog(1) && (Log() << Verbose(1) << "Re-adding atom " << state->Walkers[i].getId() << "." << endl);
     92    atom *Walker = World::getInstance().createAtom();
     93    if (!state->Walkers[i].setAtom(*Walker)) {
     94      DoeLog(1) && (eLog() << Verbose(1) << "Failed to set id." << endl);
     95      World::getInstance().destroyAtom(Walker);
     96      break;
     97    }
     98  }
     99  if (i<state->Walkers.size()) {
     100    // remove all previous ones, too
     101    for (size_t j=0;j<i;++j)
     102      World::getInstance().destroyAtom(state->Walkers[j].getId());
     103    // and announce the failure of the undo
     104    return Action::failure;
     105  }
     106  return Action::state_ptr(_state);
    74107}
    75108
    76109Action::state_ptr AtomRemoveAction::performRedo(Action::state_ptr _state){
    77   return Action::failure;
     110  AtomRemoveState *state = assert_cast<AtomRemoveState*>(_state.get());
     111
     112  // simple remove again all previously added atoms
     113  for (size_t i=0; i<state->Walkers.size(); ++i) {
     114    DoLog(1) && (Log() << Verbose(1) << "Re-removing atom " << state->Walkers[i].getId() << "." << endl);
     115    World::getInstance().destroyAtom(state->Walkers[i].getId());
     116  }
     117
     118  return Action::state_ptr(_state);
    78119}
    79120
    80121bool AtomRemoveAction::canUndo() {
    81   return false;
     122  return true;
    82123}
    83124
    84125bool AtomRemoveAction::shouldUndo() {
    85   return false;
     126  return true;
    86127}
    87128
  • src/Actions/CmdAction/FastParsingAction.cpp

    r23bade rb8d15ba  
    2828class CommandLineFastParsingState : public ActionState {
    2929public:
    30   CommandLineFastParsingState(bool _bool) :
    31     boolean(_bool)
     30  CommandLineFastParsingState(const bool _oldvalue, const bool _newvalue) :
     31    oldvalue(_oldvalue),
     32    newvalue(_newvalue)
    3233  {}
    33   bool boolean;
     34  bool oldvalue;
     35  bool newvalue;
    3436};
    3537
     
    5860
    5961Action::state_ptr CommandLineFastParsingAction::performCall() {
    60 
    6162  config *configuration = World::getInstance().getConfig();
    62   ValueStorage::getInstance().queryCurrentValue(NAME, configuration->FastParsing);
     63  bool oldvalue = configuration->FastParsing;
     64  bool newvalue;
     65  ValueStorage::getInstance().queryCurrentValue(NAME, newvalue);
     66  configuration->FastParsing = newvalue;
    6367  if (configuration->FastParsing)
    6468    DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
    6569  else
    6670    DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
    67   return Action::success;
     71  return Action::state_ptr(new CommandLineFastParsingState(oldvalue, newvalue));
    6872}
    6973
     
    7276
    7377  config *configuration = World::getInstance().getConfig();
    74   configuration->FastParsing = state->boolean;
     78  configuration->FastParsing = state->oldvalue;
     79  if (configuration->FastParsing)
     80    DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
     81  else
     82    DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
    7583
    76   return Action::state_ptr(new CommandLineFastParsingState(!state->boolean));
     84  return Action::state_ptr(_state);
    7785}
    7886
    7987Action::state_ptr CommandLineFastParsingAction::performRedo(Action::state_ptr _state){
    80   return performUndo(_state);
     88  CommandLineFastParsingState *state = assert_cast<CommandLineFastParsingState*>(_state.get());
     89
     90  config *configuration = World::getInstance().getConfig();
     91  configuration->FastParsing = state->newvalue;
     92  if (configuration->FastParsing)
     93    DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
     94  else
     95    DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
     96
     97  return Action::state_ptr(_state);
    8198}
    8299
  • src/Actions/CmdAction/VerboseAction.cpp

    r23bade rb8d15ba  
    2626class CommandLineVerboseState : public ActionState {
    2727public:
    28   CommandLineVerboseState(int _verbosity) :
    29     verbosity(_verbosity)
     28  CommandLineVerboseState(const int _oldverbosity, const int _newverbosity) :
     29    oldverbosity(_oldverbosity),
     30    newverbosity(_newverbosity)
    3031  {}
    31   int verbosity;
     32  int oldverbosity;
     33  int newverbosity;
    3234};
    3335
     
    5658
    5759Action::state_ptr CommandLineVerboseAction::performCall() {
    58   int verbosity = 2;
     60  int oldverbosity = getVerbosity();
     61  int newverbosity = 2;
    5962
    60   ValueStorage::getInstance().queryCurrentValue(NAME, verbosity);
     63  ValueStorage::getInstance().queryCurrentValue(NAME, newverbosity);
    6164
    62   setVerbosity(verbosity);
    63   DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl);
    64   return Action::success;
     65  if (oldverbosity != newverbosity) {
     66    CommandLineVerboseState *UndoState = new CommandLineVerboseState(oldverbosity, newverbosity);
     67    setVerbosity(newverbosity);
     68    DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << oldverbosity << " to " << newverbosity << "." << endl);
     69    return Action::state_ptr(UndoState);
     70  } else {
     71    DoLog(0) && (Log() << Verbose(0) << "Verbosity remains unchanged at " << oldverbosity << "." << endl);
     72    return Action::failure;
     73  }
    6574}
    6675
     
    6877  CommandLineVerboseState *state = assert_cast<CommandLineVerboseState*>(_state.get());
    6978
    70   int verbosity = 2;
    71   ValueStorage::getInstance().queryCurrentValue(NAME, verbosity);
     79  DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state->newverbosity << " to " << state->oldverbosity << "." << endl);
     80  setVerbosity(state->oldverbosity);
    7281
    73   setVerbosity(state->verbosity);
    74   return Action::state_ptr(new CommandLineVerboseState(verbosity));
     82  return Action::state_ptr(_state);
    7583}
    7684
    7785Action::state_ptr CommandLineVerboseAction::performRedo(Action::state_ptr _state){
    78   return performUndo(_state);
     86  CommandLineVerboseState *state = assert_cast<CommandLineVerboseState*>(_state.get());
     87
     88  DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state->oldverbosity << " to " << state->newverbosity << "." << endl);
     89  setVerbosity(state->newverbosity);
     90
     91  return Action::state_ptr(_state);
    7992}
    8093
  • src/Actions/WorldAction/SetDefaultNameAction.cpp

    r23bade rb8d15ba  
    6262
    6363  defaultname = World::getInstance().getDefaultName();
     64  WorldSetDefaultNameState *UndoState = new WorldSetDefaultNameState(defaultname);
    6465  ValueStorage::getInstance().queryCurrentValue(NAME, defaultname);
    6566
    6667  World::getInstance().setDefaultName(defaultname);
    6768  DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl);
    68   return Action::success;
     69  return Action::state_ptr(UndoState);
    6970}
    7071
     
    7475  string newName = World::getInstance().getDefaultName();
    7576  World::getInstance().setDefaultName(state->lastName);
     77  DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl);
    7678
    7779  return Action::state_ptr(new WorldSetDefaultNameState(newName));
  • src/Helpers/Log.cpp

    r23bade rb8d15ba  
    1818void setVerbosity(int verbosityLevel) {
    1919  logger::getInstance().setVerbosity(verbosityLevel);
     20}
     21
     22/**
     23 * Gets verbosity for the error logger and the standard logger.
     24 *
     25 * \param int verbosity level
     26 */
     27int getVerbosity() {
     28  return logger::getInstance().getVerbosity();
    2029}
    2130
  • src/Helpers/Log.hpp

    r23bade rb8d15ba  
    1515class errorLogger & eLog();
    1616void setVerbosity(int verbosityLevel);
     17int getVerbosity();
    1718bool DoLog(int verbose);
    1819bool DoeLog(int verbose);
  • src/Helpers/errorlogger.cpp

    r23bade rb8d15ba  
    4141void errorLogger::setVerbosity(int verbosityLevel) {
    4242  verbosity = verbosityLevel;
     43}
     44
     45/**
     46 * Gets the verbosity.
     47 *
     48 * \return verbosity level
     49 */
     50int errorLogger::getVerbosity()
     51{
     52  return verbosity;
    4353}
    4454
  • src/Helpers/errorlogger.hpp

    r23bade rb8d15ba  
    2525  static bool DoOutput();
    2626  static void setVerbosity(int verbosityLevel);
     27  static int getVerbosity();
    2728
    2829protected:
  • src/Helpers/logger.cpp

    r23bade rb8d15ba  
    4444
    4545/**
     46 * Gets the verbosity.
     47 *
     48 * \return verbosity level
     49 */
     50int logger::getVerbosity()
     51{
     52  return verbosity;
     53}
     54
     55/**
    4656 * Operator for the Binary(arg) call.
    4757 * Constructs temporary a Verbose class object, wherein the Binary is stored.
  • src/Helpers/logger.hpp

    r23bade rb8d15ba  
    2525  static bool DoOutput();
    2626  static void setVerbosity(int verbosityLevel);
     27  static int getVerbosity();
    2728
    2829protected:
  • src/Makefile.am

    r23bade rb8d15ba  
    66ATOMSOURCE = \
    77  atom.cpp \
     8  AtomicInfo.cpp \
    89  atom_atominfo.cpp \
    910  atom_bondedparticle.cpp \
     
    1617ATOMHEADER = \
    1718  atom.hpp \
     19  AtomicInfo.hpp \
    1820  atom_atominfo.hpp \
    1921  atom_bondedparticle.hpp \
  • src/UIElements/Views/QT4/QTStatusBar.cpp

    r23bade rb8d15ba  
    2121  QStatusBar(_parent),
    2222  Observer("QTStatusBar"),
    23   parent(_parent),
    2423  atomCount(World::getInstance().numAtoms()),
    25   moleculeCount(World::getInstance().numMolecules())
     24  moleculeCount(World::getInstance().numMolecules()),
     25  parent(_parent)
    2626{
    2727  World::getInstance().signOn(this);
  • src/UIElements/Views/QT4/QTWorldView.cpp

    r23bade rb8d15ba  
    2020// these attributes are skiped so far
    2121const int QTWorldView::COLUMNCOUNT = COLUMNTYPES_MAX;
    22 const char *QTWorldView::COLUMNNAMES[QTWorldView::COLUMNCOUNT]={"Name","Atoms"/*,"Formula"*/,"Center"/*,"Size"*/};
     22const char *QTWorldView::COLUMNNAMES[QTWorldView::COLUMNCOUNT]={"Name","Atoms"/*,"Formula"*//*,"Size"*/};
    2323
    2424QTWorldView::QTWorldView(QWidget * _parent) :
     
    8181    setItem(i,ATOMS,countWidget);
    8282
    83     const Vector center = (*iter)->Center;
    84     QTableWidgetItem *centerWidget = new QTableWidgetItem();
    85     stringstream centersstr;
    86     centersstr << center;
    87     centerWidget->setText(QString(centersstr.str().c_str()));
    88     setItem(i,CENTER,centerWidget);
    89     centerWidget->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
    90 
    9183    molSelection[i]=nameWidget->isSelected();
    9284  }
  • src/UIElements/Views/QT4/QTWorldView.hpp

    r23bade rb8d15ba  
    2828
    2929  static const int COLUMNCOUNT;
    30   enum {NAME,ATOMS,CENTER,COLUMNTYPES_MAX} COLUMNTYPES;
     30  enum {NAME,ATOMS,COLUMNTYPES_MAX} COLUMNTYPES;
    3131  static const char *COLUMNNAMES[];
    3232
  • src/atom.cpp

    r23bade rb8d15ba  
    353353}
    354354
    355 molecule* atom::getMolecule(){
     355molecule* atom::getMolecule() const {
    356356  return mol;
    357357}
  • src/atom.hpp

    r23bade rb8d15ba  
    9292
    9393   void setMolecule(molecule*);
    94    molecule* getMolecule();
     94   molecule* getMolecule() const;
    9595   void removeFromMolecule();
    9696
  • src/boundary.cpp

    r23bade rb8d15ba  
    804804  // Center filler at origin
    805805  filler->CenterEdge(&Inserter);
    806   filler->Center.Zero();
    807806  const int FillerCount = filler->getAtomCount();
    808807  DoLog(2) && (Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl);
  • src/config.cpp

    r23bade rb8d15ba  
    15861586    for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) {
    15871587      src[N++] = (*ListRunner)->IndexNr;
    1588       (*ListRunner)->Translate(&(*ListRunner)->Center);
    15891588    }
    15901589    mol = World::getInstance().createMolecule();
    15911590    mol->SetNameFromFilename(ConfigFileName);
    1592     molecules->SimpleMultiMerge(mol, src, N);
    15931591    //mol->CalculateOrbitals(*this);
    15941592    delete[](src);
  • src/molecule.hpp

    r23bade rb8d15ba  
    104104    double BondDistance;  //!< typical bond distance used in CreateAdjacencyList() and furtheron
    105105    bool ActiveFlag;    //!< in a MoleculeListClass used to discern active from inactive molecules
    106     Vector Center;      //!< Center of molecule in a global box
     106    //Vector Center;      //!< Center of molecule in a global box
    107107    int IndexNr;        //!< index of molecule in a MoleculeListClass
    108108    char name[MAXSTRINGSIZE];         //!< arbitrary name
     
    379379  void eraseMolecule();
    380380
    381 
    382   // merging of molecules
    383   bool SimpleMerge(molecule *mol, molecule *srcmol);
    384   bool SimpleAdd(molecule *mol, molecule *srcmol);
    385   bool SimpleMultiMerge(molecule *mol, int *src, int N);
    386   bool SimpleMultiAdd(molecule *mol, int *src, int N);
    387   bool ScatterMerge(molecule *mol, int *src, int N);
    388   bool EmbedMerge(molecule *mol, molecule *srcmol);
    389 
    390381  private:
    391382  World *world; //!< The world this List belongs to. Needed to avoid deadlocks in the destructor
  • src/molecule_geometry.cpp

    r23bade rb8d15ba  
    104104    (*max) += (*min);
    105105    Translate(min);
    106     Center.Zero();
    107106  }
    108107  delete(min);
     
    118117  int Num = 0;
    119118  molecule::const_iterator iter = begin();  // start at first in list
     119  Vector Center;
    120120
    121121  Center.Zero();
    122 
    123122  if (iter != end()) {   //list not empty?
    124123    for (; iter != end(); ++iter) {  // continue with second if present
     
    128127    Center.Scale(-1./(double)Num); // divide through total number (and sign for direction)
    129128    Translate(&Center);
    130     Center.Zero();
    131129  }
    132130};
     
    197195void molecule::CenterPeriodic()
    198196{
    199   DeterminePeriodicCenter(Center);
     197  Vector NewCenter;
     198  DeterminePeriodicCenter(NewCenter);
     199  // go through all atoms
     200  BOOST_FOREACH(atom* iter, atoms){
     201    *iter -= NewCenter;
     202  }
    200203};
    201204
     
    207210void molecule::CenterAtVector(Vector *newcenter)
    208211{
    209   Center = *newcenter;
     212  // go through all atoms
     213  BOOST_FOREACH(atom* iter, atoms){
     214    *iter -= *newcenter;
     215  }
    210216};
    211217
     
    277283  bool flag;
    278284  Vector Testvector, Translationvector;
     285  Vector Center;
    279286
    280287  do {
     
    322329
    323330  Center.Scale(1./static_cast<double>(getAtomCount()));
     331  CenterAtVector(&Center);
    324332};
    325333
  • src/moleculelist.cpp

    r23bade rb8d15ba  
    193193      }
    194194      // Center and size
    195       (*out) << "\t" << (*ListRunner)->Center << "\t" << sqrt(size) << endl;
     195      Vector *Center = (*ListRunner)->DetermineCenterOfAll();
     196      (*out) << "\t" << *Center << "\t" << sqrt(size) << endl;
     197      delete(Center);
    196198    }
    197199  }
     
    210212};
    211213
    212 /** Simple merge of two molecules into one.
    213  * \param *mol destination molecule
    214  * \param *srcmol source molecule
    215  * \return true - merge successful, false - merge failed (probably due to non-existant indices
    216  */
    217 bool MoleculeListClass::SimpleMerge(molecule *mol, molecule *srcmol)
    218 {
    219   if (srcmol == NULL)
    220     return false;
    221 
    222   // put all molecules of src into mol
    223   for (molecule::iterator iter = srcmol->begin(); !srcmol->empty(); iter=srcmol->begin()) {
    224     atom * const Walker = *iter;
    225     srcmol->UnlinkAtom(Walker);
    226     mol->AddAtom(Walker);
    227   }
    228 
    229   // remove src
    230   ListOfMolecules.remove(srcmol);
    231   World::getInstance().destroyMolecule(srcmol);
    232   return true;
    233 };
    234 
    235 /** Simple add of one molecules into another.
    236  * \param *mol destination molecule
    237  * \param *srcmol source molecule
    238  * \return true - merge successful, false - merge failed (probably due to non-existant indices
    239  */
    240 bool MoleculeListClass::SimpleAdd(molecule *mol, molecule *srcmol)
    241 {
    242   if (srcmol == NULL)
    243     return false;
    244 
    245   // put all molecules of src into mol
    246   atom *Walker = NULL;
    247   for (molecule::iterator iter = srcmol->begin(); iter != srcmol->end(); ++iter) {
    248     Walker = mol->AddCopyAtom((*iter));
    249     Walker->father = Walker;
    250   }
    251 
    252   return true;
    253 };
    254 
    255 /** Simple merge of a given set of molecules into one.
    256  * \param *mol destination molecule
    257  * \param *src index of set of source molecule
    258  * \param N number of source molecules
    259  * \return true - merge successful, false - some merges failed (probably due to non-existant indices)
    260  */
    261 bool MoleculeListClass::SimpleMultiMerge(molecule *mol, int *src, int N)
    262 {
    263   bool status = true;
    264   // check presence of all source molecules
    265   for (int i=0;i<N;i++) {
    266     molecule *srcmol = ReturnIndex(src[i]);
    267     status = status && SimpleMerge(mol, srcmol);
    268   }
    269   insert(mol);
    270   return status;
    271 };
    272 
    273 /** Simple add of a given set of molecules into one.
    274  * \param *mol destination molecule
    275  * \param *src index of set of source molecule
    276  * \param N number of source molecules
    277  * \return true - merge successful, false - some merges failed (probably due to non-existant indices)
    278  */
    279 bool MoleculeListClass::SimpleMultiAdd(molecule *mol, int *src, int N)
    280 {
    281   bool status = true;
    282   // check presence of all source molecules
    283   for (int i=0;i<N;i++) {
    284     molecule *srcmol = ReturnIndex(src[i]);
    285     status = status && SimpleAdd(mol, srcmol);
    286   }
    287   return status;
    288 };
    289 
    290 /** Scatter merge of a given set of molecules into one.
    291  * Scatter merge distributes the molecules in such a manner that they don't overlap.
    292  * \param *mol destination molecule
    293  * \param *src index of set of source molecule
    294  * \param N number of source molecules
    295  * \return true - merge successful, false - merge failed (probably due to non-existant indices
    296  * \TODO find scatter center for each src molecule
    297  */
    298 bool MoleculeListClass::ScatterMerge(molecule *mol, int *src, int N)
    299 {
    300   // check presence of all source molecules
    301   for (int i=0;i<N;i++) {
    302     // get pointer to src molecule
    303     molecule *srcmol = ReturnIndex(src[i]);
    304     if (srcmol == NULL)
    305       return false;
    306   }
    307   // adapt each Center
    308   for (int i=0;i<N;i++) {
    309     // get pointer to src molecule
    310     molecule *srcmol = ReturnIndex(src[i]);
    311     //srcmol->Center.Zero();
    312     srcmol->Translate(&srcmol->Center);
    313   }
    314   // perform a simple multi merge
    315   SimpleMultiMerge(mol, src, N);
    316   return true;
    317 };
    318 
    319 /** Embedding merge of a given set of molecules into one.
    320  * Embedding merge inserts one molecule into the other.
    321  * \param *mol destination molecule (fixed one)
    322  * \param *srcmol source molecule (variable one, where atoms are taken from)
    323  * \return true - merge successful, false - merge failed (probably due to non-existant indices)
    324  * \TODO linked cell dimensions for boundary points has to be as big as inner diameter!
    325  */
    326 bool MoleculeListClass::EmbedMerge(molecule *mol, molecule *srcmol)
    327 {
    328   LinkedCell *LCList = NULL;
    329   Tesselation *TesselStruct = NULL;
    330   if ((srcmol == NULL) || (mol == NULL)) {
    331     DoeLog(1) && (eLog()<< Verbose(1) << "Either fixed or variable molecule is given as NULL." << endl);
    332     return false;
    333   }
    334 
    335   // calculate envelope for *mol
    336   LCList = new LinkedCell(mol, 8.);
    337   FindNonConvexBorder(mol, TesselStruct, (const LinkedCell *&)LCList, 4., NULL);
    338   if (TesselStruct == NULL) {
    339     DoeLog(1) && (eLog()<< Verbose(1) << "Could not tesselate the fixed molecule." << endl);
    340     return false;
    341   }
    342   delete(LCList);
    343   LCList = new LinkedCell(TesselStruct, 8.);  // re-create with boundary points only!
    344 
    345   // prepare index list for bonds
    346   atom ** CopyAtoms = new atom*[srcmol->getAtomCount()];
    347   for(int i=0;i<srcmol->getAtomCount();i++)
    348     CopyAtoms[i] = NULL;
    349 
    350   // for each of the source atoms check whether we are in- or outside and add copy atom
    351   int nr=0;
    352   for (molecule::const_iterator iter = srcmol->begin(); iter != srcmol->end(); ++iter) {
    353     DoLog(2) && (Log() << Verbose(2) << "INFO: Current Walker is " << **iter << "." << endl);
    354     if (!TesselStruct->IsInnerPoint((*iter)->getPosition(), LCList)) {
    355       CopyAtoms[(*iter)->nr] = (*iter)->clone();
    356       mol->AddAtom(CopyAtoms[(*iter)->nr]);
    357       nr++;
    358     } else {
    359       // do nothing
    360     }
    361   }
    362   DoLog(1) && (Log() << Verbose(1) << nr << " of " << srcmol->getAtomCount() << " atoms have been merged.");
    363 
    364   // go through all bonds and add as well
    365   for(molecule::iterator AtomRunner = srcmol->begin(); AtomRunner != srcmol->end(); ++AtomRunner)
    366     for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); BondRunner != (*AtomRunner)->ListOfBonds.end(); ++BondRunner)
    367       if ((*BondRunner)->leftatom == *AtomRunner) {
    368         DoLog(3) && (Log() << Verbose(3) << "Adding Bond between " << *CopyAtoms[(*BondRunner)->leftatom->nr] << " and " << *CopyAtoms[(*BondRunner)->rightatom->nr]<< "." << endl);
    369         mol->AddBond(CopyAtoms[(*BondRunner)->leftatom->nr], CopyAtoms[(*BondRunner)->rightatom->nr], (*BondRunner)->BondDegree);
    370       }
    371   delete(LCList);
    372   return true;
    373 };
    374214
    375215/** Simple output of the pointers in ListOfMolecules.
  • src/periodentafel.cpp

    r23bade rb8d15ba  
    295295    getline(input,header1tmp);
    296296    getline(input,header2tmp); // skip first two header lines
    297     cout << "First header: " << header1tmp << endl;
    298     cout << "Second header: " << header2tmp << endl;
     297    //cout << "First header: " << header1tmp << endl;
     298    //cout << "Second header: " << header2tmp << endl;
    299299    DoLog(0) && (Log() << Verbose(0) <<  "Parsed elements:");
    300300    while (!input.eof()) {
  • tests/regression/Simple_configuration/5/pre/test.conf

    r23bade rb8d15ba  
    2828OutSrcStep      5       # Output "restart" data every ..th step
    2929TargetTemp      0.000950045     # Target temperature
    30 MaxPsiStep      0       # number of Minimisation steps per state (0 - default)
     30MaxPsiStep      3       # number of Minimisation steps per state (0 - default)
    3131EpsWannier      1e-07   # tolerance value for spread minimisation of orbitals
    3232
     
    3535RelEpsTotalE    1e-07   # relative change in total energy
    3636RelEpsKineticE  1e-05   # relative change in kinetic energy
    37 MaxMinStopStep  0       # check every ..th steps
    38 MaxMinGapStopStep       0       # check every ..th steps
     37MaxMinStopStep  1       # check every ..th steps
     38MaxMinGapStopStep       1       # check every ..th steps
    3939
    4040# Values specifying when to stop for INIT, otherwise same as above
     
    4242InitRelEpsTotalE        1e-05   # relative change in total energy
    4343InitRelEpsKineticE      0.0001  # relative change in kinetic energy
    44 InitMaxMinStopStep      0       # check every ..th steps
    45 InitMaxMinGapStopStep   0       # check every ..th steps
     44InitMaxMinStopStep      1       # check every ..th steps
     45InitMaxMinGapStopStep   1       # check every ..th steps
    4646
    4747BoxLength                       # (Length of a unit cell)
     
    5454Level0Factor    2       # factor by which node number increases from S to 0 level
    5555RiemannTensor   0       # (Use metric)
    56 PsiType         0       # 0 - doubly occupied, 1 - SpinUp,SpinDown
     56PsiType         1       # 0 - doubly occupied, 1 - SpinUp,SpinDown
    5757MaxPsiDouble    0       # here: specifying both maximum number of SpinUp- and -Down-states
    5858PsiMaxNoUp      0       # here: specifying maximum number of SpinUp-states
    59 PsiMaxNoDown    0       # here: specifying maximum number of SpinDown-states
     59PsiMaxNoDown    1       # here: specifying maximum number of SpinDown-states
    6060AddPsis         0       # Additional unoccupied Psis for bandgap determination
    6161
  • tests/regression/testsuite-simple_configuration.at

    r23bade rb8d15ba  
    3131AT_CHECK([../../molecuilder -i test2.conf -e ${abs_top_srcdir}/src/ -o mpqc pcp xyz -a 1 --position "0., 0., -1."], 134, [ignore], [ignore])
    3232AT_CLEANUP
     33AT_SETUP([Simple configuration - adding atom with Undo/Redo])
     34AT_KEYWORDS([configuration])
     35AT_CHECK([../../molecuilder -i empty.conf -o pcp -a 1 --position "10., 10., 10." --undo], 0, [ignore], [ignore])
     36AT_CHECK([file=empty.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
     37AT_CHECK([../../molecuilder -i test.conf -o mpqc pcp xyz -a 1 --position "10., 10., 10." --undo --redo], 0, [ignore], [ignore])
     38AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
     39AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
     40AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
     41AT_CLEANUP
    3342
    3443# 4. change the element
     
    3746AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
    3847AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 ], 0, [ignore], [ignore])
     48AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore])
     49AT_CLEANUP
     50AT_SETUP([Simple configuration - Changing element with Undo/Redo])
     51AT_KEYWORDS([configuration])
     52AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
     53AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo], 0, [ignore], [ignore])
     54AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/$file], 0, [ignore], [ignore])
     55AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
     56AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo --redo], 0, [ignore], [ignore])
    3957AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore])
    4058AT_CLEANUP
     
    4866AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore])
    4967AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore])
     68AT_CLEANUP
     69AT_SETUP([Simple configuration - Atom removal with Undo/Redo])
     70AT_KEYWORDS([configuration])
     71AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/test.conf .], 0)
     72AT_CHECK([../../molecuilder -i test.conf --select-atom-by-id 0 -r --undo], 0, [ignore], [ignore])
     73AT_CHECK([file=test.conf; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/$file], 0, [ignore], [ignore])
     74AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/test.conf .], 0)
     75AT_CHECK([../../molecuilder -i test.conf --select-atom-by-id 0 -r --undo --redo], 0, [ignore], [ignore])
     76AT_CHECK([file=test.conf; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore])
    5077AT_CLEANUP
    5178
     
    86113AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    87114AT_CLEANUP
     115AT_SETUP([Simple configuration - Removing sphere of atoms with Undo/Redo])
     116AT_KEYWORDS([configuration])
     117AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
     118AT_CHECK([../../molecuilder -i test.xyz --select-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo], 0, [stdout], [stderr])
     119AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
     120AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutsphere.xyz], 0)
     121AT_CHECK([../../molecuilder -i test-withoutsphere.xyz --select-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo --redo], 0, [stdout], [stderr])
     122AT_CHECK([sort -n test-withoutsphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutsphere.xyz-sorted], 0, [ignore], [ignore])
     123AT_CHECK([file=test-withoutsphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     124AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
     125AT_CHECK([../../molecuilder -i test.xyz --select-all-atoms --unselect-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo], 0, [stdout], [stderr])
     126AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
     127AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-sphere.xyz], 0)
     128AT_CHECK([../../molecuilder -i test-sphere.xyz --select-all-atoms --unselect-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo --redo], 0, [stdout], [stderr])
     129AT_CHECK([sort -n test-sphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-sphere.xyz-sorted], 0, [ignore], [ignore])
     130AT_CHECK([file=test-sphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     131AT_CHECK([cat test-sphere.xyz-sorted test-withoutsphere.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore])
     132AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     133AT_CLEANUP
    88134
    89135AT_SETUP([Simple configuration - Removing cuboid of atoms])
     
    95141AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-cuboid.xyz], 0)
    96142AT_CHECK([../../molecuilder -i test-cuboid.xyz --select-all-atoms --unselect-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r], 0, [stdout], [stderr])
     143AT_CHECK([sort -n test-cuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-cuboid.xyz-sorted], 0, [ignore], [ignore])
     144AT_CHECK([file=test-cuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     145AT_CHECK([cat test-cuboid.xyz-sorted test-withoutcuboid.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore])
     146AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     147AT_CLEANUP
     148AT_SETUP([Simple configuration - Removing cuboid of atoms with Undo/Redo])
     149AT_KEYWORDS([configuration])
     150AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
     151AT_CHECK([../../molecuilder -i test.xyz --select-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo], 0, [stdout], [stderr])
     152AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
     153AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutcuboid.xyz], 0)
     154AT_CHECK([../../molecuilder -i test-withoutcuboid.xyz --select-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo --redo], 0, [stdout], [stderr])
     155AT_CHECK([sort -n test-withoutcuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutcuboid.xyz-sorted], 0, [ignore], [ignore])
     156AT_CHECK([file=test-withoutcuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     157AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
     158AT_CHECK([../../molecuilder -i test.xyz --select-all-atoms --unselect-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo], 0, [stdout], [stderr])
     159AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
     160AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-cuboid.xyz], 0)
     161AT_CHECK([../../molecuilder -i test-cuboid.xyz --select-all-atoms --unselect-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo --redo], 0, [stdout], [stderr])
    97162AT_CHECK([sort -n test-cuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-cuboid.xyz-sorted], 0, [ignore], [ignore])
    98163AT_CHECK([file=test-cuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
  • tests/regression/testsuite-standard_options.at

    r23bade rb8d15ba  
    55AT_CHECK([pwd],[ignore],[ignore])
    66AT_CHECK([../../molecuilder -v 1], 0, [stdout], [ignore])
    7 AT_CHECK([fgrep olecuilder stdout], 0, [ignore], [ignore])
     7AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore])
     8AT_CLEANUP
     9AT_SETUP([Standard Options - verbosity with Undo/Redo])
     10AT_KEYWORDS([options])
     11AT_CHECK([../../molecuilder -v 1 --undo], 0, [stdout], [ignore])
     12AT_CHECK([grep "Setting verbosity from 1 to .*" stdout], 0, [ignore], [ignore])
     13AT_CHECK([../../molecuilder -v 1 --undo --redo], 0, [stdout], [ignore])
     14AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore])
    815AT_CLEANUP
    916
     
    5360AT_CHECK([fgrep "I won't parse trajectories" stdout], 0, [ignore], [ignore])
    5461AT_CLEANUP
     62AT_SETUP([Standard Options - fast trajectories with Undo/Redo])
     63AT_KEYWORDS([options])
     64AT_CHECK([../../molecuilder -i test.conf -n 1 --undo], 0, [stdout], [stderr])
     65AT_CHECK([fgrep "I will parse trajectories." stdout], 0, [ignore], [ignore])
     66AT_CHECK([../../molecuilder -i test.conf -n 1 --undo --redo], 0, [stdout], [stderr])
     67AT_CHECK([grep -c "I won't parse trajectories" stdout], 0, 2
     68, [ignore])
     69AT_CLEANUP
    5570
    5671# 7. molecule default name
     
    6075AT_CHECK([fgrep "Default name of new molecules set to test." stdout], 0, [ignore], [ignore])
    6176AT_CLEANUP
     77AT_SETUP([Standard Options - molecule default name with Undo/Redo])
     78AT_KEYWORDS([options])
     79AT_CHECK([../../molecuilder -i test.conf -X test --undo], 0, [stdout], [stderr])
     80AT_CHECK([fgrep "Default name of new molecules set to none." stdout], 0, [ignore], [ignore])
     81AT_CHECK([../../molecuilder -i test.conf -X test --undo --redo], 0, [stdout], [stderr])
     82AT_CHECK([fgrep "Default name of new molecules set to test." stdout], 0, [ignore], [ignore])
     83AT_CLEANUP
Note: See TracChangeset for help on using the changeset viewer.