APBS 3.0.0
Loading...
Searching...
No Matches
vatom.c
Go to the documentation of this file.
1
57#include "vatom.h"
58
59VEMBED(rcsid="$Id$")
60
61#if !defined(VINLINE_VATOM)
62
63VPUBLIC double *Vatom_getPosition(Vatom *thee) {
64
65 VASSERT(thee != VNULL);
66 return thee->position;
67
68}
69
70VPUBLIC double Vatom_getPartID(Vatom *thee) {
71
72 VASSERT(thee != VNULL);
73 return thee->partID;
74
75}
76
77VPUBLIC void Vatom_setPartID(Vatom *thee, int partID) {
78
79 VASSERT(thee != VNULL);
80 thee->partID = (double)partID;
81
82}
83
84VPUBLIC double Vatom_getAtomID(Vatom *thee) {
85
86 VASSERT(thee != VNULL);
87 return thee->id;
88
89}
90
91VPUBLIC void Vatom_setAtomID(Vatom *thee, int atomID) {
92
93 VASSERT(thee != VNULL);
94 thee->id = atomID;
95
96}
97
98VPUBLIC void Vatom_setRadius(Vatom *thee, double radius) {
99
100 VASSERT(thee != VNULL);
101 thee->radius = radius;
102
103}
104
105VPUBLIC double Vatom_getRadius(Vatom *thee) {
106
107 VASSERT(thee != VNULL);
108 return thee->radius;
109
110}
111
112VPUBLIC void Vatom_setCharge(Vatom *thee, double charge) {
113
114 VASSERT(thee != VNULL);
115 thee->charge = charge;
116
117}
118
119VPUBLIC double Vatom_getCharge(Vatom *thee) {
120
121 VASSERT(thee != VNULL);
122 return thee->charge;
123
124}
125
126VPUBLIC void Vatom_setEpsilon(Vatom *thee, double epsilon) {
127
128 VASSERT(thee != VNULL);
129 thee->epsilon = epsilon;
130}
131
132VPUBLIC double Vatom_getEpsilon(Vatom *thee) {
133
134 VASSERT(thee != VNULL);
135 return thee->epsilon;
136}
137
138VPUBLIC unsigned long int Vatom_memChk(Vatom *thee) { return sizeof(Vatom); }
139
140#endif /* if !defined(VINLINE_VATOM) */
141
142VPUBLIC Vatom* Vatom_ctor() {
143
144 /* Set up the structure */
145 Vatom *thee = VNULL;
146 thee = (Vatom *)Vmem_malloc( VNULL, 1, sizeof(Vatom) );
147 VASSERT( thee != VNULL);
148 VASSERT( Vatom_ctor2(thee));
149
150 return thee;
151}
152
153VPUBLIC int Vatom_ctor2(Vatom *thee) {
154 thee->partID = -1;
155 return 1;
156}
157
158VPUBLIC void Vatom_dtor(Vatom **thee) {
159 if ((*thee) != VNULL) {
160 Vatom_dtor2(*thee);
161 Vmem_free(VNULL, 1, sizeof(Vatom), (void **)thee);
162 (*thee) = VNULL;
163 }
164}
165
166VPUBLIC void Vatom_dtor2(Vatom *thee) { ; }
167
168VPUBLIC void Vatom_setPosition(Vatom *thee, double position[3]) {
169
170 VASSERT(thee != VNULL);
171 (thee->position)[0] = position[0];
172 (thee->position)[1] = position[1];
173 (thee->position)[2] = position[2];
174
175}
176
177VPUBLIC void Vatom_copyTo(Vatom *thee, Vatom *dest) {
178
179 VASSERT(thee != VNULL);
180 VASSERT(dest != VNULL);
181
182 memcpy(dest, thee, sizeof(Vatom));
183
184}
185
186VPUBLIC void Vatom_copyFrom(Vatom *thee, Vatom *src) {
187
188 Vatom_copyTo(src, thee);
189
190}
191
192VPUBLIC void Vatom_setResName(Vatom *thee, char resName[VMAX_RECLEN]) {
193
194 VASSERT(thee != VNULL);
195 strcpy(thee->resName, resName);
196
197}
198
199VPUBLIC void Vatom_getResName(Vatom *thee, char resName[VMAX_RECLEN]) {
200
201
202 VASSERT(thee != VNULL);
203 strcpy(resName,thee->resName);
204
205}
206
207VPUBLIC void Vatom_setAtomName(Vatom *thee, char atomName[VMAX_RECLEN]) {
208
209 VASSERT(thee != VNULL);
210 strcpy(thee->atomName, atomName);
211
212}
213
214VPUBLIC void Vatom_getAtomName(Vatom *thee, char atomName[VMAX_RECLEN]) {
215
216 VASSERT(thee != VNULL);
217 strcpy(atomName,thee->atomName);
218
219}
220
221#if defined(WITH_TINKER)
222
223VPUBLIC void Vatom_setDipole(Vatom *thee, double dipole[3]) {
224
225 VASSERT(thee != VNULL);
226 (thee->dipole)[0] = dipole[0];
227 (thee->dipole)[1] = dipole[1];
228 (thee->dipole)[2] = dipole[2];
229
230}
231
232VPUBLIC void Vatom_setQuadrupole(Vatom *thee, double quadrupole[9]) {
233
234 int i;
235 VASSERT(thee != VNULL);
236 for (i=0; i<9; i++) (thee->quadrupole)[i] = quadrupole[i];
237}
238
239VPUBLIC void Vatom_setInducedDipole(Vatom *thee, double dipole[3]) {
240
241 VASSERT(thee != VNULL);
242 (thee->inducedDipole)[0] = dipole[0];
243 (thee->inducedDipole)[1] = dipole[1];
244 (thee->inducedDipole)[2] = dipole[2];
245}
246
247VPUBLIC void Vatom_setNLInducedDipole(Vatom *thee, double dipole[3]) {
248
249 VASSERT(thee != VNULL);
250 (thee->nlInducedDipole)[0] = dipole[0];
251 (thee->nlInducedDipole)[1] = dipole[1];
252 (thee->nlInducedDipole)[2] = dipole[2];
253
254}
255
256VPUBLIC double *Vatom_getDipole(Vatom *thee) {
257
258 VASSERT(thee != VNULL);
259 return thee->dipole;
260
261}
262
263VPUBLIC double *Vatom_getQuadrupole(Vatom *thee) {
264
265 VASSERT(thee != VNULL);
266 return thee->quadrupole;
267
268}
269
270VPUBLIC double *Vatom_getInducedDipole(Vatom *thee) {
271
272 VASSERT(thee != VNULL);
273 return thee->inducedDipole;
274
275}
276
277VPUBLIC double *Vatom_getNLInducedDipole(Vatom *thee) {
278
279 VASSERT(thee != VNULL);
280 return thee->nlInducedDipole;
281
282}
283
284#endif /* if defined(WITH_TINKER) */
VPUBLIC double Vatom_getAtomID(Vatom *thee)
Get atom ID.
Definition vatom.c:84
VPUBLIC void Vatom_setRadius(Vatom *thee, double radius)
Set atomic radius.
Definition vatom.c:98
VPUBLIC double Vatom_getPartID(Vatom *thee)
Get partition ID.
Definition vatom.c:70
VPUBLIC void Vatom_setPosition(Vatom *thee, double position[3])
Set the atomic position.
Definition vatom.c:168
VPUBLIC void Vatom_setEpsilon(Vatom *thee, double epsilon)
Set atomic epsilon.
Definition vatom.c:126
VPUBLIC void Vatom_setAtomName(Vatom *thee, char atomName[VMAX_RECLEN])
Set atom name.
Definition vatom.c:207
VPUBLIC void Vatom_getResName(Vatom *thee, char resName[VMAX_RECLEN])
Retrieve residue name.
Definition vatom.c:199
VPUBLIC void Vatom_setCharge(Vatom *thee, double charge)
Set atomic charge.
Definition vatom.c:112
VPUBLIC unsigned long int Vatom_memChk(Vatom *thee)
Return the memory used by this structure (and its contents) in bytes.
Definition vatom.c:138
VPUBLIC int Vatom_ctor2(Vatom *thee)
FORTRAN stub constructor for the Vatom class.
Definition vatom.c:153
VPUBLIC void Vatom_dtor(Vatom **thee)
Object destructor.
Definition vatom.c:158
VPUBLIC double Vatom_getEpsilon(Vatom *thee)
Get atomic epsilon.
Definition vatom.c:132
VPUBLIC double Vatom_getRadius(Vatom *thee)
Get atomic position.
Definition vatom.c:105
VPUBLIC void Vatom_copyTo(Vatom *thee, Vatom *dest)
Copy information to another atom.
Definition vatom.c:177
VPUBLIC void Vatom_setResName(Vatom *thee, char resName[VMAX_RECLEN])
Set residue name.
Definition vatom.c:192
VPUBLIC Vatom * Vatom_ctor()
Constructor for the Vatom class.
Definition vatom.c:142
VPUBLIC double * Vatom_getPosition(Vatom *thee)
Get atomic position.
Definition vatom.c:63
struct sVatom Vatom
Declaration of the Vatom class as the Vatom structure.
Definition vatom.h:114
VPUBLIC void Vatom_getAtomName(Vatom *thee, char atomName[VMAX_RECLEN])
Retrieve atom name.
Definition vatom.c:214
#define VMAX_RECLEN
Residue name length.
Definition vatom.h:77
VPUBLIC double Vatom_getCharge(Vatom *thee)
Get atomic charge.
Definition vatom.c:119
VPUBLIC void Vatom_setPartID(Vatom *thee, int partID)
Set partition ID.
Definition vatom.c:77
VPUBLIC void Vatom_dtor2(Vatom *thee)
FORTRAN stub object destructor.
Definition vatom.c:166
VPUBLIC void Vatom_setAtomID(Vatom *thee, int atomID)
Set atom ID.
Definition vatom.c:91
VPUBLIC void Vatom_copyFrom(Vatom *thee, Vatom *src)
Copy information to another atom.
Definition vatom.c:186
#define VEMBED(rctag)
Allows embedding of RCS ID tags in object files.
Definition vhal.h:556
Contains public data members for Vatom class/module.
Definition vatom.h:84
char resName[VMAX_RECLEN]
Definition vatom.h:97
double radius
Definition vatom.h:87
double epsilon
Definition vatom.h:91
int id
Definition vatom.h:93
double position[3]
Definition vatom.h:86
double charge
Definition vatom.h:88
double partID
Definition vatom.h:89
char atomName[VMAX_RECLEN]
Definition vatom.h:98
Contains declarations for class Vatom.