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