Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

High-level front-end routines


Files

file  routines.h
 Header file for front end auxiliary routines.


Data Structures

struct  AtomForce
 Structure to hold atomic forces. More...


Defines

#define APBSRC   13
 Return code for APBS during failure.

#define USEHB   1
 Set this macro to 1 for hierarchical basis, 0 for normal solver.


Typedefs

typedef AtomForce AtomForce
 Define AtomForce type.


Functions

int loadMolecules (NOsh *nosh, Valist *alist[NOSH_MAXMOL])
 Load the molecules given in NOsh into atom lists.

void killMolecules (NOsh *nosh, Valist *alist[NOSH_MAXMOL])
 Destroy the loaded molecules.

int loadDielMaps (NOsh *nosh, Vgrid *dielXMap[NOSH_MAXMOL], Vgrid *dielYMap[NOSH_MAXMOL], Vgrid *dielZMap[NOSH_MAXMOL])
 Load the dielectric maps given in NOsh into grid objects.

void killDielMaps (NOsh *nosh, Vgrid *dielXMap[NOSH_MAXMOL], Vgrid *dielYMap[NOSH_MAXMOL], Vgrid *dielZMap[NOSH_MAXMOL])
 Destroy the loaded dielectric.

int loadKappaMaps (NOsh *nosh, Vgrid *kappa[NOSH_MAXMOL])
 Load the kappa maps given in NOsh into grid objects.

void killKappaMaps (NOsh *nosh, Vgrid *kappa[NOSH_MAXMOL])
 Destroy the loaded kappa maps.

int loadChargeMaps (NOsh *nosh, Vgrid *charge[NOSH_MAXMOL])
 Load the charge maps given in NOsh into grid objects.

void killChargeMaps (NOsh *nosh, Vgrid *charge[NOSH_MAXMOL])
 Destroy the loaded charge maps.

void printPBEPARM (PBEparm *pbeparm)
 Print out generic PBE params loaded from input.

void printMGPARM (MGparm *mgparm, double realCenter[3])
 Print out MG-specific params loaded from input.

int initMG (int icalc, NOsh *nosh, MGparm *mgparm, PBEparm *pbeparm, double realCenter[3], Vpbe *pbe[NOSH_MAXCALC], Valist *alist[NOSH_MAXMOL], Vgrid *dielXMap[NOSH_MAXMOL], Vgrid *dielYMap[NOSH_MAXMOL], Vgrid *dielZMap[NOSH_MAXMOL], Vgrid *kappaMap[NOSH_MAXMOL], Vgrid *chargeMap[NOSH_MAXMOL], Vpmgp *pmgp[NOSH_MAXCALC], Vpmg *pmg[NOSH_MAXCALC])
 Initialize an MG calculation.

void killMG (NOsh *nosh, Vpbe *pbe[NOSH_MAXCALC], Vpmgp *pmgp[NOSH_MAXCALC], Vpmg *pmg[NOSH_MAXCALC])
 Kill structures initialized during an MG calculation.

int solveMG (NOsh *nosh, Vpmg *pmg, MGparm_CalcType type)
 Solve the PBE with MG.

int setPartMG (NOsh *nosh, MGparm *mgparm, Vpmg *pmg)
 Set MG partitions for calculating observables and performing I/O.

int energyMG (NOsh *nosh, int icalc, Vpmg *pmg, int *nenergy, double *totEnergy, double *qfEnergy, double *qmEnergy, double *dielEnergy)
 Calculate electrostatic energies from MG solution.

int npenergyMG (NOsh *nosh, int icalc, Vpmg *pmg, int *nenergy, double *npEnergy)
 Calculate apolar energies from MG solution.

void killEnergy ()
 Kill arrays allocated for energies.

int forceMG (Vmem *mem, NOsh *nosh, PBEparm *pbeparm, MGparm *mgparm, Vpmg *pmg, int *nforce, AtomForce **atomForce, Valist *alist[NOSH_MAXMOL])
 Calculate forces from MG solution.

void killForce (Vmem *mem, NOsh *nosh, int nforce[NOSH_MAXCALC], AtomForce *atomForce[NOSH_MAXCALC])
 Free memory from MG force calculation.

int writedataMG (int rank, NOsh *nosh, PBEparm *pbeparm, Vpmg *pmg)
 Write out observables from MG calculation to file.

int writematMG (int rank, NOsh *nosh, PBEparm *pbeparm, Vpmg *pmg)
 Write out operator matrix from MG calculation to file.

int printEnergy (Vcom *com, NOsh *nosh, double totEnergy[NOSH_MAXCALC], int i)
 Combine and pretty-print energy data.

int printForce (Vcom *com, NOsh *nosh, int nforce[NOSH_MAXCALC], AtomForce *atomForce[NOSH_MAXCALC], int i)
 Combine and pretty-print force data.

void startVio ()
 Wrapper to start MALOC Vio layer.

void printFEPARM (int icalc, NOsh *nosh, FEMparm *feparm, Vfetk *fetk[NOSH_MAXCALC])
 Print out FE-specific params loaded from input.

int energyFE (NOsh *nosh, int icalc, Vfetk *fetk[NOSH_MAXCALC], int *nenergy, double *totEnergy, double *qfEnergy, double *qmEnergy, double *dielEnergy)
 Calculate electrostatic energies from FE solution.

int initFE (int icalc, NOsh *nosh, FEMparm *feparm, PBEparm *pbeparm, Vpbe *pbe[NOSH_MAXCALC], Valist *alist[NOSH_MAXMOL], Vfetk *fetk[NOSH_MAXCALC])
 Initialize FE solver objects.

int preRefineFE (int i, NOsh *nosh, FEMparm *feparm, Vfetk *fetk[NOSH_MAXCALC])
 Pre-refine mesh before solve.

int partFE (int i, NOsh *nosh, FEMparm *feparm, Vfetk *fetk[NOSH_MAXCALC])
 Partition mesh (if applicable).

int solveFE (int i, NOsh *nosh, PBEparm *pbeparm, FEMparm *feparm, Vfetk *fetk[NOSH_MAXCALC])
 Solve-estimate-refine.

int postRefineFE (int icalc, NOsh *nosh, FEMparm *feparm, Vfetk *fetk[NOSH_MAXCALC])
 Estimate error, mark mesh, and refine mesh after solve.

int writedataFE (int rank, NOsh *nosh, PBEparm *pbeparm, Vfetk *fetk)
 Write FEM data to files.


Function Documentation

int energyFE (  NOsh *  nosh,
int  icalc,
Vfetk *  fetk[NOSH_MAXCALC],
int *  nenergy,
double *  totEnergy,
double *  qfEnergy,
double *  qmEnergy,
double *  dielEnergy
) 
 

Calculate electrostatic energies from FE solution.

Author:
Nathan Baker
Parameters:
nosh Object with parsed input file parameters
icalc Index of calculation
fetk FE object array
nenergy Set to number of entries in energy arrays
totEnergy Set to total energy (in kT)
qfEnergy Set to charge-potential energy (in kT)
qmEnergy Set to mobile ion energy (in kT)
dielEnergy Set to polarization energy (in kT)
Bug:
"calcenergy 2" does not work
Returns:
1 if successful, 0 otherwise

int energyMG (  NOsh *  nosh,
int  icalc,
Vpmg *  pmg,
int *  nenergy,
double *  totEnergy,
double *  qfEnergy,
double *  qmEnergy,
double *  dielEnergy
) 
 

Calculate electrostatic energies from MG solution.

Author:
Nathan Baker
Parameters:
nosh Object with parsed input file parameters
icalc Index of calculation
pmg MG object
nenergy Set to number of entries in energy arrays
totEnergy Set to total energy (in kT)
qfEnergy Set to charge-potential energy (in kT)
qmEnergy Set to mobile ion energy (in kT)
dielEnergy Set to polarization energy (in kT)
Returns:
1 if successful, 0 otherwise

int forceMG (  Vmem *  mem,
NOsh *  nosh,
PBEparm *  pbeparm,
MGparm *  mgparm,
Vpmg *  pmg,
int *  nforce,
AtomForce **  atomForce,
Valist *  alist[NOSH_MAXMOL]
) 
 

Calculate forces from MG solution.

Author:
Nathan Baker
Parameters:
mem Memory management object
nosh Parameters from input file
pbeparm Generic PBE parameters
mgparm MG-specific parmaeters
pmg MG object
nforce Set to number of forces in arrays
atomForce List of atom forces
alist List of atom lists
Returns:
1 if successful, 0 otherwise

int initFE (  int  icalc,
NOsh *  nosh,
FEMparm *  feparm,
PBEparm *  pbeparm,
Vpbe *  pbe[NOSH_MAXCALC],
Valist *  alist[NOSH_MAXMOL],
Vfetk *  fetk[NOSH_MAXCALC]
) 
 

Initialize FE solver objects.

Author:
Nathan Baker
Parameters:
icalc Index in pbe, fetk to initialize -- calculation index
nosh Master parameter object
feparm FE-specific parameters
pbeparm Generic PBE parameters
pbe Array of PBE objects
alist Array of atom lists
fetk Array of FE solver objects
Bug:
THIS FUNCTION IS HARD-CODED TO SOLVE LRPBE

Todo:
THIS FUNCTION IS HARD-CODED TO SOLVE LRPBE
Returns:
1 if successful, 0 otherwise

int initMG (  int  icalc,
NOsh *  nosh,
MGparm *  mgparm,
PBEparm *  pbeparm,
double  realCenter[3],
Vpbe *  pbe[NOSH_MAXCALC],
Valist *  alist[NOSH_MAXMOL],
Vgrid *  dielXMap[NOSH_MAXMOL],
Vgrid *  dielYMap[NOSH_MAXMOL],
Vgrid *  dielZMap[NOSH_MAXMOL],
Vgrid *  kappaMap[NOSH_MAXMOL],
Vgrid *  chargeMap[NOSH_MAXMOL],
Vpmgp *  pmgp[NOSH_MAXCALC],
Vpmg *  pmg[NOSH_MAXCALC]
) 
 

Initialize an MG calculation.

Author:
Nathan Baker
Parameters:
icalc Index of calculation in pmg/pmpg arrays
nosh Object with parsed input file parameters
mgparm Object with MG-specific parameters
pbeparm Object with generic PBE parameters
realCenter The actual center of the current mesh
pbe Array of Vpbe objects (one for each calc)
alist Array of atom lists
dielXMap Array of x-shifted dielectric maps
dielYMap Array of y-shifted dielectric maps
dielZMap Array of z-shifted dielectric maps
kappaMap Array of kappa maps
chargeMap Array of charge maps
pmgp Array of MG parameter objects (one for each calc)
pmg Array of MG objects (one for each calc)
Returns:
1 if succesful, 0 otherwise

void killChargeMaps (  NOsh *  nosh,
Vgrid *  charge[NOSH_MAXMOL]
) 
 

Destroy the loaded charge maps.

Author:
Nathan Baker
Parameters:
nosh NOsh object with input file information
charge List of charge maps

void killDielMaps (  NOsh *  nosh,
Vgrid *  dielXMap[NOSH_MAXMOL],
Vgrid *  dielYMap[NOSH_MAXMOL],
Vgrid *  dielZMap[NOSH_MAXMOL]
) 
 

Destroy the loaded dielectric.

Author:
Nathan Baker
Parameters:
nosh NOsh object with input file information
dielXMap List of x-shifted dielectric maps
dielYMap List of y-shifted dielectric maps
dielZMap List of x-shifted dielectric maps

void killEnergy (   ) 
 

Kill arrays allocated for energies.

Author:
Nathan Baker

void killForce (  Vmem *  mem,
NOsh *  nosh,
int  nforce[NOSH_MAXCALC],
AtomForce *  atomForce[NOSH_MAXCALC]
) 
 

Free memory from MG force calculation.

Author:
Nathan Baker
Parameters:
mem Memory management object
nosh Parameters from input file
nforce Number of forces in arrays
atomForce List of atom forces

void killKappaMaps (  NOsh *  nosh,
Vgrid *  kappa[NOSH_MAXMOL]
) 
 

Destroy the loaded kappa maps.

Author:
Nathan Baker
Parameters:
nosh NOsh object with input file information
kappa List of kappa maps

void killMG (  NOsh *  nosh,
Vpbe *  pbe[NOSH_MAXCALC],
Vpmgp *  pmgp[NOSH_MAXCALC],
Vpmg *  pmg[NOSH_MAXCALC]
) 
 

Kill structures initialized during an MG calculation.

Author:
Nathan Baker
Parameters:
nosh Object with parsed input file parameters
pbe Array of Vpbe objects (one for each calc)
pmgp Array of MG parameter objects (one for each calc)
pmg Array of MG objects (one for each calc)

void killMolecules (  NOsh *  nosh,
Valist *  alist[NOSH_MAXMOL]
) 
 

Destroy the loaded molecules.

Author:
Nathan Baker
Parameters:
nosh NOsh object with input file information
alist List of atom list objects

int loadChargeMaps (  NOsh *  nosh,
Vgrid *  charge[NOSH_MAXMOL]
) 
 

Load the charge maps given in NOsh into grid objects.

Author:
Nathan Baker
Parameters:
nosh NOsh object with input file information
charge List of kappa maps
Returns:
1 if successful, 0 otherwise

int loadDielMaps (  NOsh *  nosh,
Vgrid *  dielXMap[NOSH_MAXMOL],
Vgrid *  dielYMap[NOSH_MAXMOL],
Vgrid *  dielZMap[NOSH_MAXMOL]
) 
 

Load the dielectric maps given in NOsh into grid objects.

Author:
Nathan Baker
Parameters:
nosh NOsh object with input file information
dielXMap List of x-shifted dielectric maps
dielYMap List of y-shifted dielectric maps
dielZMap List of x-shifted dielectric maps
Returns:
1 if successful, 0 otherwise

int loadKappaMaps (  NOsh *  nosh,
Vgrid *  kappa[NOSH_MAXMOL]
) 
 

Load the kappa maps given in NOsh into grid objects.

Author:
Nathan Baker
Parameters:
nosh NOsh object with input file information
kappa List of kappa maps
Returns:
1 if successful, 0 otherwise

int loadMolecules (  NOsh *  nosh,
Valist *  alist[NOSH_MAXMOL]
) 
 

Load the molecules given in NOsh into atom lists.

Author:
Nathan Baker
Parameters:
nosh NOsh object with input file information
alist List of atom list objects
Returns:
1 if successful, 0 otherwise

int npenergyMG (  NOsh *  nosh,
int  icalc,
Vpmg *  pmg,
int *  nenergy,
double *  npEnergy
) 
 

Calculate apolar energies from MG solution.

Author:
Nathan Baker
Parameters:
nosh Object with parsed input file parameters
icalc Index of calculation
pmg MG object
nenergy Set to number of entries in energy arrays
npEnergy Set to apolar energy (in kT)
Returns:
1 if successful, 0 otherwise

int partFE (  int  i,
NOsh *  nosh,
FEMparm *  feparm,
Vfetk *  fetk[NOSH_MAXCALC]
) 
 

Partition mesh (if applicable).

Author:
Nathan Baker
Parameters:
i Calculation index
nosh Master parameter object
feparm FE-specific parameters
fetk Array of FE solver objects
Returns:
1 if successful, 0 otherwise

int postRefineFE (  int  icalc,
NOsh *  nosh,
FEMparm *  feparm,
Vfetk *  fetk[NOSH_MAXCALC]
) 
 

Estimate error, mark mesh, and refine mesh after solve.

Author:
Nathan Baker
Parameters:
icalc Calculation index
nosh Master parameter object
feparm FE-specific parameters
fetk Array of FE solver objects
Returns:
1 if successful, 0 otherwise -- note that a 0 will likely imply that either the max number of vertices have been met or no vertices were marked for refinement. In either case, this should not be treated as a fatal error.

int preRefineFE (  int  i,
NOsh *  nosh,
FEMparm *  feparm,
Vfetk *  fetk[NOSH_MAXCALC]
) 
 

Pre-refine mesh before solve.

Author:
Nathan Baker
Parameters:
i Calculation index
nosh Master parameter object
feparm FE-specific parameters
fetk Array of FE solver objects
Returns:
1 if successful, 0 otherwise

int printEnergy (  Vcom *  com,
NOsh *  nosh,
double  totEnergy[NOSH_MAXCALC],
int  i
) 
 

Combine and pretty-print energy data.

Author:
Nathan Baker
Parameters:
com Communications object
nosh Parameters from input file
totEnergy Array of energies from different calculations
i Index of energy statement to print
Returns:
1 if successful, 0 otherwise

void printFEPARM (  int  icalc,
NOsh *  nosh,
FEMparm *  feparm,
Vfetk *  fetk[NOSH_MAXCALC]
) 
 

Print out FE-specific params loaded from input.

Author:
Nathan Baker
Parameters:
icalc Calculation index
nosh Master parameter object
feparm FE-specific parameters
fetk Array of FE solver objects

int printForce (  Vcom *  com,
NOsh *  nosh,
int  nforce[NOSH_MAXCALC],
AtomForce *  atomForce[NOSH_MAXCALC],
int  i
) 
 

Combine and pretty-print force data.

Author:
Nathan Baker
Parameters:
com Communications object
nosh Parameters from input file
nforce Number of forces calculated
atomForce Array of force structures
i Index of force statement to print
Returns:
1 if successful, 0 otherwise

void printMGPARM (  MGparm *  mgparm,
double  realCenter[3]
) 
 

Print out MG-specific params loaded from input.

Author:
Nathan Baker
Parameters:
realCenter Center of mesh for actual calculation
mgparm MGparm object

void printPBEPARM (  PBEparm *  pbeparm  ) 
 

Print out generic PBE params loaded from input.

Author:
Nathan Baker
Parameters:
pbeparm PBEparm object

int setPartMG (  NOsh *  nosh,
MGparm *  mgparm,
Vpmg *  pmg
) 
 

Set MG partitions for calculating observables and performing I/O.

Author:
Nathan Baker
Parameters:
nosh Object with parsed input file parameters
mgparm MG parameters from input file
pmg MG object
Returns:
1 if successful, 0 otherwise

int solveFE (  int  i,
NOsh *  nosh,
PBEparm *  pbeparm,
FEMparm *  feparm,
Vfetk *  fetk[NOSH_MAXCALC]
) 
 

Solve-estimate-refine.

Author:
Nathan Baker
Parameters:
i Calculation index
nosh Master parameter object
feparm FE-specific parameters
pbeparm Generic PBE parameters
fetk Array of FE solver objects
Returns:
1 if successful, 0 otherwise

int solveMG (  NOsh *  nosh,
Vpmg *  pmg,
MGparm_CalcType  type
) 
 

Solve the PBE with MG.

Author:
Nathan Baker
Parameters:
nosh Object with parsed input file parameters
pmg MG objects for this calculation
type Type of MG calculation
Returns:
1 if successful, 0 otherwise

void startVio (   ) 
 

Wrapper to start MALOC Vio layer.

Author:
Nathan Baker and Robert Konecny

int writedataFE (  int  rank,
NOsh *  nosh,
PBEparm *  pbeparm,
Vfetk *  fetk
) 
 

Write FEM data to files.

Author:
Nathan Baker
Parameters:
rank Rank of processor (for parallel runs)
nosh NOsh object
pbeparm PBEparm object
fetk FEtk object (with solution)
Returns:
1 if successful, 0 otherwise

int writedataMG (  int  rank,
NOsh *  nosh,
PBEparm *  pbeparm,
Vpmg *  pmg
) 
 

Write out observables from MG calculation to file.

Author:
Nathan Baker
Parameters:
rank Processor rank (if parallel calculation)
nosh Parameters from input file
pbeparm Generic PBE parameters
pmg MG object
Returns:
1 if successful, 0 otherwise

int writematMG (  int  rank,
NOsh *  nosh,
PBEparm *  pbeparm,
Vpmg *  pmg
) 
 

Write out operator matrix from MG calculation to file.

Author:
Nathan Baker
Parameters:
rank Processor rank (if parallel calculation)
nosh Parameters from input file
pbeparm Generic PBE parameters
pmg MG object
Returns:
1 if successful, 0 otherwise


Generated on Tue Dec 6 10:05:59 2005 for APBS by doxygen 1.3.5