Changeset f6a8e7


Ignore:
Timestamp:
May 25, 2016, 7:13:57 AM (9 years ago)
Author:
Frederik Heber <heber@…>
Children:
3b6956
Parents:
9cbbe1
git-author:
Frederik Heber <heber@…> (05/10/16 09:13:37)
git-committer:
Frederik Heber <heber@…> (05/25/16 07:13:57)
Message:

AddBondAction also sets a desired bond degree.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/BondAction/BondAddAction.cpp

    r9cbbe1 rf6a8e7  
    9191        "BondAddAction::performCall() - at least one of the ids "
    9292        +toString(iter->first)+" or "+toString(iter->second)+" is not present.");
    93     firstatom->addBond(WorldTime::getTime(), secondatom);
     93    bond::ptr newbond = firstatom->addBond(WorldTime::getTime(), secondatom);
     94    newbond->setDegree(params.degree.get());
    9495    ASSERT( firstatom->IsBondedTo(WorldTime::getTime(), secondatom),
    9596      "BondAddAction::performCall() - adding bond in between "
  • src/Actions/BondAction/BondAddAction.def

    r9cbbe1 rf6a8e7  
    1313typedef std::vector<std::pair<atomId_t,atomId_t> > bondPairIds_t;
    1414
     15#include "Parameters/Validators/RangeValidator.hpp"
     16
    1517// i.e. there is an integer with variable name Z that can be found in
    1618// ValueStorage by the token "Z" -> first column: int, Z, "Z"
    1719// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
    1820//#define paramtypes (const element *)(BoxVector) TODO: use a validator
    19 #undef paramtypes
    20 #undef paramtokens
    21 #undef paramdescriptions
    22 #undef paramreferences
    23 #undef paramdefaults
    24 #undef paramvalids
     21#define paramtypes (int)
     22#define paramtokens ("bond-degree")
     23#define paramdescriptions ("bond degree of each the added bonds")
     24#define paramreferences (degree)
     25#define paramdefaults (PARAM_DEFAULT(1))
     26#define paramvalids \
     27(RangeValidator<int>(1,10))
    2528
    2629#define statetypes (bondPairIds_t)
  • tests/Python/AllActions/options.dat

    r9cbbe1 rf6a8e7  
    3131bin-start       "5"
    3232bin-width       "1."
     33bond-degree     "1"
    3334bond-file       "bond.dat"
    3435bond-table      "table.dat"
Note: See TracChangeset for help on using the changeset viewer.