FEtk master class (interface between FEtk and APBS). More...
Data Structures | |
struct | sVfetk |
Contains public data members for Vfetk class/module. More... | |
struct | sVfetk_LocalVar |
Vfetk LocalVar subclass. More... | |
Files | |
file | vfetk.h |
Contains declarations for class Vfetk. | |
file | vfetk.c |
Class Vfetk methods. | |
Defines | |
#define | VRINGMAX 1000 |
Maximum number of simplices in a simplex ring. | |
#define | VATOMMAX 1000000 |
Maximum number of atoms associated with a vertex. | |
Typedefs | |
typedef enum eVfetk_LsolvType | Vfetk_LsolvType |
Declare FEMparm_LsolvType type. | |
typedef enum eVfetk_MeshLoad | Vfetk_MeshLoad |
Declare FEMparm_GuessType type. | |
typedef enum eVfetk_NsolvType | Vfetk_NsolvType |
Declare FEMparm_NsolvType type. | |
typedef enum eVfetk_GuessType | Vfetk_GuessType |
Declare FEMparm_GuessType type. | |
typedef enum eVfetk_PrecType | Vfetk_PrecType |
Declare FEMparm_GuessType type. | |
typedef struct sVfetk_LocalVar | Vfetk_LocalVar |
Declaration of the Vfetk_LocalVar subclass as the Vfetk_LocalVar structure. | |
typedef struct sVfetk | Vfetk |
Declaration of the Vfetk class as the Vfetk structure. | |
Enumerations | |
enum | eVfetk_LsolvType { VLT_SLU = 0, VLT_MG = 1, VLT_CG = 2, VLT_BCG = 3 } |
Linear solver type. More... | |
enum | eVfetk_MeshLoad { VML_DIRICUBE, VML_NEUMCUBE, VML_EXTERNAL } |
Mesh loading operation. More... | |
enum | eVfetk_NsolvType { VNT_NEW = 0, VNT_INC = 1, VNT_ARC = 2 } |
Non-linear solver type. More... | |
enum | eVfetk_GuessType { VGT_ZERO = 0, VGT_DIRI = 1, VGT_PREV = 2 } |
Initial guess type. More... | |
enum | eVfetk_PrecType { VPT_IDEN = 0, VPT_DIAG = 1, VPT_MG = 2 } |
Preconditioner type. More... | |
Functions | |
Gem * | Vfetk_getGem (Vfetk *thee) |
Get a pointer to the Gem (grid manager) object. | |
AM * | Vfetk_getAM (Vfetk *thee) |
Get a pointer to the AM (algebra manager) object. | |
Vpbe * | Vfetk_getVpbe (Vfetk *thee) |
Get a pointer to the Vpbe (PBE manager) object. | |
Vcsm * | Vfetk_getVcsm (Vfetk *thee) |
Get a pointer to the Vcsm (charge-simplex map) object. | |
int | Vfetk_getAtomColor (Vfetk *thee, int iatom) |
Get the partition information for a particular atom. | |
Vfetk * | Vfetk_ctor (Vpbe *pbe, Vhal_PBEType type) |
Constructor for Vfetk object. | |
int | Vfetk_ctor2 (Vfetk *thee, Vpbe *pbe, Vhal_PBEType type) |
FORTRAN stub constructor for Vfetk object. | |
void | Vfetk_dtor (Vfetk **thee) |
Object destructor. | |
void | Vfetk_dtor2 (Vfetk *thee) |
FORTRAN stub object destructor. | |
double * | Vfetk_getSolution (Vfetk *thee, int *length) |
Create an array containing the solution (electrostatic potential in units of ![]() | |
void | Vfetk_setParameters (Vfetk *thee, PBEparm *pbeparm, FEMparm *feparm) |
Set the parameter objects. | |
double | Vfetk_energy (Vfetk *thee, int color, int nonlin) |
Return the total electrostatic energy. | |
double | Vfetk_dqmEnergy (Vfetk *thee, int color) |
Get the "mobile charge" and "polarization" contributions to the electrostatic energy. | |
double | Vfetk_qfEnergy (Vfetk *thee, int color) |
Get the "fixed charge" contribution to the electrostatic energy. | |
unsigned long int | Vfetk_memChk (Vfetk *thee) |
Return the memory used by this structure (and its contents) in bytes. | |
void | Vfetk_setAtomColors (Vfetk *thee) |
Transfer color (partition ID) information frmo a partitioned mesh to the atoms. | |
void | Bmat_printHB (Bmat *thee, char *fname) |
Writes a Bmat to disk in Harwell-Boeing sparse matrix format. | |
Vrc_Codes | Vfetk_genCube (Vfetk *thee, double center[3], double length[3], Vfetk_MeshLoad meshType) |
Construct a rectangular mesh (in the current Vfetk object). | |
Vrc_Codes | Vfetk_loadMesh (Vfetk *thee, double center[3], double length[3], Vfetk_MeshLoad meshType, Vio *sock) |
Loads a mesh into the Vfetk (and associated) object(s). | |
PDE * | Vfetk_PDE_ctor (Vfetk *fetk) |
Constructs the FEtk PDE object. | |
int | Vfetk_PDE_ctor2 (PDE *thee, Vfetk *fetk) |
Intializes the FEtk PDE object. | |
void | Vfetk_PDE_dtor (PDE **thee) |
Destroys FEtk PDE object. | |
void | Vfetk_PDE_dtor2 (PDE *thee) |
FORTRAN stub: destroys FEtk PDE object. | |
void | Vfetk_PDE_initAssemble (PDE *thee, int ip[], double rp[]) |
Do once-per-assembly initialization. | |
void | Vfetk_PDE_initElement (PDE *thee, int elementType, int chart, double tvx[][VAPBS_DIM], void *data) |
Do once-per-element initialization. | |
void | Vfetk_PDE_initFace (PDE *thee, int faceType, int chart, double tnvec[]) |
Do once-per-face initialization. | |
void | Vfetk_PDE_initPoint (PDE *thee, int pointType, int chart, double txq[], double tU[], double tdU[][VAPBS_DIM]) |
Do once-per-point initialization. | |
void | Vfetk_PDE_Fu (PDE *thee, int key, double F[]) |
Evaluate strong form of PBE. For interior points, this is:
where
where | |
double | Vfetk_PDE_Fu_v (PDE *thee, int key, double V[], double dV[][VAPBS_DIM]) |
This is the weak form of the PBE; i.e. the strong form integrated with a test function to give:
| |
double | Vfetk_PDE_DFu_wv (PDE *thee, int key, double W[], double dW[][VAPBS_DIM], double V[], double dV[][VAPBS_DIM]) |
This is the linearization of the weak form of the PBE; e.g., for use in a Newton iteration. This is the functional linearization of the strong form integrated with a test function to give:
where | |
void | Vfetk_PDE_delta (PDE *thee, int type, int chart, double txq[], void *user, double F[]) |
Evaluate a (discretized) delta function source term at the given point. | |
void | Vfetk_PDE_u_D (PDE *thee, int type, int chart, double txq[], double F[]) |
Evaluate the Dirichlet boundary condition at the given point. | |
void | Vfetk_PDE_u_T (PDE *thee, int type, int chart, double txq[], double F[]) |
Evaluate the "true solution" at the given point for comparison with the numerical solution. | |
void | Vfetk_PDE_bisectEdge (int dim, int dimII, int edgeType, int chart[], double vx[][VAPBS_DIM]) |
Define the way manifold edges are bisected. | |
void | Vfetk_PDE_mapBoundary (int dim, int dimII, int vertexType, int chart, double vx[VAPBS_DIM]) |
Map a boundary point to some pre-defined shape. | |
int | Vfetk_PDE_markSimplex (int dim, int dimII, int simplexType, int faceType[VAPBS_NVS], int vertexType[VAPBS_NVS], int chart[], double vx[][VAPBS_DIM], void *simplex) |
User-defined error estimator -- in our case, a geometry-based refinement method; forcing simplex refinement at the dielectric boundary and (for non-regularized PBE) the charges. | |
void | Vfetk_PDE_oneChart (int dim, int dimII, int objType, int chart[], double vx[][VAPBS_DIM], int dimV) |
Unify the chart for different coordinate systems -- a no-op for us. | |
double | Vfetk_PDE_Ju (PDE *thee, int key) |
Energy functional. This returns the energy (less delta function terms) in the form:
for a 1:1 electrolyte where | |
void | Vfetk_externalUpdateFunction (SS **simps, int num) |
External hook to simplex subdivision routines in Gem. Called each time a simplex is subdivided (we use it to update the charge-simplex map). | |
int | Vfetk_PDE_simplexBasisInit (int key, int dim, int comp, int *ndof, int dof[]) |
Initialize the bases for the trial or the test space, for a particular component of the system, at all quadrature points on the master simplex element. | |
void | Vfetk_PDE_simplexBasisForm (int key, int dim, int comp, int pdkey, double xq[], double basis[]) |
Evaluate the bases for the trial or test space, for a particular component of the system, at all quadrature points on the master simplex element. | |
void | Vfetk_readMesh (Vfetk *thee, int skey, Vio *sock) |
Read in mesh and initialize associated internal structures. | |
void | Vfetk_dumpLocalVar () |
Debugging routine to print out local variables used by PDE object. | |
int | Vfetk_fillArray (Vfetk *thee, Bvec *vec, Vdata_Type type) |
Fill an array with the specified data. | |
int | Vfetk_write (Vfetk *thee, const char *iodev, const char *iofmt, const char *thost, const char *fname, Bvec *vec, Vdata_Format format) |
Write out data. | |
Vrc_Codes | Vfetk_loadGem (Vfetk *thee, Gem *gm) |
Load a Gem geometry manager object into Vfetk. |
FEtk master class (interface between FEtk and APBS).
enum eVfetk_GuessType |
enum eVfetk_LsolvType |
enum eVfetk_MeshLoad |
enum eVfetk_NsolvType |
enum eVfetk_PrecType |
void Bmat_printHB | ( | Bmat * | thee, | |
char * | fname | |||
) |
Writes a Bmat to disk in Harwell-Boeing sparse matrix format.
fname | The matrix to write Filename for output |
Vfetk* Vfetk_ctor | ( | Vpbe * | pbe, | |
Vhal_PBEType | type | |||
) |
Constructor for Vfetk object.
type | Vpbe (PBE manager object) Version of PBE to solve |
References Vfetk_ctor2().
int Vfetk_ctor2 | ( | Vfetk * | thee, | |
Vpbe * | pbe, | |||
Vhal_PBEType | type | |||
) |
FORTRAN stub constructor for Vfetk object.
pbe | Vfetk object memory | |
type | PBE manager object Version of PBE to solve |
References sVpbe::acc, sVpbe::alist, sVfetk::am, sVfetk::aprx, sVfetk::csm, sVfetk::feparm, sVfetk_LocalVar::fetk, Gem_setExternalUpdateFunction(), sVfetk::gm, sVfetk::gues, sVfetk_LocalVar::initGreen, sVfetk_LocalVar::ionConc, sVfetk_LocalVar::ionQ, sVfetk_LocalVar::ionRadii, sVfetk_LocalVar::ionstr, sVfetk::level, sVfetk::lkey, sVfetk::lmax, sVfetk::lprec, sVfetk::ltol, sVfetk_LocalVar::nion, sVfetk::nkey, sVfetk::nmax, sVfetk::ntol, sVfetk::pbe, sVfetk::pbeparm, sVfetk::pde, sVfetk::pjac, sVfetk::type, VAPBS_DIM, Vfetk_externalUpdateFunction(), Vfetk_PDE_ctor(), VGT_ZERO, VLT_MG, sVfetk::vmem, VNT_NEW, Vpbe_getBulkIonicStrength(), Vpbe_getIons(), Vpbe_getZkappa2(), VPT_MG, sVfetk_LocalVar::zkappa2, and sVfetk_LocalVar::zks2.
Referenced by Vfetk_ctor().
double Vfetk_dqmEnergy | ( | Vfetk * | thee, | |
int | color | |||
) |
Get the "mobile charge" and "polarization" contributions to the electrostatic energy.
Using the solution at the finest mesh level, get the electrostatic energy due to the interaction of the mobile charges with the potential and polarization of the dielectric medium:
for the NPBE and
for the LPBE. Here denotes the counterion species,
is the bulk ionic strength,
is the modified Debye-Huckel parameter,
is the concentration of species
,
is the charge of species
,
is the dielectric function, and
is the dimensionless electrostatic potential. The energy is scaled to units of
.
thee | Vfetk object | |
color | Partition restriction for energy evaluation, only used if non-negative |
color | The Vfetk object Partition restriction for energy calculation; if non-negative, energy calculation is restricted to the specified partition (indexed by simplex and atom colors |
References sVfetk::am.
Referenced by Vfetk_energy().
void Vfetk_dtor | ( | Vfetk ** | thee | ) |
Object destructor.
thee | Pointer to memory location of Vfetk object |
References Vfetk_dtor2().
Referenced by killFE().
void Vfetk_dtor2 | ( | Vfetk * | thee | ) |
FORTRAN stub object destructor.
thee | Pointer to Vfetk object to be destroyed |
References sVfetk::am, sVfetk::aprx, sVfetk::csm, sVfetk::pde, Vcsm_dtor(), Vfetk_PDE_dtor(), and sVfetk::vmem.
Referenced by Vfetk_dtor().
void Vfetk_dumpLocalVar | ( | ) |
Debugging routine to print out local variables used by PDE object.
References sVfetk_LocalVar::A, sVfetk_LocalVar::B, sVfetk_LocalVar::d2W, sVfetk_LocalVar::DB, sVfetk_LocalVar::delta, sVfetk_LocalVar::DFu_wv, sVfetk_LocalVar::diel, sVfetk_LocalVar::dU, sVfetk_LocalVar::dW, sVfetk_LocalVar::F, sVfetk_LocalVar::fType, sVfetk_LocalVar::Fu_v, sVfetk_LocalVar::ionacc, sVfetk_LocalVar::ionConc, sVfetk_LocalVar::ionQ, sVfetk_LocalVar::ionRadii, sVfetk_LocalVar::nion, sVfetk_LocalVar::nvec, sVfetk_LocalVar::nverts, sVfetk_LocalVar::simp, sVfetk_LocalVar::sType, sVfetk_LocalVar::U, sVfetk_LocalVar::u_D, sVfetk_LocalVar::u_T, sVfetk_LocalVar::verts, sVfetk_LocalVar::vx, sVfetk_LocalVar::W, sVfetk_LocalVar::xq, sVfetk_LocalVar::zkappa2, and sVfetk_LocalVar::zks2.
double Vfetk_energy | ( | Vfetk * | thee, | |
int | color, | |||
int | nonlin | |||
) |
Return the total electrostatic energy.
Using the solution at the finest mesh level, get the electrostatic energy using the free energy functional for the Poisson-Boltzmann equation without removing any self-interaction terms (i.e., removing the reference state of isolated charges present in an infinite dielectric continuum with the same relative permittivity as the interior of the protein) and return the result in units of . The argument color allows the user to control the partition on which this energy is calculated; if (color == -1) no restrictions are used. The solution is obtained from the finest level of the passed AM object, but atomic data from the Vfetk object is used to calculate the energy.
color | THe Vfetk object | |
nonlin | Partition restriction for energy calculation; if non-negative, energy calculation is restricted to the specified partition (indexed by simplex and atom colors If 1, the NPBE energy functional is used; otherwise, the LPBE energy functional is used. If -2, SMPBE is used. |
References sVfetk::pbe, Vfetk_dqmEnergy(), Vfetk_qfEnergy(), and Vpbe_getBulkIonicStrength().
Referenced by energyFE().
void Vfetk_externalUpdateFunction | ( | SS ** | simps, | |
int | num | |||
) |
External hook to simplex subdivision routines in Gem. Called each time a simplex is subdivided (we use it to update the charge-simplex map).
num | List of parent (simps[0]) and children (remainder) simplices Number of simplices in list |
References sVfetk_LocalVar::fetk, Vcsm_update(), and Vfetk_getVcsm().
Referenced by Vfetk_ctor2().
int Vfetk_fillArray | ( | Vfetk * | thee, | |
Bvec * | vec, | |||
Vdata_Type | type | |||
) |
Fill an array with the specified data.
vec | The Vfetk object with the data | |
type | The vector to hold the data THe type of data to write |
References sVpbe::acc, sVfetk::am, sVfetk::gm, sVcsm::gm, sVpbe::ionConc, sVpbe::ionQ, sVpbe::maxIonRadius, sVpbe::numIon, sVfetk::pbe, PBE_LPBE, PBE_NPBE, PBE_SMPBE, sVfetk::pbeparm, sVpbe::solventRadius, sPBEparm::swin, sVfetk::type, Vacc_ivdwAcc(), Vacc_molAcc(), Vacc_splineAcc(), Vacc_vdwAcc(), Vcap_exp(), VDT_CHARGE, VDT_DIELX, VDT_DIELY, VDT_DIELZ, VDT_EDENS, VDT_IVDW, VDT_KAPPA, VDT_LAP, VDT_NDENS, VDT_POT, VDT_QDENS, VDT_SMOL, VDT_SSPL, and VDT_VDW.
Referenced by writedataFE().
Vrc_Codes Vfetk_genCube | ( | Vfetk * | thee, | |
double | center[3], | |||
double | length[3], | |||
Vfetk_MeshLoad | meshType | |||
) |
Construct a rectangular mesh (in the current Vfetk object).
center | Vfetk object | |
length | Center for mesh | |
meshType | Mesh lengths Mesh boundary conditions |
References sVfetk::am, sVfetk::gm, sVcsm::gm, VML_DIRICUBE, VML_EXTERNAL, VML_NEUMCUBE, VRC_FAILURE, and VRC_SUCCESS.
Referenced by Vfetk_loadMesh().
AM* Vfetk_getAM | ( | Vfetk * | thee | ) |
Get a pointer to the AM (algebra manager) object.
thee | The Vfetk object |
References sVfetk::am.
int Vfetk_getAtomColor | ( | Vfetk * | thee, | |
int | iatom | |||
) |
Get the partition information for a particular atom.
thee | Vfetk object | |
iatom | Valist atom ID |
iatom | The Vfetk object Valist atom index |
References sVfetk::pbe, Valist_getAtom(), Valist_getNumberAtoms(), Vatom_getPartID(), and Vpbe_getValist().
Gem* Vfetk_getGem | ( | Vfetk * | thee | ) |
Get a pointer to the Gem (grid manager) object.
thee | Vfetk object |
References sVfetk::gm.
Referenced by Vfetk_PDE_delta().
double* Vfetk_getSolution | ( | Vfetk * | thee, | |
int * | length | |||
) |
Create an array containing the solution (electrostatic potential in units of ) at the finest mesh level.
length | Vfetk object with solution Ste to length of the newly created solution array |
References sVfetk::am.
Referenced by Vfetk_qfEnergy().
Get a pointer to the Vcsm (charge-simplex map) object.
thee | The Vfetk object |
References sVfetk::csm.
Referenced by Vfetk_externalUpdateFunction(), and Vfetk_PDE_delta().
Get a pointer to the Vpbe (PBE manager) object.
thee | The Vfetk object |
References sVfetk::pbe.
Vrc_Codes Vfetk_loadGem | ( | Vfetk * | thee, | |
Gem * | gm | |||
) |
Load a Gem geometry manager object into Vfetk.
thee | Destination | |
gm | Geometry manager source |
Vrc_Codes Vfetk_loadMesh | ( | Vfetk * | thee, | |
double | center[3], | |||
double | length[3], | |||
Vfetk_MeshLoad | meshType, | |||
Vio * | sock | |||
) |
Loads a mesh into the Vfetk (and associated) object(s).
center | Vfetk object to load into | |
length | Center for mesh (if constructed) | |
meshType | Mesh lengths (if constructed) | |
sock | Type of mesh to load Socket for external mesh data (NULL otherwise) |
References sVfetk::am, sVfetk::csm, sVfetk::gm, sVfetk::pbe, Vcsm_ctor(), Vcsm_init(), Vfetk_genCube(), VML_DIRICUBE, VML_EXTERNAL, VML_NEUMCUBE, Vpbe_getValist(), VRC_FAILURE, and VRC_SUCCESS.
unsigned long int Vfetk_memChk | ( | Vfetk * | thee | ) |
Return the memory used by this structure (and its contents) in bytes.
thee | THe Vfetk object |
References sVfetk::csm, and Vcsm_memChk().
void Vfetk_PDE_bisectEdge | ( | int | dim, | |
int | dimII, | |||
int | edgeType, | |||
int | chart[], | |||
double | vx[][VAPBS_DIM] | |||
) |
Define the way manifold edges are bisected.
dimII | Intrinsic dimension of manifold | |
edgeType | Embedding dimension of manifold | |
chart | Type of edge being refined | |
vx | Chart for edge vertices, used here as accessibility bitfields Edge vertex coordindates |
Referenced by Vfetk_PDE_ctor2().
PDE* Vfetk_PDE_ctor | ( | Vfetk * | fetk | ) |
Constructs the FEtk PDE object.
fetk | The Vfetk object |
References Vfetk_PDE_ctor2(), and sVfetk::vmem.
Referenced by Vfetk_ctor2().
int Vfetk_PDE_ctor2 | ( | PDE * | thee, | |
Vfetk * | fetk | |||
) |
Intializes the FEtk PDE object.
fetk | The newly-allocated PDE object The parent Vfetk object |
References sVfetk_LocalVar::fetk, Vfetk_PDE_bisectEdge(), Vfetk_PDE_delta(), Vfetk_PDE_DFu_wv(), Vfetk_PDE_Fu(), Vfetk_PDE_Fu_v(), Vfetk_PDE_initAssemble(), Vfetk_PDE_initElement(), Vfetk_PDE_initFace(), Vfetk_PDE_initPoint(), Vfetk_PDE_Ju(), Vfetk_PDE_mapBoundary(), Vfetk_PDE_markSimplex(), Vfetk_PDE_oneChart(), Vfetk_PDE_simplexBasisForm(), Vfetk_PDE_simplexBasisInit(), Vfetk_PDE_u_D(), and Vfetk_PDE_u_T().
Referenced by Vfetk_PDE_ctor().
void Vfetk_PDE_delta | ( | PDE * | thee, | |
int | type, | |||
int | chart, | |||
double | txq[], | |||
void * | user, | |||
double | F[] | |||
) |
Evaluate a (discretized) delta function source term at the given point.
type | PDE object | |
chart | Vertex type | |
txq | Chart for point coordinates | |
user | Point coordinates | |
F | Vertex object pointer Set to delta function value |
References sVfetk_LocalVar::delta, sVfetk_LocalVar::fetk, sVfetk::pbe, PBE_LPBE, PBE_LRPBE, PBE_NPBE, PBE_SMPBE, sVfetk::type, Vatom_getCharge(), Vatom_getPosition(), VATOMMAX, Vcsm_getAtom(), Vcsm_getAtomIndex(), Vcsm_getNumberAtoms(), Vfetk_getGem(), Vfetk_getVcsm(), Vpbe_getZmagic(), and VRINGMAX.
Referenced by Vfetk_PDE_ctor2().
double Vfetk_PDE_DFu_wv | ( | PDE * | thee, | |
int | key, | |||
double | W[], | |||
double | dW[][VAPBS_DIM], | |||
double | V[], | |||
double | dV[][VAPBS_DIM] | |||
) |
This is the linearization of the weak form of the PBE; e.g., for use in a Newton iteration. This is the functional linearization of the strong form integrated with a test function to give:
where denotes the functional derivation of the mobile ion term.
key | The PDE object | |
W | Integrand to evaluate (0 = interior weak form, 1 = boundary weak form) | |
dW | Trial function value at current point | |
V | Trial function gradient at current point | |
dV | Test function value at current point Test function gradient |
Referenced by Vfetk_PDE_ctor2().
void Vfetk_PDE_dtor | ( | PDE ** | thee | ) |
Destroys FEtk PDE object.
thee | Pointer to PDE object memory |
References sVfetk_LocalVar::fetk, Vfetk_PDE_dtor2(), and sVfetk::vmem.
Referenced by Vfetk_dtor2().
void Vfetk_PDE_dtor2 | ( | PDE * | thee | ) |
FORTRAN stub: destroys FEtk PDE object.
thee | PDE object memory |
References sVfetk_LocalVar::fetk.
Referenced by Vfetk_PDE_dtor().
void Vfetk_PDE_Fu | ( | PDE * | thee, | |
int | key, | |||
double | F[] | |||
) |
Evaluate strong form of PBE. For interior points, this is:
where is the (possibly nonlinear) mobile ion term and
is the source charge distribution term (for PBE) or the induced surface charge distribution (for RPBE). For an interior-boundary (simplex face) point, this is:
where is the normal to the simplex face and the term represents the jump in dielectric displacement across the face. There is no outer-boundary contribution for this problem.
This function is not thread-safe
This function is not implemented (sets error to zero)
key | The PDE object | |
F | Type of point (0 = interior, 1 = boundary, 2 = interior boundary Set to value of residual |
Referenced by Vfetk_PDE_ctor2().
double Vfetk_PDE_Fu_v | ( | PDE * | thee, | |
int | key, | |||
double | V[], | |||
double | dV[][VAPBS_DIM] | |||
) |
This is the weak form of the PBE; i.e. the strong form integrated with a test function to give:
where denotes the mobile ion term.
key | The PDE object | |
V | Integrand to evaluate (0 = interior weak form, 1 = boundary weak form | |
dV | Test function at current point Test function derivative at current point |
References sVfetk_LocalVar::A, sVfetk_LocalVar::B, sVfetk_LocalVar::dU, sVfetk_LocalVar::dW, sVfetk_LocalVar::F, sVfetk_LocalVar::fetk, sVfetk_LocalVar::Fu_v, PBE_LRPBE, and sVfetk::type.
Referenced by Vfetk_PDE_ctor2().
void Vfetk_PDE_initAssemble | ( | PDE * | thee, | |
int | ip[], | |||
double | rp[] | |||
) |
Do once-per-assembly initialization.
ip | PDE object | |
rp | Integer parameter array (not used) Double parameter array (not used) |
References sVpbe::alist, sVfetk_LocalVar::fetk, sVfetk_LocalVar::green, sVfetk_LocalVar::initGreen, sVfetk::pbe, Vgreen_ctor(), and Vgreen_dtor().
Referenced by Vfetk_PDE_ctor2().
void Vfetk_PDE_initElement | ( | PDE * | thee, | |
int | elementType, | |||
int | chart, | |||
double | tvx[][VAPBS_DIM], | |||
void * | data | |||
) |
Do once-per-element initialization.
elementType | PDE object | |
chart | Material type (not used) | |
tvx | Chart in which the vertex coordinates are provided, used here as a bitfield to store molecular accessibility | |
data | Vertex coordinates Simplex pointer (hack) |
Referenced by Vfetk_PDE_ctor2().
void Vfetk_PDE_initFace | ( | PDE * | thee, | |
int | faceType, | |||
int | chart, | |||
double | tnvec[] | |||
) |
Do once-per-face initialization.
faceType | THe PDE object | |
chart | Simplex face type (interior or various boundary types) | |
tnvec | Chart in which the vertex coordinates are provided, used here as a bitfield for molecular accessibility Coordinates of outward normal vector for face |
References sVfetk_LocalVar::fType, and sVfetk_LocalVar::nvec.
Referenced by Vfetk_PDE_ctor2().
void Vfetk_PDE_initPoint | ( | PDE * | thee, | |
int | pointType, | |||
int | chart, | |||
double | txq[], | |||
double | tU[], | |||
double | tdU[][VAPBS_DIM] | |||
) |
Do once-per-point initialization.
This function is not thread-safe
This function uses pre-defined boudnary definitions for the molecular surface.
pointType | The PDE object | |
chart | The type of point -- interior or various faces | |
txq | The chart in which the point coordinates are provided, used here as bitfield for molecular accessibility | |
tU | Point coordinates | |
tdU | Solution value at point Solution derivative at point |
Referenced by Vfetk_PDE_ctor2().
double Vfetk_PDE_Ju | ( | PDE * | thee, | |
int | key | |||
) |
Energy functional. This returns the energy (less delta function terms) in the form:
for a 1:1 electrolyte where is the output from Vpbe_getZmagic.
key | The PDE object What to evluate: interior (0) or boundary (1)? |
References sVfetk_LocalVar::diel, sVfetk_LocalVar::dU, sVfetk_LocalVar::fetk, sVfetk_LocalVar::ionacc, sVfetk_LocalVar::ionConc, sVfetk_LocalVar::ionQ, sVfetk_LocalVar::nion, sVfetk::pbe, PBE_LPBE, PBE_LRPBE, PBE_NPBE, PBE_SMPBE, sVfetk::type, sVfetk_LocalVar::U, Vcap_exp(), Vpbe_getZmagic(), sVfetk_LocalVar::W, sVfetk_LocalVar::zkappa2, and sVfetk_LocalVar::zks2.
Referenced by Vfetk_PDE_ctor2().
void Vfetk_PDE_mapBoundary | ( | int | dim, | |
int | dimII, | |||
int | vertexType, | |||
int | chart, | |||
double | vx[VAPBS_DIM] | |||
) |
Map a boundary point to some pre-defined shape.
dimII | Intrinsic dimension of manifold | |
vertexType | Embedding dimension of manifold | |
chart | Type of vertex | |
vx | Chart for vertex coordinates Vertex coordinates |
Referenced by Vfetk_PDE_ctor2().
int Vfetk_PDE_markSimplex | ( | int | dim, | |
int | dimII, | |||
int | simplexType, | |||
int | faceType[VAPBS_NVS], | |||
int | vertexType[VAPBS_NVS], | |||
int | chart[], | |||
double | vx[][VAPBS_DIM], | |||
void * | simplex | |||
) |
User-defined error estimator -- in our case, a geometry-based refinement method; forcing simplex refinement at the dielectric boundary and (for non-regularized PBE) the charges.
dimII | Intrinsic manifold dimension | |
simplexType | Embedding manifold dimension | |
faceType | Type of simplex being refined | |
vertexType | Types of faces in simplex | |
chart | Types of vertices in simplex | |
vx | Charts for vertex coordinates | |
simplex | Vertex coordinates Simplex pointer |
Referenced by Vfetk_PDE_ctor2().
void Vfetk_PDE_oneChart | ( | int | dim, | |
int | dimII, | |||
int | objType, | |||
int | chart[], | |||
double | vx[][VAPBS_DIM], | |||
int | dimV | |||
) |
Unify the chart for different coordinate systems -- a no-op for us.
dimII | Intrinsic manifold dimension | |
objType | Embedding manifold dimension | |
chart | ??? | |
vx | Charts of vertices' coordinates | |
dimV | Vertices' coordinates Number of vertices |
Referenced by Vfetk_PDE_ctor2().
void Vfetk_PDE_simplexBasisForm | ( | int | key, | |
int | dim, | |||
int | comp, | |||
int | pdkey, | |||
double | xq[], | |||
double | basis[] | |||
) |
Evaluate the bases for the trial or test space, for a particular component of the system, at all quadrature points on the master simplex element.
dim | Basis type to evaluate (0 = trial, 1 = test, 2 = trialB, 3 = testB) | |
comp | Spatial dimension Which component of elliptic system to produce basis for | |
xq | Basis partial differential equation evaluation key:
| |
basis | Set to quad pt coordinate Set to all basis functions evaluated at all quadrature pts |
Referenced by Vfetk_PDE_ctor2().
int Vfetk_PDE_simplexBasisInit | ( | int | key, | |
int | dim, | |||
int | comp, | |||
int * | ndof, | |||
int | dof[] | |||
) |
Initialize the bases for the trial or the test space, for a particular component of the system, at all quadrature points on the master simplex element.
* The basis ordering is important. For a fixed quadrature * point iq, you must follow the following ordering in p[iq][], * based on how you specify the degrees of freedom in dof[]: * * <v_0 vDF_0>, <v_1 vDF_0>, ..., <v_{nv} vDF_0> * <v_0 vDF_1>, <v_1 vDF_1>, ..., <v_{nv} vDF_1> * ... * <v_0 vDF_{nvDF}>, <v_0 vDF_{nvDF}>, ..., <v_{nv} vDF_{nvDF}> * * <e_0 eDF_0>, <e_1 eDF_0>, ..., <e_{ne} eDF_0> * <e_0 eDF_1>, <e_1 eDF_1>, ..., <e_{ne} eDF_1> * ... * <e_0 eDF_{neDF}>, <e_1 eDF_{neDF}>, ..., <e_{ne} eDF_{neDF}> * * <f_0 fDF_0>, <f_1 fDF_0>, ..., <f_{nf} fDF_0> * <f_0 fDF_1>, <f_1 fDF_1>, ..., <f_{nf} fDF_1> * ... * <f_0 fDF_{nfDF}>, <f_1 fDF_{nfDF}>, ..., <f_{nf} fDF_{nfDF}> * * <s_0 sDF_0>, <s_1 sDF_0>, ..., <s_{ns} sDF_0> * <s_0 sDF_1>, <s_1 sDF_1>, ..., <s_{ns} sDF_1> * ... * <s_0 sDF_{nsDF}>, <s_1 sDF_{nsDF}>, ..., <s_{ns} sDF_{nsDF}> * * For example, linear elements in R^3, with one degree of freedom at each * * vertex, would use the following ordering: * * <v_0 vDF_0>, <v_1 vDF_0>, <v_2 vDF_0>, <v_3 vDF_0> * * Quadratic elements in R^2, with one degree of freedom at each vertex and * edge, would use the following ordering: * * <v_0 vDF_0>, <v_1 vDF_0>, <v_2 vDF_0> * <e_0 eDF_0>, <e_1 eDF_0>, <e_2 eDF_0> * * You can use different trial and test spaces for each component of the * elliptic system, thereby allowing for the use of Petrov-Galerkin methods. * You MUST then tag the bilinear form symmetry entries as nonsymmetric in * your PDE constructor to reflect that DF(u)(w,v) will be different from * DF(u)(v,w), even if your form acts symmetrically when the same basis is * used for w and v. * * You can also use different trial spaces for each component of the elliptic * system, and different test spaces for each component of the elliptic * system. This allows you to e.g. use a basis which is vertex-based for * one component, and a basis which is edge-based for another. This is * useful in fluid mechanics, eletromagnetics, or simply to play around with * different elements. * * This function is called by MC to build new master elements whenever it * reads in a new mesh. Therefore, this function does not have to be all * that fast, and e.g. could involve symbolic computation. *
dim | Basis type to evaluate (0 = trial, 1 = test, 2 = trialB, 3 = testB) | |
comp | Spatial dimension | |
ndof | Which component of elliptic system to produce basis for? | |
dof | Set to the number of degrees of freedom Set to degree of freedom per v/e/f/s |
Referenced by Vfetk_PDE_ctor2().
void Vfetk_PDE_u_D | ( | PDE * | thee, | |
int | type, | |||
int | chart, | |||
double | txq[], | |||
double | F[] | |||
) |
Evaluate the Dirichlet boundary condition at the given point.
This function is hard-coded to call only multiple-sphere Debye-Hü functions.
This function is not thread-safe.
type | PDE object | |
chart | Vertex boundary type | |
txq | Chart for point coordinates | |
F | Point coordinates Set to boundary values |
References sVfetk_LocalVar::fetk, sVfetk::pbe, PBE_LPBE, PBE_LRPBE, PBE_NPBE, PBE_SMPBE, sVfetk::type, and sVfetk_LocalVar::u_D.
Referenced by Vfetk_PDE_ctor2().
void Vfetk_PDE_u_T | ( | PDE * | thee, | |
int | type, | |||
int | chart, | |||
double | txq[], | |||
double | F[] | |||
) |
Evaluate the "true solution" at the given point for comparison with the numerical solution.
type | PDE object | |
chart | Point type | |
txq | Chart for point coordinates | |
F | Point coordinates Set to value at point |
References sVfetk_LocalVar::u_T.
Referenced by Vfetk_PDE_ctor2().
double Vfetk_qfEnergy | ( | Vfetk * | thee, | |
int | color | |||
) |
Get the "fixed charge" contribution to the electrostatic energy.
Using the solution at the finest mesh level, get the electrostatic energy due to the interaction of the fixed charges with the potential:
and return the result in units of . Clearly, no self-interaction terms are removed. A factor a 1/2 has to be included to convert this to a real energy.
thee | Vfetk object | |
color | Partition restriction for energy evaluation, only used if non-negative |
color | The Vfetk object Partition restriction for energy evaluation, only used if non-negative |
References sVpbe::alist, sVfetk::am, sVfetk::gm, sVfetk::pbe, Valist_getNumberAtoms(), and Vfetk_getSolution().
Referenced by Vfetk_energy().
void Vfetk_readMesh | ( | Vfetk * | thee, | |
int | skey, | |||
Vio * | sock | |||
) |
Read in mesh and initialize associated internal structures.
skey | THe Vfetk object | |
sock | The sock format key (0 = MCSF simplex format) Socket object ready for reading |
void Vfetk_setAtomColors | ( | Vfetk * | thee | ) |
Transfer color (partition ID) information frmo a partitioned mesh to the atoms.
Transfer color information from partitioned mesh to the atoms. In the case that a charge is shared between two partitions, the partition color of the first simplex is selected. Due to the arbitrary nature of this selection, THIS METHOD SHOULD ONLY BE USED IMMEDIATELY AFTER PARTITIONING!!!
thee | THe Vfetk object |
References sVpbe::alist, sVfetk::csm, sVfetk::pbe, Valist_getAtom(), Valist_getNumberAtoms(), Vatom_setPartID(), and Vcsm_getSimplex().
Referenced by partFE().
Set the parameter objects.
pbeparm | The Vfetk object | |
feparm | Parameters for solution of the PBE FEM-speecific solution parameters |
References sVfetk::feparm, and sVfetk::pbeparm.
int Vfetk_write | ( | Vfetk * | thee, | |
const char * | iodev, | |||
const char * | iofmt, | |||
const char * | thost, | |||
const char * | fname, | |||
Bvec * | vec, | |||
Vdata_Format | format | |||
) |
Write out data.
thee | Vfetk object | |
vec | FEtk Bvec vector to use | |
format | Format for data | |
iodev | Output device type (FILE/BUFF/UNIX/INET) | |
iofmt | Output device format (ASCII/XDR) | |
thost | Output hostname (for sockets) | |
fname | Output FILE/BUFF/UNIX/INET name |
iodev | The Vfetk object | |
iofmt | Output device type (FILE = file, BUFF = buffer, UNIX = unix pipe, INET = network socket) | |
thost | Output device format (ASCII = ascii/plaintext, XDR = xdr) | |
fname | Output hostname for sockets | |
vec | Output filename for other | |
format | Data vector Data format |
References sVfetk::aprx, sVfetk::gm, sVcsm::gm, VDF_AVS, VDF_DX, and VDF_UHBD.
Referenced by writedataFE().