source: src/Actions/MoleculeAction/FillWithMoleculeAction.def@ 88bb6b

Last change on this file since 88bb6b was 6ba9ba, checked in by Frederik Heber <heber@…>, 13 years ago

Default values are properly set by the Action into their (Action)Parameters.

  • we changed the boost::preprocessor magic to accomplish this.
  • NODEFAULT -> NOPARAM_DEFAULT to be safe.
  • it has been a hell of a lot of work to make it possible to add a construct such as ", default" to the call of a function, either the comma or the default is easy but both could only be accomplished via a list contained in the sequence of default values. Because the list has an explicit NIL element which is taken as NOPARAM_DEFAULT.
  • PARAM_DEFAULT is a macro to wrap the default value into a list.
  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*
2 * FillWithMoleculeAction.def
3 *
4 * Created on: Aug 26, 2010
5 * Author: heber
6 */
7
8// all includes and forward declarations necessary for non-integral types below
9#include <boost/assign.hpp>
10#include <boost/filesystem/path.hpp>
11#include <vector>
12#include "LinearAlgebra/Vector.hpp"
13
14#include "Parameters/Validators/DiscreteValidator.hpp"
15#include "Parameters/Validators/DummyValidator.hpp"
16#include "Parameters/Validators/Ops_Validator.hpp"
17#include "Parameters/Validators/Specific/BoxLengthValidator.hpp"
18#include "Parameters/Validators/Specific/BoxVectorValidator.hpp"
19#include "Parameters/Validators/Specific/FilePresentValidator.hpp"
20#include "Parameters/Validators/Specific/ParserFileValidator.hpp"
21
22// i.e. there is an integer with variable name Z that can be found in
23// ValueStorage by the token "Z" -> first column: int, Z, "Z"
24// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
25#define paramtypes (boost::filesystem::path)(Vector)(double)(double)(double)(double)(bool)
26#define paramtokens ("fill-molecule")("distances")("distance-to-molecule")("random-atom-displacement")("random-molecule-displacement")("MaxDistance")("DoRotate")
27#define paramdescriptions ("name of xyz file of filler molecule")("list of three of distances in space, one for each axis direction")("minimum distance to present molecules")("magnitude of random atom displacement")("magnitude of random molecule displacement")("maximum spatial distance")("whether to rotate or not")
28#define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(0.))(PARAM_DEFAULT(0.))(PARAM_DEFAULT(0.))(PARAM_DEFAULT(0.))(PARAM_DEFAULT(false))
29#define paramreferences (fillername)(distances)(boundary)(RandAtomDisplacement)(RandMoleculeDisplacement)(MaxDistance)(DoRotate)
30#define paramvalids \
31(FilePresentValidator() && ParserFileValidator()) \
32(BoxVectorValidator()) \
33(BoxLengthValidator()) \
34(BoxLengthValidator()) \
35(BoxLengthValidator()) \
36(BoxLengthValidator() || DiscreteValidator<double>(std::vector<double>(1,-1.))) \
37(DummyValidator< bool >())
38
39#define statetypes (std::vector<molecule *>)
40#define statereferences (fillermolecules)
41
42// some defines for all the names, you may use ACTION, STATE and PARAMS
43#define CATEGORY Molecule
44#define MENUNAME "molecule"
45#define MENUPOSITION 4
46#define ACTIONNAME FillWithMolecule
47#define TOKEN "fill-molecule"
48
49
50// finally the information stored in the ActionTrait specialization
51#define DESCRIPTION "fill around molecules' surface with a filler molecule"
52#define SHORTFORM "F"
53
Note: See TracBrowser for help on using the repository browser.