Go to the documentation of this file.00001
00049 #include "apbscfg.h"
00050 #include "apbs/vatom.h"
00051
00052 VEMBED(rcsid="$Id: vatom.c 1552 2010-02-10 17:46:27Z yhuang01 $")
00053
00054 #if !defined(VINLINE_VATOM)
00055
00056 VPUBLIC double *Vatom_getPosition(Vatom *thee) {
00057
00058 VASSERT(thee != VNULL);
00059 return thee->position;
00060
00061 }
00062
00063 VPUBLIC double Vatom_getPartID(Vatom *thee) {
00064
00065 VASSERT(thee != VNULL);
00066 return thee->partID;
00067
00068 }
00069
00070 VPUBLIC void Vatom_setPartID(Vatom *thee, int partID) {
00071
00072 VASSERT(thee != VNULL);
00073 thee->partID = (double)partID;
00074
00075 }
00076
00077 VPUBLIC double Vatom_getAtomID(Vatom *thee) {
00078
00079 VASSERT(thee != VNULL);
00080 return thee->atomID;
00081
00082 }
00083
00084 VPUBLIC void Vatom_setAtomID(Vatom *thee, int atomID) {
00085
00086 VASSERT(thee != VNULL);
00087 thee->atomID = atomID;
00088
00089 }
00090
00091 VPUBLIC void Vatom_setRadius(Vatom *thee, double radius) {
00092
00093 VASSERT(thee != VNULL);
00094 thee->radius = radius;
00095
00096 }
00097
00098 VPUBLIC double Vatom_getRadius(Vatom *thee) {
00099
00100 VASSERT(thee != VNULL);
00101 return thee->radius;
00102
00103 }
00104
00105 VPUBLIC void Vatom_setCharge(Vatom *thee, double charge) {
00106
00107 VASSERT(thee != VNULL);
00108 thee->charge = charge;
00109
00110 }
00111
00112 VPUBLIC double Vatom_getCharge(Vatom *thee) {
00113
00114 VASSERT(thee != VNULL);
00115 return thee->charge;
00116
00117 }
00118
00119 VPUBLIC unsigned long int Vatom_memChk(Vatom *thee) { return sizeof(Vatom); }
00120
00121 #endif
00122
00123 VPUBLIC Vatom* Vatom_ctor() {
00124
00125
00126 Vatom *thee = VNULL;
00127 thee = (Vatom *)Vmem_malloc( VNULL, 1, sizeof(Vatom) );
00128 VASSERT( thee != VNULL);
00129 VASSERT( Vatom_ctor2(thee));
00130
00131 return thee;
00132 }
00133
00134 VPUBLIC int Vatom_ctor2(Vatom *thee) {
00135 thee->partID = -1;
00136 return 1;
00137 }
00138
00139 VPUBLIC void Vatom_dtor(Vatom **thee) {
00140 if ((*thee) != VNULL) {
00141 Vatom_dtor2(*thee);
00142 Vmem_free(VNULL, 1, sizeof(Vatom), (void **)thee);
00143 (*thee) = VNULL;
00144 }
00145 }
00146
00147 VPUBLIC void Vatom_dtor2(Vatom *thee) { ; }
00148
00149 VPUBLIC void Vatom_setPosition(Vatom *thee, double position[3]) {
00150
00151 VASSERT(thee != VNULL);
00152 (thee->position)[0] = position[0];
00153 (thee->position)[1] = position[1];
00154 (thee->position)[2] = position[2];
00155
00156 }
00157
00158 VPUBLIC void Vatom_copyTo(Vatom *thee, Vatom *dest) {
00159
00160 VASSERT(thee != VNULL);
00161 VASSERT(dest != VNULL);
00162
00163 memcpy(dest, thee, sizeof(Vatom));
00164
00165 }
00166
00167 VPUBLIC void Vatom_copyFrom(Vatom *thee, Vatom *src) {
00168
00169 Vatom_copyTo(src, thee);
00170
00171 }
00172
00173 VPUBLIC void Vatom_setResName(Vatom *thee, char resName[VMAX_RECLEN]) {
00174
00175 VASSERT(thee != VNULL);
00176 strcpy(thee->resName, resName);
00177
00178 }
00179
00180 VPUBLIC void Vatom_getResName(Vatom *thee, char resName[VMAX_RECLEN]) {
00181
00182
00183 VASSERT(thee != VNULL);
00184 strcpy(resName,thee->resName);
00185
00186 }
00187
00188 VPUBLIC void Vatom_setAtomName(Vatom *thee, char atomName[VMAX_RECLEN]) {
00189
00190 VASSERT(thee != VNULL);
00191 strcpy(thee->atomName, atomName);
00192
00193 }
00194
00195 VPUBLIC void Vatom_getAtomName(Vatom *thee, char atomName[VMAX_RECLEN]) {
00196
00197 VASSERT(thee != VNULL);
00198 strcpy(atomName,thee->atomName);
00199
00200 }
00201
00202 #if defined(WITH_TINKER)
00203
00204 VPUBLIC void Vatom_setDipole(Vatom *thee, double dipole[3]) {
00205
00206 VASSERT(thee != VNULL);
00207 (thee->dipole)[0] = dipole[0];
00208 (thee->dipole)[1] = dipole[1];
00209 (thee->dipole)[2] = dipole[2];
00210
00211 }
00212
00213 VPUBLIC void Vatom_setQuadrupole(Vatom *thee, double quadrupole[9]) {
00214
00215 int i;
00216 VASSERT(thee != VNULL);
00217 for (i=0; i<9; i++) (thee->quadrupole)[i] = quadrupole[i];
00218 }
00219
00220 VPUBLIC void Vatom_setInducedDipole(Vatom *thee, double dipole[3]) {
00221
00222 VASSERT(thee != VNULL);
00223 (thee->inducedDipole)[0] = dipole[0];
00224 (thee->inducedDipole)[1] = dipole[1];
00225 (thee->inducedDipole)[2] = dipole[2];
00226 }
00227
00228 VPUBLIC void Vatom_setNLInducedDipole(Vatom *thee, double dipole[3]) {
00229
00230 VASSERT(thee != VNULL);
00231 (thee->nlInducedDipole)[0] = dipole[0];
00232 (thee->nlInducedDipole)[1] = dipole[1];
00233 (thee->nlInducedDipole)[2] = dipole[2];
00234
00235 }
00236
00237 VPUBLIC double *Vatom_getDipole(Vatom *thee) {
00238
00239 VASSERT(thee != VNULL);
00240 return thee->dipole;
00241
00242 }
00243
00244 VPUBLIC double *Vatom_getQuadrupole(Vatom *thee) {
00245
00246 VASSERT(thee != VNULL);
00247 return thee->quadrupole;
00248
00249 }
00250
00251 VPUBLIC double *Vatom_getInducedDipole(Vatom *thee) {
00252
00253 VASSERT(thee != VNULL);
00254 return thee->inducedDipole;
00255
00256 }
00257
00258 VPUBLIC double *Vatom_getNLInducedDipole(Vatom *thee) {
00259
00260 VASSERT(thee != VNULL);
00261 return thee->nlInducedDipole;
00262
00263 }
00264
00265 #endif