1 |
gezelter |
1862 |
/* |
2 |
|
|
* Copyright (c) 2013 The University of Notre Dame. All Rights Reserved. |
3 |
|
|
* |
4 |
|
|
* The University of Notre Dame grants you ("Licensee") a |
5 |
|
|
* non-exclusive, royalty free, license to use, modify and |
6 |
|
|
* redistribute this software in source and binary code form, provided |
7 |
|
|
* that the following conditions are met: |
8 |
|
|
* |
9 |
|
|
* 1. Redistributions of source code must retain the above copyright |
10 |
|
|
* notice, this list of conditions and the following disclaimer. |
11 |
|
|
* |
12 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
13 |
|
|
* notice, this list of conditions and the following disclaimer in the |
14 |
|
|
* documentation and/or other materials provided with the |
15 |
|
|
* distribution. |
16 |
|
|
* |
17 |
|
|
* This software is provided "AS IS," without a warranty of any |
18 |
|
|
* kind. All express or implied conditions, representations and |
19 |
|
|
* warranties, including any implied warranty of merchantability, |
20 |
|
|
* fitness for a particular purpose or non-infringement, are hereby |
21 |
|
|
* excluded. The University of Notre Dame and its licensors shall not |
22 |
|
|
* be liable for any damages suffered by licensee as a result of |
23 |
|
|
* using, modifying or distributing the software or its |
24 |
|
|
* derivatives. In no event will the University of Notre Dame or its |
25 |
|
|
* licensors be liable for any lost revenue, profit or data, or for |
26 |
|
|
* direct, indirect, special, consequential, incidental or punitive |
27 |
|
|
* damages, however caused and regardless of the theory of liability, |
28 |
|
|
* arising out of the use of or inability to use software, even if the |
29 |
|
|
* University of Notre Dame has been advised of the possibility of |
30 |
|
|
* such damages. |
31 |
|
|
* |
32 |
|
|
* SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your |
33 |
|
|
* research, please cite the appropriate papers when you publish your |
34 |
|
|
* work. Good starting points are: |
35 |
|
|
* |
36 |
|
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 |
|
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 |
|
|
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). |
39 |
|
|
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
|
|
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
|
*/ |
42 |
|
|
|
43 |
|
|
/*! \file Decahedron.hpp |
44 |
|
|
\brief Decahedron cluster structure generator |
45 |
|
|
*/ |
46 |
|
|
|
47 |
|
|
/* Original copyright & license text: |
48 |
|
|
|
49 |
|
|
Copyright (c) 2011, Dmitry |
50 |
|
|
Copyright (c) 2009, Richard Brown |
51 |
|
|
Copyright (c) 2011, Evgeny Pr |
52 |
|
|
All rights reserved. |
53 |
|
|
|
54 |
|
|
Redistribution and use in source and binary forms, with or without |
55 |
|
|
modification, are permitted provided that the following conditions are |
56 |
|
|
met: |
57 |
|
|
|
58 |
|
|
* Redistributions of source code must retain the above copyright |
59 |
|
|
notice, this list of conditions and the following disclaimer. |
60 |
|
|
* Redistributions in binary form must reproduce the above copyright |
61 |
|
|
notice, this list of conditions and the following disclaimer in |
62 |
|
|
the documentation and/or other materials provided with the distribution |
63 |
|
|
|
64 |
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
65 |
|
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
66 |
|
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
67 |
|
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
68 |
|
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
69 |
|
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
70 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
71 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
72 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
73 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
74 |
|
|
POSSIBILITY OF SUCH DAMAGE. |
75 |
|
|
|
76 |
|
|
*/ |
77 |
|
|
|
78 |
|
|
|
79 |
|
|
#ifndef CLUSTERS_DECAHEDRON_HPP |
80 |
|
|
#define CLUSTERS_DECAHEDRON_HPP |
81 |
|
|
|
82 |
|
|
#include <vector> |
83 |
|
|
#include "math/Vector3.hpp" |
84 |
|
|
|
85 |
|
|
using namespace std; |
86 |
|
|
namespace OpenMD{ |
87 |
|
|
|
88 |
|
|
//! Creates the regular decahedron, Ino decahedron, or truncated |
89 |
|
|
//! (Marks) decahedron structures (depending on the parameters). |
90 |
|
|
/*! |
91 |
|
|
(Heavily modified from Matlab code from: |
92 |
|
|
Dmitry, Richard Brown, and Evgeny Pr) |
93 |
|
|
|
94 |
|
|
*/ |
95 |
|
|
class Decahedron { |
96 |
|
|
public: |
97 |
|
|
//! Default constructor |
98 |
|
|
Decahedron(int columnAtoms, int shells, int twinAtoms); |
99 |
|
|
virtual ~Decahedron(); |
100 |
|
|
|
101 |
|
|
//! Get the generated points in the cluster. |
102 |
|
|
virtual vector<Vector3d> getPoints(); |
103 |
|
|
|
104 |
|
|
protected: |
105 |
|
|
//! Generate the rings of the Decahedron. |
106 |
|
|
vector<Vector3d> truncatedRing( int n, int k ); |
107 |
|
|
|
108 |
|
|
int N_; // number of atoms in the central atomic column |
109 |
|
|
int M_; // number of {002} shells |
110 |
|
|
int K_; // number of atomic columns along twin boundary |
111 |
|
|
|
112 |
|
|
vector<Vector3d> Points; |
113 |
|
|
vector<Vector3d> Basis; // Basis vectors of the Decahedron |
114 |
|
|
}; |
115 |
|
|
|
116 |
|
|
class RegularDecahedron : public Decahedron { |
117 |
|
|
public: |
118 |
|
|
RegularDecahedron(int shells) : Decahedron(shells-1, shells, shells) {} |
119 |
|
|
}; |
120 |
|
|
|
121 |
|
|
class InoDecahedron : public Decahedron { |
122 |
|
|
public: |
123 |
|
|
InoDecahedron(int columnAtoms, int shells) : |
124 |
|
|
Decahedron(columnAtoms, shells, columnAtoms) {} |
125 |
|
|
}; |
126 |
|
|
|
127 |
|
|
class CurlingStoneDecahedron : public Decahedron { |
128 |
|
|
public: |
129 |
|
|
CurlingStoneDecahedron(int columnAtoms, int shells, int twinAtoms, int truncatedPlanes); |
130 |
|
|
vector<Vector3d> getPoints(); |
131 |
|
|
private: |
132 |
|
|
int T_; // number of truncated planes snipped from top and bottom |
133 |
|
|
}; |
134 |
|
|
|
135 |
|
|
} |
136 |
|
|
|
137 |
|
|
#endif |