| 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 atoms.dox
 | 
|---|
| 10 |  *
 | 
|---|
| 11 |  * Created on: Oct 31, 2011
 | 
|---|
| 12 |  *    Author: heber
 | 
|---|
| 13 |  */
 | 
|---|
| 14 | 
 | 
|---|
| 15 | /**
 | 
|---|
| 16 |  * \page atoms Atoms
 | 
|---|
| 17 |  *
 | 
|---|
| 18 |  * Atoms are the central ingredient. They store the following information:
 | 
|---|
| 19 |  * - position, velocity, and force (over multiple time steps)
 | 
|---|
| 20 |  * - element
 | 
|---|
| 21 |  * - bond neighbours (over multiple time steps)
 | 
|---|
| 22 |  * - id
 | 
|---|
| 23 |  *
 | 
|---|
| 24 |  * \section atoms-structure
 | 
|---|
| 25 |  *
 | 
|---|
| 26 |  * The atom class has quite a complicated structure because an atoms has to
 | 
|---|
| 27 |  * fulfill various roles within this code:
 | 
|---|
| 28 |  * - atom
 | 
|---|
| 29 |  * - TesselPoint for Tesselation
 | 
|---|
| 30 |  * - Graph node for BondGraph
 | 
|---|
| 31 |  * - bonded particle
 | 
|---|
| 32 |  *
 | 
|---|
| 33 |  * There is an onion structure where additional information has been added
 | 
|---|
| 34 |  * as the layers of an onion via inheritance.
 | 
|---|
| 35 |  *
 | 
|---|
| 36 |  * We briefly want to explain the various elements of the inheritance
 | 
|---|
| 37 |  * - AtomObservable - contains notification channels enumeration and also all
 | 
|---|
| 38 |  *  interface function required by the Observable pattern.
 | 
|---|
| 39 |  * - AtomInfo - contains position, element and so on.
 | 
|---|
| 40 |  * - ParticleInfo - contains name and number of the atom
 | 
|---|
| 41 |  * - BondedParticle - contains all functions related to bonds
 | 
|---|
| 42 |  * - BondedParticleInfo - contains all member variables related to storing bond
 | 
|---|
| 43 |  *   information
 | 
|---|
| 44 |  * - GraphNode - contains all functions related to graphs
 | 
|---|
| 45 |  * - GraphNodeInfo - contains all member variables for graph information
 | 
|---|
| 46 |  * - TesselPoint - contains functions for considering the atom as a TesselPoint
 | 
|---|
| 47 |  *   in Tesselation (\ref tesselation)
 | 
|---|
| 48 |  *
 | 
|---|
| 49 |  * Member variables and functions have been split into class with and without
 | 
|---|
| 50 |  * added \a ...Info. ...Info classes that are required multiple times are
 | 
|---|
| 51 |  * inherited as virtual to guarantee that their members are unique (exist
 | 
|---|
| 52 |  * only once) within an instance.
 | 
|---|
| 53 |  *
 | 
|---|
| 54 |  * \note Atoms have a sort-of early serialization concept (\ref serialization)
 | 
|---|
| 55 |  * as AtomicInfo. \todo This could be refactored into a full serialization
 | 
|---|
| 56 |  * compatible implementation.
 | 
|---|
| 57 |  *
 | 
|---|
| 58 |  * \section atoms-copy Copying atoms
 | 
|---|
| 59 |  *
 | 
|---|
| 60 |  * Copying atoms is a frequent action. That's why there are specific functors
 | 
|---|
| 61 |  * to get it done in more and more complex ways. The functors all inherit
 | 
|---|
| 62 |  * the \ref CopyAtomsInterface and the more complex ones build upon the
 | 
|---|
| 63 |  * functionality of the simpler ones:
 | 
|---|
| 64 |  * -# CopyAtomsInterface: Internally sets to the number of desired atoms.
 | 
|---|
| 65 |  * -# CopyAtoms_Simple: Fills the internal set with true copies.
 | 
|---|
| 66 |  * -# CopyAtoms_withBonds: Additionally also adds bonds in between the copies
 | 
|---|
| 67 |  *    as they exist in between the original atoms.
 | 
|---|
| 68 |  * -# CopyAtoms_SaturateDanglingBonds: additionally checks for cut bond that
 | 
|---|
| 69 |  *    would now become dangling bonds and inserts additional hydrogens for
 | 
|---|
| 70 |  *    each cut bond such that the copied array of atoms is saturated.
 | 
|---|
| 71 |  *
 | 
|---|
| 72 |  * The CopyAtomsInterface is simple to use:
 | 
|---|
| 73 |  * \code
 | 
|---|
| 74 |  *   std::vector<atom *> atoms_to_copy;
 | 
|---|
| 75 |  *   CopyAtoms_Simple copyMethod;
 | 
|---|
| 76 |  *   copyMethod(atoms_to_copy);
 | 
|---|
| 77 |  *   std::vector<atom *> copiedAtoms = getCopiedAtoms();
 | 
|---|
| 78 |  * \endcode
 | 
|---|
| 79 |  *
 | 
|---|
| 80 |  *
 | 
|---|
| 81 |  * \date 2012-03-30
 | 
|---|
| 82 |  *
 | 
|---|
| 83 |  */
 | 
|---|