1 /** @defgroup APOLparm APOLparm class 2 * @brief Parameter structure for APOL-specific variables from input files 3 */ 4 5 /** 6 * @file femparm.h 7 * @ingroup APOLparm 8 * @brief Contains declarations for class APOLparm 9 * @version $Id$ 10 * @author Nathan A. Baker 11 * 12 * @attention 13 * @verbatim 14 * 15 * APBS -- Adaptive Poisson-Boltzmann Solver 16 * 17 * Nathan A. Baker (nathan.baker@pnnl.gov) 18 * Pacific Northwest National Laboratory 19 * 20 * Additional contributing authors listed in the code documentation. 21 * 22 * Copyright (c) 2010-2014 Battelle Memorial Institute. Developed at the 23 * Pacific Northwest National Laboratory, operated by Battelle Memorial 24 * Institute, Pacific Northwest Division for the U.S. Department of Energy. 25 * 26 * Portions Copyright (c) 2002-2010, Washington University in St. Louis. 27 * Portions Copyright (c) 2002-2010, Nathan A. Baker. 28 * Portions Copyright (c) 1999-2002, The Regents of the University of 29 * California. 30 * Portions Copyright (c) 1995, Michael Holst. 31 * All rights reserved. 32 * 33 * Redistribution and use in source and binary forms, with or without 34 * modification, are permitted provided that the following conditions are met: 35 * 36 * Redistributions of source code must retain the above copyright notice, this 37 * list of conditions and the following disclaimer. 38 * 39 * Redistributions in binary form must reproduce the above copyright notice, 40 * this list of conditions and the following disclaimer in the documentation 41 * and/or other materials provided with the distribution. 42 * 43 * Neither the name of the developer nor the names of its contributors may be 44 * used to endorse or promote products derived from this software without 45 * specific prior written permission. 46 * 47 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 48 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 49 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 50 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 51 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 52 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 53 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 54 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 55 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 56 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 57 * THE POSSIBILITY OF SUCH DAMAGE. 58 * 59 * @endverbatim 60 */ 61 62 63 #ifndef _APOLPARM_H_ 64 #define _APOLPARM_H_ 65 66 /* Generic header files */ 67 #include "apbscfg.h" 68 69 #include "maloc/maloc.h" 70 71 #include "generic/vhal.h" 72 #include "generic/vstring.h" 73 #include "generic/vparam.h" 74 75 /** 76 * @ingroup APOLparm 77 * @brief Define energy calculation enumeration 78 */ 79 enum eAPOLparm_calcEnergy { 80 ACE_NO=0, /**< Do not perform energy calculation */ 81 ACE_TOTAL=1, /**< Calculate total energy only */ 82 ACE_COMPS=2 /**< Calculate per-atom energy components */ 83 }; 84 85 /** 86 * @ingroup APOLparm 87 * @brief Define eAPOLparm_calcEnergy enumeration as APOLparm_calcEnergy 88 */ 89 typedef enum eAPOLparm_calcEnergy APOLparm_calcEnergy; 90 91 /** 92 * @ingroup APOLparm 93 * @brief Define force calculation enumeration 94 */ 95 enum eAPOLparm_calcForce { 96 ACF_NO=0, /**< Do not perform force calculation */ 97 ACF_TOTAL=1, /**< Calculate total force only */ 98 ACF_COMPS=2 /**< Calculate per-atom force components */ 99 }; 100 101 /** 102 * @ingroup APOLparm 103 * @brief Define eAPOLparm_calcForce enumeration as APOLparm_calcForce 104 */ 105 typedef enum eAPOLparm_calcForce APOLparm_calcForce; 106 107 /** 108 * @ingroup APOLparm 109 * @brief Define force calculation enumeration 110 */ 111 enum eAPOLparm_doCalc { 112 ACD_NO=0, /**< Do not perform calculation */ 113 ACD_YES=1, /**< Perform calculations */ 114 ACD_ERROR=2 /**< Error setting up calculation */ 115 }; 116 117 /** 118 * @ingroup APOLparm 119 * @brief Define eAPOLparm_calcForce enumeration as APOLparm_calcForce 120 */ 121 typedef enum eAPOLparm_doCalc APOLparm_doCalc; 122 123 124 /** 125 * @ingroup APOLparm 126 * @author David Gohara 127 * @brief Parameter structure for APOL-specific variables from input files 128 */ 129 struct sAPOLparm { 130 131 int parsed; /**< Flag: Has this structure been filled with anything other than the default values? (0 = no, 1 = yes) */ 132 133 double grid[3]; /**< Grid spacing */ 134 int setgrid; /**< Flag, @see grid */ 135 136 int molid; /**< Molecule ID to perform calculation on */ 137 int setmolid; /**< Flag, @see molid */ 138 139 double bconc; /**< Vacc sphere density */ 140 int setbconc; /**< Flag, @see bconc */ 141 142 double sdens; /**< Vacc sphere density */ 143 int setsdens; /**< Flag, @see sdens */ 144 145 double dpos; /**< Atom position offset */ 146 int setdpos; /**< Flag, @see dpos */ 147 148 double press; /**< Solvent pressure */ 149 int setpress; /**< Flag, @see press */ 150 151 Vsurf_Meth srfm; /**< Surface calculation method */ 152 int setsrfm; /**< Flag, @see srfm */ 153 154 double srad; /**< Solvent radius */ 155 int setsrad; /**< Flag, @see srad */ 156 157 double swin; /**< Cubic spline window */ 158 int setswin; /**< Flag, @see swin */ 159 160 double temp; /**< Temperature (in K) */ 161 int settemp; /**< Flag, @see temp */ 162 163 double gamma; /**< Surface tension for apolar energies/forces 164 * (in kJ/mol/A^2) */ 165 int setgamma; /**< Flag, @see gamma */ 166 167 APOLparm_calcEnergy calcenergy; /**< Energy calculation flag */ 168 int setcalcenergy; /**< Flag, @see calcenergy */ 169 170 APOLparm_calcForce calcforce; /**< Atomic forces calculation */ 171 int setcalcforce; /**< Flag, @see calcforce */ 172 173 double watsigma; /**< Water oxygen Lennard-Jones radius (A) */ 174 double watepsilon; /**< Water oxygen Lennard-Jones well depth (kJ/mol) */ 175 double sasa; /**< Solvent accessible surface area for this calculation */ 176 double sav; /**< Solvent accessible volume for this calculation */ 177 double wcaEnergy; /**< wcaEnergy */ 178 double totForce[3]; /**< Total forces on x, y, z */ 179 180 int setwat; /**< Boolean for determining if a water parameter 181 * is supplied. Yes = 1, No = 0 */ 182 }; 183 184 /** @typedef APOLparm 185 * @ingroup APOLparm 186 * @brief Declaration of the APOLparm class as the APOLparm structure 187 */ 188 typedef struct sAPOLparm APOLparm; 189 190 /* /////////////////////////////////////////////////////////////////////////// 191 // Class NOsh: Non-inlineable methods (nosh.c) 192 /////////////////////////////////////////////////////////////////////////// */ 193 194 /** @brief Construct APOLparm 195 * @ingroup APOLparm 196 * @author David Gohara 197 * @returns Newly allocated and initialized Vpmgp object 198 */ 199 VEXTERNC APOLparm* APOLparm_ctor(); 200 201 /** @brief FORTRAN stub to construct APOLparm 202 * @ingroup APOLparm 203 * @author David Gohara, Yong Huang 204 * @param thee Pointer to allocated APOLparm object 205 * @returns Success enumeration 206 */ 207 VEXTERNC Vrc_Codes APOLparm_ctor2(APOLparm *thee); 208 209 /** @brief Object destructor 210 * @ingroup APOLparm 211 * @author David Gohara 212 * @param thee Pointer to memory location of APOLparm object 213 */ 214 VEXTERNC void APOLparm_dtor(APOLparm **thee); 215 216 /** @brief FORTRAN stub for object destructor 217 * @ingroup APOLparm 218 * @author David Gohara 219 * @param thee Pointer to APOLparm object 220 */ 221 VEXTERNC void APOLparm_dtor2(APOLparm *thee); 222 223 /** 224 * @brief Consistency check for parameter values stored in object 225 * @ingroup APOLparm 226 * @author David Gohara, Yong Huang 227 * @param thee APOLparm object 228 * @returns Success enumeration 229 */ 230 VEXTERNC Vrc_Codes APOLparm_check(APOLparm *thee); 231 232 /** @brief Copy target object into thee 233 @ingroup APOLparm 234 @author Nathan Baker 235 @param thee Destination object 236 @param source Source object 237 */ 238 VEXTERNC void APOLparm_copy(APOLparm *thee, APOLparm *source); 239 240 /** 241 * @brief Parse an MG keyword from an input file 242 * @ingroup MGparm 243 * @author David Gohara 244 * @param thee MGparm object 245 * @param tok Token to parse 246 * @param sock Stream for more tokens 247 * @returns Success enumeration (1 if matched and assigned; -1 if matched, but there's 248 * some sort of error (i.e., too few args); 0 if not matched) 249 */ 250 VEXTERNC Vrc_Codes APOLparm_parseToken(APOLparm *thee, char tok[VMAX_BUFSIZE], 251 Vio *sock); 252 253 #endif 254 255