1 /** @defgroup Vopot Vopot class 2 * @brief Potential oracle for Cartesian mesh data 3 */ 4 5 /** 6 * @file vopot.h 7 * @ingroup Vopot 8 * @author Nathan Baker 9 * @brief Potential oracle for Cartesian mesh data 10 * @version $Id$ 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 #ifndef _VOPOT_H_ 63 #define _VOPOT_H_ 64 65 #include "apbscfg.h" 66 67 #include "maloc/maloc.h" 68 69 #include "generic/vhal.h" 70 #include "generic/pbeparm.h" 71 #include "generic/vatom.h" 72 #include "generic/valist.h" 73 #include "generic/vunit.h" 74 #include "generic/vpbe.h" 75 #include "generic/pbeparm.h" 76 #include "mg/vmgrid.h" 77 78 /** 79 * @ingroup Vopot 80 * @author Nathan Baker 81 * @brief Electrostatic potential oracle for Cartesian mesh data 82 */ 83 struct sVopot { 84 85 Vmgrid *mgrid; /**< Multiple grid object containing potential data (in 86 * units kT/e) */ 87 Vpbe *pbe; /**< Pointer to PBE object */ 88 Vbcfl bcfl; /**< Boundary condition flag for returning potential 89 * values at points off the grid. */ 90 }; 91 92 /** 93 * @ingroup Vopot 94 * @brief Declaration of the Vopot class as the Vopot structure 95 */ 96 typedef struct sVopot Vopot; 97 98 /** @brief Construct Vopot object with values obtained from Vpmg_readDX (for 99 * example) 100 * @ingroup Vopot 101 * @author Nathan Baker 102 * @param mgrid Multiple grid object containing potential data (in units 103 * kT/e) 104 * @param pbe Pointer to Vpbe object for parameters 105 * @param bcfl Boundary condition to use for potential values off the grid 106 * @returns Newly allocated and initialized Vopot object 107 */ 108 VEXTERNC Vopot* Vopot_ctor(Vmgrid *mgrid, Vpbe *pbe, Vbcfl bcfl); 109 110 /** @brief Initialize Vopot object with values obtained from Vpmg_readDX (for 111 * example) 112 * @ingroup Vopot 113 * @author Nathan Baker 114 * @param thee Pointer to newly allocated Vopot object 115 * @param mgrid Multiple grid object containing potential data (in units 116 * kT/e) 117 * @param pbe Pointer to Vpbe object for parameters 118 * @param bcfl Boundary condition to use for potential values off the grid 119 * @returns 1 if successful, 0 otherwise 120 */ 121 VEXTERNC int Vopot_ctor2(Vopot *thee, Vmgrid *mgrid, Vpbe *pbe, Vbcfl bcfl); 122 123 /** @brief Get potential value (from mesh or approximation) at a point 124 * @ingroup Vopot 125 * @author Nathan Baker 126 * @param thee Vopot obejct 127 * @param x Point at which to evaluate potential 128 * @param pot Set to dimensionless potential (units kT/e) at point x 129 * @returns 1 if successful, 0 otherwise 130 */ 131 VEXTERNC int Vopot_pot(Vopot *thee, double x[3], double *pot); 132 133 /** @brief Object destructor 134 * @ingroup Vopot 135 * @author Nathan Baker 136 * @param thee Pointer to memory location of object to be destroyed 137 */ 138 VEXTERNC void Vopot_dtor(Vopot **thee); 139 140 /** @brief FORTRAN stub object destructor 141 * @ingroup Vopot 142 * @author Nathan Baker 143 * @param thee Pointer to object to be destroyed 144 */ 145 VEXTERNC void Vopot_dtor2(Vopot *thee); 146 147 /** @brief Get second derivative values at a point 148 * @ingroup Vopot 149 * @author Nathan Baker 150 * @param thee Pointer to Vopot object 151 * @param pt Location to evaluate second derivative 152 * @param cflag 153 * \li 0: Reduced Maximal Curvature 154 * \li 1: Mean Curvature (Laplace) 155 * \li 2: Gauss Curvature 156 * \li 3: True Maximal Curvature 157 * @param curv Set to specified curvature value 158 * @returns 1 if successful, 0 otherwise 159 */ 160 VEXTERNC int Vopot_curvature(Vopot *thee, double pt[3], int cflag, double 161 *curv); 162 163 /** @brief Get first derivative values at a point 164 * @ingroup Vopot 165 * @author Nathan Baker 166 * @param thee Pointer to Vopot object 167 * @param pt Location to evaluate gradient 168 * @param grad Gradient 169 * @returns 1 if successful, 0 otherwise 170 */ 171 VEXTERNC int Vopot_gradient(Vopot *thee, double pt[3], double grad[3] ); 172 173 174 #endif 175