-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathVOTCA_LANGUAGE_GUIDE.html
190 lines (171 loc) · 11.1 KB
/
VOTCA_LANGUAGE_GUIDE.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>VOTCA Internal Contributor Language Guide — VOTCA 2024.2-dev documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/documentation_options.js?v=76c55136"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="The architecture of VOTCA" href="Architecture.html" />
<link rel="prev" title="Developer and Contributor Guide" href="DEVELOPERS_GUIDE.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html">
<img src="_static/customLogo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul>
<li class="toctree-l1"><a class="reference internal" href="INSTALL.html">Installation</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Manuals</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="tools/index.html">TOOLS Manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="csg/index.html">CSG Manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="xtp/XTP-MANUAL.html">XTP Manual</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="csg-tutorials/Tutorial.html">CSG Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="xtp-tutorials/XTP-TUTORIAL.html">XTP Tutorials</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="DEVELOPERS_GUIDE.html">Developer and Contributor Guide</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">VOTCA Internal Contributor Language Guide</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#types-and-ids">Types and Ids</a></li>
<li class="toctree-l2"><a class="reference internal" href="#units-in-votca">Units in VOTCA</a></li>
<li class="toctree-l2"><a class="reference internal" href="#indexing-in-votca">Indexing in VOTCA</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Architecture.html">The architecture of VOTCA</a></li>
<li class="toctree-l1"><a class="reference internal" href="xtp/Architecture.html">Architecture of votca-xtp</a></li>
<li class="toctree-l1"><a class="reference internal" href="CODE_OF_CONDUCT.html">Code of Conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="websiteAndDocumentation.html">Website and Documentation</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Community</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://github.com/votca">GitHub</a></li>
<li class="toctree-l1"><a class="reference external" href="https://twitter.com/votca_software">Twitter</a></li>
<li class="toctree-l1"><a class="reference external" href="https://groups.google.com/g/votca">Forum</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">VOTCA</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">VOTCA Internal Contributor Language Guide</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/VOTCA_LANGUAGE_GUIDE.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="votca-internal-contributor-language-guide">
<h1>VOTCA Internal Contributor Language Guide<a class="headerlink" href="#votca-internal-contributor-language-guide" title="Link to this heading">¶</a></h1>
<p>This language guide has been created to establish rules to keep VOTCA’s
code consistent between repositories. In the past, there has been
difficulty in translating functionality between repositories and within
the same repositories because different properties have been used to
describe the same object attribute. For general programming guidelines
look at the <a class="reference internal" href="DEVELOPERS_GUIDE.html"><span class="doc">Developers Guide</span></a></p>
<section id="types-and-ids">
<h2>Types and Ids<a class="headerlink" href="#types-and-ids" title="Link to this heading">¶</a></h2>
<p>As an example, consider the csg bead object which had at one time
contained the name, type and id attribute. The name of a bead is ill
defined and could be unique but was not guaranteed to be so.</p>
<p>If a bead were named C5 it was not clear if this was an arbitrary bead
name, or if it was the 5th carbon atom in the system. In any case the
name attribute is not needed because if a unique id is needed the id of
the bead could be used whereas if the type of the bead was needed the
type attribute could be used. As such, the name method and attribute has
been removed from the object.</p>
<p>As a general rule, objects should not have a name method or attribute
rather, any attribute that is not unique to an object should be
indicated with a type method and attribute.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="p">::</span><span class="n">string</span> <span class="n">getBeadType</span><span class="p">();</span>
<span class="n">std</span><span class="p">::</span><span class="n">string</span> <span class="n">getResidueType</span><span class="p">();</span>
</pre></div>
</div>
<p>To indicate a unique attribute an id should be used.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">int</span> <span class="n">getBeadId</span><span class="p">();</span>
<span class="nb">int</span> <span class="n">getMoleculeId</span><span class="p">();</span>
</pre></div>
</div>
</section>
<section id="units-in-votca">
<h2>Units in VOTCA<a class="headerlink" href="#units-in-votca" title="Link to this heading">¶</a></h2>
<p>VOTCA tried as much as possible to standardize units across both CSG and
XTP. Externally, we parse in the units of the respective file format,
e.g. <code class="docutils literal notranslate"><span class="pre">.xyz</span></code> <code class="docutils literal notranslate"><span class="pre">Angstrom</span></code>, <code class="docutils literal notranslate"><span class="pre">.gro</span></code> <code class="docutils literal notranslate"><span class="pre">nm</span></code>. Internally, we convert all
parsed units to:</p>
<ul class="simple">
<li><p>CSG: length <code class="docutils literal notranslate"><span class="pre">nm</span></code>, energy <code class="docutils literal notranslate"><span class="pre">kJ/mol</span></code> and time <code class="docutils literal notranslate"><span class="pre">ps</span></code></p></li>
<li><p>XTP: length <code class="docutils literal notranslate"><span class="pre">bohr</span></code>, energy <code class="docutils literal notranslate"><span class="pre">Hartree</span></code> and time <code class="docutils literal notranslate"><span class="pre">ps</span></code></p></li>
</ul>
</section>
<section id="indexing-in-votca">
<h2>Indexing in VOTCA<a class="headerlink" href="#indexing-in-votca" title="Link to this heading">¶</a></h2>
<p>All indices in VOTCA start at <code class="docutils literal notranslate"><span class="pre">0</span></code>. This is useful, because C++ arrays
start at index 0.</p>
<p>Apart from special cases all indices and integers in VOTCA should be
<code class="docutils literal notranslate"><span class="pre">votca::Index</span></code> which is a typedef for <code class="docutils literal notranslate"><span class="pre">long</span> <span class="pre">int</span></code>. <code class="docutils literal notranslate"><span class="pre">.size()</span></code>
methods of std::containers return an <code class="docutils literal notranslate"><span class="pre">unsigned</span> <span class="pre">long</span> <span class="pre">int</span></code> and should be
cast to <code class="docutils literal notranslate"><span class="pre">votca::Index</span></code>. i.e: <code class="docutils literal notranslate"><span class="pre">votca::Index(vector.size())</span></code></p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="DEVELOPERS_GUIDE.html" class="btn btn-neutral float-left" title="Developer and Contributor Guide" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="Architecture.html" class="btn btn-neutral float-right" title="The architecture of VOTCA" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2024, VOTCA Development Team.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>