Changeset 73faf4 for src/Actions


Ignore:
Timestamp:
May 8, 2017, 2:00:47 PM (8 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
ForceAnnealing_goodresults, ForceAnnealing_tocheck
Children:
c8165c
Parents:
ce254c (diff), cb6357 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'GeometryObjects' into Candidate_v1.6.1

Location:
src/Actions
Files:
15 added
7 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/Action_impl_pre.hpp

    rce254c r73faf4  
    173173    output << \
    174174    BOOST_PP_IF(n, ", ", "") \
    175     << "\"" << toPythonString(params. \
     175    << "\"" << params. \
    176176        BOOST_PP_SEQ_ELEM(n, paramreferences) \
    177         .getUnvalidated()) \
     177        .getAsStringUnvalidated() \
    178178    << "\"";
    179179
  • src/Actions/CommandAction/HelpAction.cpp

    rce254c r73faf4  
    7373  std::cout << "\t - List/vector of strings: gives as \"first\" \"second\" \"third\"." << std::endl;
    7474  std::cout << "\t - Vector: give as \"x,y,z\", i.e. its 3 components." << std::endl;
     75  std::cout << "\t -         or give as \"<name>\", where <name> is a stored geometry name." << std::endl;
    7576  std::cout << "\t - Domain: give as \"xx,yx,yy,zx,zy,zz\", i.e. symmetric 3x3 matrix." << std::endl;
    7677  std::cout << "\t - Path/filename: give as \"<path/filename>\"." << std::endl;
  • src/Actions/GlobalListOfActions.hpp

    rce254c r73faf4  
    6969  (FragmentationStoreSaturatedFragment) \
    7070  (FragmentationStructuralOptimization) \
     71  (GeometryDistanceToVector) \
     72  (GeometryInputToVector) \
     73  (GeometryPlaneToVector) \
     74  (GeometryPositionToVector) \
     75  (GeometryRemove) \
    7176  (GraphUpdateMolecules) \
    7277  (GraphCorrectBondDegree) \
  • src/Actions/Makefile.am

    rce254c r73faf4  
    6464  ${FILLACTIONSOURCE} \
    6565  ${FRAGMENTATIONACTIONSOURCE} \
     66  ${GEOMETRYACTIONSOURCE} \
    6667  ${GRAPHACTIONSOURCE} \
    6768  ${MOLECULEACTIONSOURCE} \
     
    8485  ${FILLACTIONHEADER} \
    8586  ${FRAGMENTATIONACTIONHEADER} \
     87  ${GEOMETRYACTIONHEADER} \
    8688  ${GRAPHACTIONHEADER} \
    8789  ${MOLECULEACTIONHEADER} \
     
    104106  ${FILLACTIONDEFS} \
    105107  ${FRAGMENTATIONACTIONDEFS} \
     108  ${GEOMETRYACTIONDEFS} \
    106109  ${GRAPHACTIONDEFS} \
    107110  ${MOLECULEACTIONDEFS} \
     
    285288  Actions/FragmentationAction/StoreSaturatedFragmentAction.def \
    286289  Actions/FragmentationAction/StructuralOptimizationAction.def
     290
     291GEOMETRYACTIONSOURCE = \
     292        Actions/GeometryAction/GeometryDistanceToVectorAction.cpp \
     293        Actions/GeometryAction/GeometryInputToVectorAction.cpp \
     294        Actions/GeometryAction/GeometryPlaneToVectorAction.cpp \
     295        Actions/GeometryAction/GeometryPositionToVectorAction.cpp \
     296        Actions/GeometryAction/GeometryRemoveAction.cpp
     297GEOMETRYACTIONHEADER = \
     298        Actions/GeometryAction/GeometryDistanceToVectorAction.hpp \
     299        Actions/GeometryAction/GeometryInputToVectorAction.hpp \
     300        Actions/GeometryAction/GeometryPlaneToVectorAction.hpp \
     301        Actions/GeometryAction/GeometryPositionToVectorAction.hpp \
     302        Actions/GeometryAction/GeometryRemoveAction.hpp
     303GEOMETRYACTIONDEFS = \
     304        Actions/GeometryAction/GeometryDistanceToVectorAction.def \
     305        Actions/GeometryAction/GeometryInputToVectorAction.def \
     306        Actions/GeometryAction/GeometryPlaneToVectorAction.def \
     307        Actions/GeometryAction/GeometryPositionToVectorAction.def \
     308        Actions/GeometryAction/GeometryRemoveAction.def
    287309
    288310GRAPHACTIONSOURCE = \
  • src/Actions/MakroAction_impl_pre.hpp

    rce254c r73faf4  
    165165    output << \
    166166    BOOST_PP_IF(n, ", ", "") \
    167     << "\"" << toPythonString(params. \
     167    << "\"" << params. \
    168168        BOOST_PP_SEQ_ELEM(n, paramreferences) \
    169         .get()) \
     169        .getAsStringUnvalidated() \
    170170    << "\"";
    171171
  • src/Actions/Values.cpp

    rce254c r73faf4  
    3737#include "CodePatterns/Assert.hpp"
    3838
     39#include <boost/lexical_cast.hpp>
     40#include <boost/tokenizer.hpp>
     41
    3942#include "Box.hpp"
    4043#include "LinearAlgebra/BoxVector.hpp"
     
    4447#include "Values.hpp"
    4548
     49static const Vector parseAsVector(const std::string &_string)
     50{
     51  Vector temp;
     52  // dissect by ","
     53  typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
     54  boost::char_separator<char> value_separator(",)(");
     55
     56  bool status = true;
     57  tokenizer tokens(_string, value_separator);
     58  if (!_string.empty()) {
     59    tokenizer::iterator tok_iter = tokens.begin();
     60    for (size_t i=0;i<NDIM;++i) {
     61      if (tok_iter == tokens.end()) {
     62        status = false;
     63        break;
     64      }
     65      temp[i] = boost::lexical_cast<double>(*(tok_iter++));
     66    }
     67  }
     68  if (!status)
     69    temp.Zero();
     70
     71  return temp;
     72}
     73
    4674Vector VectorValue::toVector() const
    4775{
    48   Vector returnVector(vector);
     76  Vector returnVector = parseAsVector(vectorstring);
    4977
    5078  return returnVector;
     
    5482{
    5583  BoxVector returnVector;
    56   static_cast<Vector>(returnVector) = Vector(vector); // under its hood it's still a Vector
     84  static_cast<Vector>(returnVector) = parseAsVector(vectorstring); // under its hood it's still a Vector
    5785
    5886  ASSERT(_box.isValid(returnVector),
  • src/Actions/Values.hpp

    rce254c r73faf4  
    2727 * are registered as VectorValue and lateron inside the CommandLineQuery placed
    2828 * into the real vector.
     29 *
     30 * We use this abstraction also for Geometry Objects, i.e. string names
     31 * referencing vectors in the GeomtryRegistry.
    2932 */
    3033struct VectorValue
    3134{
    32   double vector[NDIM];
     35  std::string vectorstring;
    3336
    3437  Vector toVector() const;
Note: See TracChangeset for help on using the changeset viewer.