Table of Contents

Name

manipulator - plugins for N-body simulators performing work on a snapshot

Synopsis


#include <public/manip.h>#include <public/defman.h>namespace {
  using namespace falcON;
    class foobar : public manipulator {
      public:
      const char* name() const;
      const char* describe const;
      fieldset need() const;
      fieldset change() const;
      fieldset provide() const;
   
      bool manipulate(const snapshot*) const;
      foobar(const double *pars, int npar, const char *file);
      !foobar();
   };
}
__DEF__MAN(foobar)
The foobar class gets compiled into a shared object foobar.so, and is required to have a specific type of constructor and a number of member functions. The __DEF__MAN macro will then create an extern "C" function, called inimanip, which can be loaded by the dynamic object loaded (see also loadobj(3NEMO) ). It will instantiate a foobar object, and made available to the code.

On the "server" side, i.e. the code that needs to initialize and distribute the work, the Manipulator class constrols this.


 class Manipulator;

Description

manipulators are plugins that can be used to perform action(s) on a snapshots that are not known at compile time, but can be dynamically choosen by the user at run-time. Similar to potential(5NEMO) and acceleration(5NEMO) , they are code (in this case a C++ class, see the example above) that has been pre-compiled and can be loaded at run-time, based on a descriptive name and an optional set of parameters and files.

From a user’s perspective a name must be given to find the manipulator (typically the class name), as well as an optional set of parameters and files for that manipulator. As usual these will present them to the user as a set of keywords:

manipname=    name of the manipulator (multiple can be given, see below)
manippars=    a set of parameters this manipulator will understand (optional)
manipfile=    a set of character strings, ususally one or more files (optional)
manippath=    search path (or use $MANIPPATH if left blank???)
manipinit=    ? manipulate initial snapshot ? [specific to gyrfalcON]
Multiple manipulator can be given, and are processed in the order given on the manipname= keyword. Here is an example:
manipname=name1+name2+name3manippars=";1,2,3;"manipfile="file1;;file3a,file3b"
where the first manipulator has no parameters, and one file, the 2nd manipulator has 3 parameters given, and no file, and the third has no parameters and 2 files. Instead of the ; symbol to separate parameters or files, a single space (not a tab) can also be used. For manipulator names the , symbol can also be used to separate their names.

Examples

Examples can be found within the gyrfalcON(1NEMO) source tree. Here is an example, actually taken from the glnemo source tree, of the integrator able to send snapshot data, as they are produced, into the glnemo(1NEMO) display server via a manipulator:
  host1% mkexpdisk disk1 50000
  host1% gyrfalcon in=disk1 out=disk1.out step=100 manipname=glnemo
  host2% glnemo server=host1
This particular manipulator is only using manippars as an optional keyword, and is interpreted as a single integer denoting the port number on which glnemo is talking (port=444 in glnemo)

Environment

The environment variable MANIPPATH can be used to search for accelerations in other than the local directory. This feature is however not implemented everywhere, hence the manippath= keyword.

See Also

acceleration(5NEMO) , potential(5NEMO) , gyrfalcON(1NEMO) , loadobj(5NEMO)

http://www.tntnet.org/cxxtools.bhtm for another c++ wrapper example to loadobj

Author

Walter Dehnen

Files


NEMO/usr/dehnen/falcON            tree code that accepts manipulators, plus some examples
NEMO/src/nbody/glnemo/manipulators    example glnemo manipulator
NEMO/usr/dehnen/falcON/manip        repository of manipulator files
NEMO/obj/manip                repository of manipulator files

Update History


7-nov-05    initial man page written    PJT
12-jul-06    ’#’ no longer allowed as separator, but space is    WD


Table of Contents