| [b380ed] | 1 | /*
 | 
|---|
 | 2 |  * Project: MoleCuilder
 | 
|---|
 | 3 |  * Description: creates and alters molecular systems
 | 
|---|
 | 4 |  * Copyright (C)  2010 University of Bonn. All rights reserved.
 | 
|---|
 | 5 |  * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
 | 
|---|
 | 6 |  */
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | /**
 | 
|---|
 | 9 |  * \file filling.dox
 | 
|---|
 | 10 |  *
 | 
|---|
 | 11 |  * Created on: Jan 16, 2012
 | 
|---|
 | 12 |  *    Author: heber
 | 
|---|
 | 13 |  */
 | 
|---|
 | 14 | 
 | 
|---|
 | 15 | /** \page filling Filling a domain
 | 
|---|
 | 16 |  *
 | 
|---|
| [caece4] | 17 |  * The idea behind filling a domain is to cluster it with a set of \b nodes,
 | 
|---|
 | 18 |  * i.e. a position in space in such a way that e.g. around a node is sufficient
 | 
|---|
| [b380ed] | 19 |  * space to fill in the desired molecule. The logic of generating the nodes
 | 
|---|
 | 20 |  * is responsible to create them in such a way as to allow for dense (or
 | 
|---|
 | 21 |  * whatever specific) filling is desired. However, we must not make it too
 | 
|---|
 | 22 |  * complicated. The generation logic for these nodes should concentrate on
 | 
|---|
 | 23 |  * filling the specific domain (sphere, ellipsoid, cuboid, pyramid, ...)
 | 
|---|
 | 24 |  * in the best possible way.
 | 
|---|
| [caece4] | 25 |  * Whether each node can be filled is then to be decided by a \b predicate.
 | 
|---|
| [b380ed] | 26 |  *
 | 
|---|
 | 27 |  * The filling routine uses then both to traverse the given nodes and
 | 
|---|
 | 28 |  * evaluate the predicate at each.
 | 
|---|
 | 29 |  *
 | 
|---|
 | 30 |  * Hence, the filling of a domain is abstracted into the following parts:
 | 
|---|
 | 31 |  *
 | 
|---|
| [dba7b0] | 32 |  *  -# \ref Mesh - node containers
 | 
|---|
 | 33 |  *  -# \ref FillPredicate - predicates
 | 
|---|
 | 34 |  *  -# \ref Filler - a filling routine which itself requires
 | 
|---|
 | 35 |  *    -# \ref Cluster - a set of atoms alone(!) inside a specific Shape
 | 
|---|
 | 36 |  *    -# \ref CopyAtomsInterface - copy Method for atoms used by Cluster::clone
 | 
|---|
 | 37 |  *    -# \ref Inserter - an insertion routine for the cloned cluster
 | 
|---|
| [b380ed] | 38 |  *
 | 
|---|
 | 39 |  * \section filling-node-generation Node generation
 | 
|---|
 | 40 |  *
 | 
|---|
 | 41 |  * The node generation is basically just a point or mesh generator that fills
 | 
|---|
| [caece4] | 42 |  * a specified region based on the class Shape with a mesh in such a way as to 
 | 
|---|
 | 43 |  * fulfill certain criteria:
 | 
|---|
| [b380ed] | 44 |  *
 | 
|---|
 | 45 |  *    -# equidistant
 | 
|---|
 | 46 |  *    -# containing certain primitive volumes (e.g. for fitting polymers)
 | 
|---|
 | 47 |  *    -# ...
 | 
|---|
 | 48 |  *
 | 
|---|
 | 49 |  * \section filling-predicate Predicates
 | 
|---|
 | 50 |  *
 | 
|---|
 | 51 |  * The Predicate pattern has already been used with Descriptors and Shapes.
 | 
|---|
 | 52 |  * These are simply function objects that return a boolean value. I.e. they
 | 
|---|
 | 53 |  * decide whether the current node in the mesh is vacant and can be filled or
 | 
|---|
 | 54 |  * not. As with the predicate() function in the class Descriptor, these should
 | 
|---|
| [dba7b0] | 55 |  * be composable via logic operators such as || (or), && (and), ! (not), ...
 | 
|---|
| [b380ed] | 56 |  *
 | 
|---|
| [caece4] | 57 |  * \note each predicate receives on construction all the required
 | 
|---|
| [b380ed] | 58 |  * information, e.g. LinkedCell_View or Tesselation references or objects, ...
 | 
|---|
 | 59 |  *
 | 
|---|
 | 60 |  * \section filling-filling-routine Filling routine
 | 
|---|
 | 61 |  *
 | 
|---|
 | 62 |  * The filling routine is then simply a function that goes through the given
 | 
|---|
 | 63 |  * number of nodes (completely unaware of the geometry) and evaluates for each
 | 
|---|
 | 64 |  * point the given predicates (which might be a composition of other predicates).
 | 
|---|
 | 65 |  *
 | 
|---|
 | 66 |  * It rejects all nodes that evaluate to false, the list of valid points is
 | 
|---|
| [caece4] | 67 |  * then traversed again and at each node a Cluster is created by the copy method.
 | 
|---|
| [dba7b0] | 68 |  *
 | 
|---|
 | 69 |  * Note that we rely on \ref Cluster's, objects containing a set of atomicId_t
 | 
|---|
| [caece4] | 70 |  * and a \ref Shape, containing all of these atoms, to fill at each node. We use
 | 
|---|
| [dba7b0] | 71 |  * Cluster::clone() to create a copy that is subsequently placed at the desired
 | 
|---|
 | 72 |  * node via an \ref Inserter functor. This allows to either simply shift the
 | 
|---|
 | 73 |  * Cluster or even to perform some random translations and rotations on it, see
 | 
|---|
 | 74 |  * the specific implementations of the class \ref Inserter.
 | 
|---|
| [b380ed] | 75 |  *
 | 
|---|
 | 76 |  *
 | 
|---|
| [caece4] | 77 |  * \date 2014-03-10
 | 
|---|
| [b380ed] | 78 |  */
 | 
|---|