00001 00057 #ifndef _VPMG_H_ 00058 #define _VPMG_H_ 00059 00060 /* Generic headers */ 00061 #include "maloc/maloc.h" 00062 #include "apbs/vhal.h" 00063 00064 /* Headers specific to this file */ 00065 #include "apbs/vpmgp.h" 00066 #include "apbs/vacc.h" 00067 #include "apbs/vcap.h" 00068 #include "apbs/vpbe.h" 00069 #include "apbs/vgrid.h" 00070 #include "apbs/mgparm.h" 00071 #include "apbs/pbeparm.h" 00072 00077 #define VPMGMAXPART 2000 00078 00088 struct sVpmg { 00089 00090 Vmem *vmem; 00091 Vpmgp *pmgp; 00092 Vpbe *pbe; 00094 double *epsx; 00095 double *epsy; 00096 double *epsz; 00097 double *kappa; 00098 double *pot; 00099 double *charge; 00101 int *iparm; 00102 double *rparm; 00103 int *iwork; 00104 double *rwork; 00105 double *a1cf; 00107 double *a2cf; 00109 double *a3cf; 00111 double *ccf; 00112 double *fcf; 00113 double *tcf; 00114 double *u; 00115 double *xf; 00116 double *yf; 00117 double *zf; 00118 double *gxcf; 00119 double *gycf; 00120 double *gzcf; 00121 double *pvec; 00122 double extDiEnergy; 00124 double extQmEnergy; 00126 double extQfEnergy; 00128 double extNpEnergy; 00130 Vsurf_Meth surfMeth; 00131 double splineWin; 00132 Vchrg_Meth chargeMeth; 00133 Vchrg_Src chargeSrc; 00135 int filled; 00137 int useDielXMap; 00139 Vgrid *dielXMap; 00140 int useDielYMap; 00142 Vgrid *dielYMap; 00143 int useDielZMap; 00145 Vgrid *dielZMap; 00146 int useKappaMap; 00148 Vgrid *kappaMap; 00149 int usePotMap; 00151 Vgrid *potMap; 00153 int useChargeMap; 00155 Vgrid *chargeMap; 00156 }; 00157 00162 typedef struct sVpmg Vpmg; 00163 00164 /* ///////////////////////////////////////////////////////////////////////// 00167 #if !defined(VINLINE_VPMG) 00168 00175 VEXTERNC unsigned long int Vpmg_memChk( 00176 Vpmg *thee 00177 ); 00178 00179 #else /* if defined(VINLINE_VPMG) */ 00180 00181 # define Vpmg_memChk(thee) (Vmem_bytes((thee)->vmem)) 00182 00183 #endif /* if !defined(VINLINE_VPMG) */ 00184 00185 /* ///////////////////////////////////////////////////////////////////////// 00188 00193 VEXTERNC Vpmg* Vpmg_ctor( 00194 Vpmgp *parms, 00195 Vpbe *pbe, 00196 int focusFlag, 00197 Vpmg *pmgOLD, 00198 MGparm *mgparm, 00199 PBEparm_calcEnergy energyFlag 00200 ); 00201 00209 VEXTERNC int Vpmg_ctor2( 00210 Vpmg *thee, 00211 Vpmgp *parms, 00212 Vpbe *pbe, 00213 int focusFlag, 00214 Vpmg *pmgOLD, 00216 MGparm *mgparm, 00218 PBEparm_calcEnergy energyFlag 00221 ); 00222 00227 VEXTERNC void Vpmg_dtor( 00228 Vpmg **thee 00230 ); 00231 00236 VEXTERNC void Vpmg_dtor2( 00237 Vpmg *thee 00238 ); 00239 00245 VEXTERNC int Vpmg_fillco( 00246 Vpmg *thee, 00247 Vsurf_Meth surfMeth, 00248 double splineWin, 00250 Vchrg_Meth chargeMeth, 00251 int useDielXMap, 00252 Vgrid *dielXMap, 00253 int useDielYMap, 00254 Vgrid *dielYMap, 00255 int useDielZMap, 00256 Vgrid *dielZMap, 00257 int useKappaMap, 00258 Vgrid *kappaMap, 00259 int usePotMap, 00260 Vgrid *potMap, 00261 int useChargeMap, 00262 Vgrid *chargeMap 00263 ); 00264 00270 VEXTERNC int Vpmg_solve( 00271 Vpmg *thee 00272 ); 00273 00285 VEXTERNC int Vpmg_solveLaplace( 00286 Vpmg *thee 00287 ); 00288 00298 VEXTERNC double Vpmg_energy( 00299 Vpmg *thee, 00300 int extFlag 00304 ); 00305 00323 VEXTERNC double Vpmg_qfEnergy( 00324 Vpmg *thee, 00325 int extFlag 00329 ); 00330 00350 VEXTERNC double Vpmg_qfAtomEnergy( 00351 Vpmg *thee, 00352 Vatom *atom 00353 ); 00354 00379 VEXTERNC double Vpmg_qmEnergy( 00380 Vpmg *thee, 00381 int extFlag 00385 ); 00386 00387 00406 VEXTERNC double Vpmg_dielEnergy( 00407 Vpmg *thee, 00408 int extFlag 00412 ); 00413 00414 00431 VEXTERNC double Vpmg_dielGradNorm( 00432 Vpmg *thee 00433 ); 00434 00446 VEXTERNC int Vpmg_force( 00447 Vpmg *thee, 00448 double *force, 00450 int atomID, 00451 Vsurf_Meth srfm, 00452 Vchrg_Meth chgm 00453 ); 00454 00466 VEXTERNC int Vpmg_qfForce( 00467 Vpmg *thee, 00468 double *force, 00470 int atomID, 00471 Vchrg_Meth chgm 00472 ); 00473 00485 VEXTERNC int Vpmg_dbForce( 00486 Vpmg *thee, 00487 double *dbForce, 00489 int atomID, 00490 Vsurf_Meth srfm 00491 ); 00492 00504 VEXTERNC int Vpmg_ibForce( 00505 Vpmg *thee, 00506 double *force, 00508 int atomID, 00509 Vsurf_Meth srfm 00510 ); 00511 00517 VEXTERNC void Vpmg_setPart( 00518 Vpmg *thee, 00519 double lowerCorner[3], 00520 double upperCorner[3], 00521 int bflags[6] 00525 ); 00526 00531 VEXTERNC void Vpmg_unsetPart( 00532 Vpmg *thee 00533 ); 00534 00540 VEXTERNC int Vpmg_fillArray( 00541 Vpmg *thee, 00542 double *vec, 00544 Vdata_Type type, 00545 double parm, 00546 Vhal_PBEType pbetype, 00547 PBEparm * pbeparm 00548 ); 00549 00555 VPUBLIC void Vpmg_fieldSpline4( 00556 Vpmg *thee, 00557 int atomID, 00558 double field[3] 00559 ); 00560 00568 VEXTERNC double Vpmg_qfPermanentMultipoleEnergy( 00569 Vpmg *thee, 00570 int atomID 00571 ); 00572 00578 VEXTERNC void Vpmg_qfPermanentMultipoleForce( 00579 Vpmg *thee, 00580 int atomID, 00581 double force[3], 00582 double torque[3] 00583 ); 00584 00589 VEXTERNC void Vpmg_ibPermanentMultipoleForce( 00590 Vpmg *thee, 00591 int atomID, 00592 double force[3] 00593 ); 00594 00599 VEXTERNC void Vpmg_dbPermanentMultipoleForce( 00600 Vpmg *thee, 00601 int atomID, 00602 double force[3] 00603 ); 00604 00611 VEXTERNC void Vpmg_qfDirectPolForce( 00612 Vpmg *thee, 00613 Vgrid *perm, 00614 Vgrid *induced, 00615 int atomID, 00616 double force[3], 00617 double torque[3] 00618 ); 00619 00628 VEXTERNC void Vpmg_qfNLDirectPolForce( 00629 Vpmg *thee, 00630 Vgrid *perm, 00631 Vgrid *nlInduced, 00632 int atomID, 00633 double force[3], 00634 double torque[3] 00635 ); 00636 00644 VEXTERNC void Vpmg_ibDirectPolForce( 00645 Vpmg *thee, 00646 Vgrid *perm, 00647 Vgrid *induced, 00648 int atomID, 00649 double force[3] 00650 ); 00651 00660 VEXTERNC void Vpmg_ibNLDirectPolForce( 00661 Vpmg *thee, 00662 Vgrid *perm, 00663 Vgrid *nlInduced, 00664 int atomID, 00665 double force[3] 00666 ); 00667 00675 VEXTERNC void Vpmg_dbDirectPolForce( 00676 Vpmg *thee, 00677 Vgrid *perm, 00678 Vgrid *induced, 00679 int atomID, 00680 double force[3] 00681 ); 00682 00691 VEXTERNC void Vpmg_dbNLDirectPolForce( 00692 Vpmg *thee, 00693 Vgrid *perm, 00694 Vgrid *nlInduced, 00695 int atomID, 00696 double force[3] 00697 ); 00698 00705 VEXTERNC void Vpmg_qfMutualPolForce( 00706 Vpmg *thee, 00707 Vgrid *induced, 00708 Vgrid *nlInduced, 00709 int atomID, 00710 double force[3] 00711 ); 00712 00720 VEXTERNC void Vpmg_ibMutualPolForce( 00721 Vpmg *thee, 00722 Vgrid *induced, 00723 Vgrid *nlInduced, 00724 int atomID, 00725 double force[3] 00726 ); 00727 00735 VEXTERNC void Vpmg_dbMutualPolForce( 00736 Vpmg *thee, 00737 Vgrid *induced, 00738 Vgrid *nlInduced, 00739 int atomID, 00740 double force[3] 00741 ); 00742 00749 VEXTERNC void Vpmg_printColComp( 00750 Vpmg *thee, 00751 char path[72], 00752 char title[72], 00753 char mxtype[3], 00761 int flag 00765 ); 00766 00767 #endif /* ifndef _VPMG_H_ */ 00768