NAMD
Main Page
Namespaces
Classes
Files
File List
File Members
ComputeDihedrals.inl
Go to the documentation of this file.
1
7
#ifndef COMPUTEDIHEDRALS_INL
8
#define COMPUTEDIHEDRALS_INL
9
10
#include "
ComputeDihedrals.h
"
11
12
inline
DihedralElem::DihedralElem
() { ; }
13
14
inline
DihedralElem::DihedralElem
(
AtomID
atom0,
const
TupleSignature
*sig,
const
DihedralValue
*v){
15
atomID
[0] = atom0;
16
atomID
[1] = atom0 + sig->
offset
[0];
17
atomID
[2] = atom0 + sig->
offset
[1];
18
atomID
[3] = atom0 + sig->
offset
[2];
19
value
= &v[sig->
tupleParamType
];
20
}
21
22
inline
DihedralElem::DihedralElem
(
const
Dihedral
*a,
const
DihedralValue
*v)
23
{
24
atomID
[0] = a->
atom1
;
25
atomID
[1] = a->
atom2
;
26
atomID
[2] = a->
atom3
;
27
atomID
[3] = a->
atom4
;
28
value
= &v[a->
dihedral_type
];
29
}
30
31
inline
DihedralElem::DihedralElem
(
AtomID
atom0,
AtomID
atom1,
32
AtomID
atom2,
AtomID
atom3)
33
{
34
if
(atom0 > atom3) {
// Swap end atoms so lowest is first!
35
AtomID
tmp = atom3; atom3 = atom0; atom0 = tmp;
36
tmp = atom1; atom1 = atom2; atom2 = tmp;
37
}
38
atomID
[0] = atom0;
39
atomID
[1] = atom1;
40
atomID
[2] = atom2;
41
atomID
[3] = atom3;
42
}
43
44
inline
int
DihedralElem::operator==
(
const
DihedralElem
&a)
const
45
{
46
return
(a.
atomID
[0] ==
atomID
[0] && a.
atomID
[1] ==
atomID
[1] &&
47
a.
atomID
[2] ==
atomID
[2] && a.
atomID
[3] ==
atomID
[3]);
48
}
49
50
inline
int
DihedralElem::operator<
(
const
DihedralElem
&a)
const
51
{
52
return
(
atomID
[0] < a.
atomID
[0] ||
53
(
atomID
[0] == a.
atomID
[0] &&
54
(
atomID
[1] < a.
atomID
[1] ||
55
(
atomID
[1] == a.
atomID
[1] &&
56
(
atomID
[2] < a.
atomID
[2] ||
57
(
atomID
[2] == a.
atomID
[2] &&
58
atomID
[3] < a.
atomID
[3]
59
))))));
60
}
61
62
#endif
63
AtomID
int AtomID
Definition:
NamdTypes.h:29
DihedralElem
Definition:
ComputeDihedrals.h:17
dihedral::atom3
int32 atom3
Definition:
structures.h:65
dihedral::atom4
int32 atom4
Definition:
structures.h:66
DihedralElem::value
const DihedralValue * value
Definition:
ComputeDihedrals.h:41
DihedralElem::operator<
int operator<(const DihedralElem &a) const
Definition:
ComputeDihedrals.inl:50
dihedral::dihedral_type
Index dihedral_type
Definition:
structures.h:67
DihedralElem::operator==
int operator==(const DihedralElem &a) const
Definition:
ComputeDihedrals.inl:44
DihedralElem::atomID
AtomID atomID[size]
Definition:
ComputeDihedrals.h:21
TupleSignature
Definition:
structures.h:192
ComputeDihedrals.h
dihedral
Definition:
structures.h:61
dihedral::atom2
int32 atom2
Definition:
structures.h:64
DihedralElem::DihedralElem
DihedralElem()
Definition:
ComputeDihedrals.inl:12
TupleSignature::tupleParamType
Index tupleParamType
Definition:
structures.h:202
DihedralValue
Definition:
Parameters.h:107
TupleSignature::offset
int * offset
Definition:
structures.h:198
dihedral::atom1
int32 atom1
Definition:
structures.h:63
Generated by
1.8.5