|
funkalicious 0.1
|
00001 /* 00002 *Gets the potential from a 1D charge density through a number of methods 00003 00004 Copyright (C) 2010 Joseph Pingenot 00005 00006 This program is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU Affero General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU Affero General Public License for more details. 00015 00016 You should have received a copy of the GNU Affero General Public License 00017 along with this program. If not, see <http://www.gnu.org/licenses/>. 00018 00019 00020 */ 00021 00022 #ifndef ___POTENTIAL_1D_H___ 00023 #define ___POTENTIAL_1D_H___ 00024 00025 #ifdef __cplusplus 00026 extern "C" { 00027 #endif 00028 00029 #include <glib-2.0/glib.h> 00030 #include <libpostproc/density_1d.h> 00031 00032 enum density_1d_potential_calculation_method { 00033 INTEGRATION_METHOD_NP, 00034 INTEGRATION_METHOD_PN 00035 }; 00036 00037 /**Gets the 1D potential from a 1D charge density. 00038 *\param charge_density the charge density (C/m^-3) 00039 *\param epsilon dielectric constant across the structure 00040 *\param method method to use to calculate the potential 00041 *\param err pointer to a pointer to a GError to store the routine's error information, if any 00042 *\return density_1d* the potential, or NULL if an error occurred 00043 */ 00044 struct density_1d* potential_1d_get_potential(double const_efield, double const_background, struct density_1d* charge_density, struct density_1d* epsilon, enum density_1d_potential_calculation_method method, double* max_pot_int_err, double* max_efield_int_err, double relerr, double abserr, GError **err); 00045 00046 /**Gets the 1D displacement field from a 1D charge density. 00047 *\param charge_density the charge density (C/m^-3) 00048 *\param direction 0 to go negative-positive; 1 to go positive-negative 00049 *\param err pointer to a pointer to a GError to store the routine's error information, if any 00050 *\return density_1d* the potential, or NULL if an error occurred 00051 */ 00052 00053 00054 struct density_1d* potential_1d_get_dfield_integrate(double const_background,const struct density_1d* charge_density, short int direction_pn, double* max_int_err, double relerr, double abserr, GError **err); 00055 00056 struct density_1d* potential_1d_get_potential_integrate(double dfield_background, double pot_background, const struct density_1d* charge_density, const struct density_1d* epsilon, short int direction_pn, double* max_pot_int_err, double* max_dfield_int_error, double relerr, double abserr, GError **err); 00057 00058 struct density_1d* potential_1d_get_potential_from_dfield(double background, const struct density_1d* Dfield, const struct density_1d* epsilon, short int direction_pn, double* max_int_err, double relerr, double abserr, GError **err); 00059 00060 00061 00062 #ifdef __cplusplus 00063 } 00064 #endif 00065 00066 #endif