Changeset 802a9d


Ignore:
Timestamp:
Dec 21, 2025, 9:50:27 PM (5 days ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.1, stable
Children:
2e7888
Parents:
e4b9d5
git-author:
Frederik Heber <frederik.heber@…> (11/18/25 19:34:57)
git-committer:
Frederik Heber <frederik.heber@…> (12/21/25 21:50:27)
Message:

Adds scripts to generate a bond table.

  • one python script for the computation and a bash script to call it. With this split, we can easily parallelize the computations to make use of JobMarket's multiple workers.
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    re4b9d5 r802a9d  
    631631AM_COND_IF([CONDPYTHON],[
    632632        AC_CONFIG_FILES([utils/Python/boxmaker.py:utils/Python/boxmaker.py.in], [chmod +x utils/Python/boxmaker.py])
     633        AC_CONFIG_FILES([utils/Python/generate_bondtable.sh:utils/Python/generate_bondtable.sh.in], [chmod +x utils/Python/generate_bondtable.sh])
     634        AC_CONFIG_FILES([utils/Python/compute_pair_bondlength.py:utils/Python/compute_pair_bondlength.py.in], [chmod +x utils/Python/compute_pair_bondlength.py])
    633635        AC_CONFIG_FILES([utils/Python/python_wrapper:utils/Python/python_wrapper.in], [chmod +x utils/Python/python_wrapper])
    634636        AC_CONFIG_FILES([tests/Python/run], [chmod +x tests/Python/run])
  • src/Python/export_numpy.cpp

    re4b9d5 r802a9d  
    4141
    4242#include "CodePatterns/Assert.hpp"
    43 
     43#include "CodePatterns/Log.hpp"
     44
     45#include "Geometry/GeometryRegistry.hpp"
    4446#include "World.hpp"
    4547
     
    7880
    7981  return positions;
     82}
     83
     84np::ndarray get_geometryobject(const std::string &name)
     85{
     86  LOG(1, "Getting GeometryObject of name " << name);
     87  const GeometryObject *object = GeometryRegistry::getInstance().getByName(name);
     88  p::tuple shape = p::make_tuple(3);
     89  np::dtype dtype = np::dtype::get_builtin<double>();
     90  np::ndarray distance = np::zeros(shape, dtype);
     91  if (object != NULL) {
     92    for (unsigned int i=0;i<NDIM;++i)
     93      distance[i] = object->getVector()[i];
     94  }
     95  return distance;
    8096}
    8197
     
    173189void export_numpy()
    174190{
     191  p::def("get_geometryobject", get_geometryobject, p::args("name"));
    175192  p::def("get_positions", get_positions);
    176193  p::def("get_velocities", get_velocities);
  • utils/Python/Makefile.am

    re4b9d5 r802a9d  
    11if CONDPYTHON
    22PYTHON_TOOLS = \
    3         Python/boxmaker
     3        Python/boxmaker \
     4        Python/generate_bondtable \
     5        Python/compute_pair_bondlength
    46endif
    57
     
    1315BUILT_SOURCES += ${PYTHON_TOOLS}
    1416CLEANFILES += ${PYTHON_TOOLS}
    15 pyexec_SCRIPTS += Python/boxmaker.py
     17pyexec_SCRIPTS += \
     18        Python/boxmaker.py \
     19        Python/compute_pair_bondlength.py
    1620endif
Note: See TracChangeset for help on using the changeset viewer.