This HTML automatically generated with rman for NEMO
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 ...

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(5falcON) , 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 users 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, the ; 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(5falcON) , potential(5NEMO) , gyrfalcON(1falcON) , 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 compiled manipulator files
NEMO/obj/manip                repository of compiled manipulator files

Update History


7-nov-05    initial man page written    PJT


Table of Contents