APBS 3.0.0
Loading...
Searching...
No Matches
High-level front-end routines

Files

file  apbs.h
 Header file for header dependencies.
 
file  main.c
 APBS "front end" program using formatted input files.
 
file  routines.h
 Header file for front end auxiliary routines.
 

Data Structures

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

Macros

#define APBSRC   13
 Return code for APBS during failure.
 

Typedefs

typedef struct AtomForce AtomForce
 Define AtomForce type.
 

Functions

int main (int argc, char **argv)
 The main APBS function.
 
VPUBLIC Vrc_Codes 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.
 
VEXTERNC VparamloadParameter (NOsh *nosh)
 Loads and returns parameter object.
 
VEXTERNC int loadMolecules (NOsh *nosh, Vparam *param, Valist *alist[NOSH_MAXMOL])
 Load the molecules given in NOsh into atom lists.
 
VEXTERNC void killMolecules (NOsh *nosh, Valist *alist[NOSH_MAXMOL])
 Destroy the loaded molecules.
 
VEXTERNC 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.
 
VEXTERNC void killDielMaps (NOsh *nosh, Vgrid *dielXMap[NOSH_MAXMOL], Vgrid *dielYMap[NOSH_MAXMOL], Vgrid *dielZMap[NOSH_MAXMOL])
 Destroy the loaded dielectric.
 
VEXTERNC int loadKappaMaps (NOsh *nosh, Vgrid *kappa[NOSH_MAXMOL])
 Load the kappa maps given in NOsh into grid objects.
 
VEXTERNC void killKappaMaps (NOsh *nosh, Vgrid *kappa[NOSH_MAXMOL])
 Destroy the loaded kappa maps.
 
VEXTERNC int loadPotMaps (NOsh *nosh, Vgrid *pot[NOSH_MAXMOL])
 Load the potential maps given in NOsh into grid objects.
 
VEXTERNC void killPotMaps (NOsh *nosh, Vgrid *pot[NOSH_MAXMOL])
 Destroy the loaded potential maps.
 
VEXTERNC int loadChargeMaps (NOsh *nosh, Vgrid *charge[NOSH_MAXMOL])
 Load the charge maps given in NOsh into grid objects.
 
VEXTERNC void killChargeMaps (NOsh *nosh, Vgrid *charge[NOSH_MAXMOL])
 Destroy the loaded charge maps.
 
VEXTERNC void printPBEPARM (PBEparm *pbeparm)
 Print out generic PBE params loaded from input.
 
VEXTERNC void printMGPARM (MGparm *mgparm, double realCenter[3])
 Print out MG-specific params loaded from input.
 
VEXTERNC 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], Vgrid *potMap[NOSH_MAXMOL])
 Initialize an MG calculation.
 
VEXTERNC void killMG (NOsh *nosh, Vpbe *pbe[NOSH_MAXCALC], Vpmgp *pmgp[NOSH_MAXCALC], Vpmg *pmg[NOSH_MAXCALC])
 Kill structures initialized during an MG calculation.
 
VEXTERNC int solveMG (NOsh *nosh, Vpmg *pmg, MGparm_CalcType type)
 Solve the PBE with MG.
 
VEXTERNC int setPartMG (NOsh *nosh, MGparm *mgparm, Vpmg *pmg)
 Set MG partitions for calculating observables and performing I/O.
 
VEXTERNC int energyMG (NOsh *nosh, int icalc, Vpmg *pmg, int *nenergy, double *totEnergy, double *qfEnergy, double *qmEnergy, double *dielEnergy)
 Calculate electrostatic energies from MG solution.
 
VEXTERNC void killEnergy ()
 Kill arrays allocated for energies.
 
VEXTERNC 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.
 
VEXTERNC void killForce (Vmem *mem, NOsh *nosh, int nforce[NOSH_MAXCALC], AtomForce *atomForce[NOSH_MAXCALC])
 Free memory from MG force calculation.
 
VEXTERNC void storeAtomEnergy (Vpmg *pmg, int icalc, double **atomEnergy, int *nenergy)
 Store energy in arrays for future use.
 
VEXTERNC int writedataFlat (NOsh *nosh, Vcom *com, const char *fname, double totEnergy[NOSH_MAXCALC], double qfEnergy[NOSH_MAXCALC], double qmEnergy[NOSH_MAXCALC], double dielEnergy[NOSH_MAXCALC], int nenergy[NOSH_MAXCALC], double *atomEnergy[NOSH_MAXCALC], int nforce[NOSH_MAXCALC], AtomForce *atomForce[NOSH_MAXCALC])
 Write out information to a flat file.
 
VEXTERNC int writedataXML (NOsh *nosh, Vcom *com, const char *fname, double totEnergy[NOSH_MAXCALC], double qfEnergy[NOSH_MAXCALC], double qmEnergy[NOSH_MAXCALC], double dielEnergy[NOSH_MAXCALC], int nenergy[NOSH_MAXCALC], double *atomEnergy[NOSH_MAXCALC], int nforce[NOSH_MAXCALC], AtomForce *atomForce[NOSH_MAXCALC])
 Write out information to an XML file.
 
VEXTERNC int writedataMG (int rank, NOsh *nosh, PBEparm *pbeparm, Vpmg *pmg)
 Write out observables from MG calculation to file.
 
VEXTERNC int writematMG (int rank, NOsh *nosh, PBEparm *pbeparm, Vpmg *pmg)
 Write out operator matrix from MG calculation to file.
 
VEXTERNC double returnEnergy (Vcom *com, NOsh *nosh, double totEnergy[NOSH_MAXCALC], int iprint)
 Access net local energy.
 
VEXTERNC int printEnergy (Vcom *com, NOsh *nosh, double totEnergy[NOSH_MAXCALC], int iprint)
 Combine and pretty-print energy data (deprecated...see printElecEnergy)
 
VEXTERNC int printElecEnergy (Vcom *com, NOsh *nosh, double totEnergy[NOSH_MAXCALC], int iprint)
 Combine and pretty-print energy data.
 
VEXTERNC int printApolEnergy (NOsh *nosh, int iprint)
 Combine and pretty-print energy data.
 
VEXTERNC int printForce (Vcom *com, NOsh *nosh, int nforce[NOSH_MAXCALC], AtomForce *atomForce[NOSH_MAXCALC], int i)
 Combine and pretty-print force data (deprecated...see printElecForce)
 
VEXTERNC int printElecForce (Vcom *com, NOsh *nosh, int nforce[NOSH_MAXCALC], AtomForce *atomForce[NOSH_MAXCALC], int i)
 Combine and pretty-print force data.
 
VEXTERNC int printApolForce (Vcom *com, NOsh *nosh, int nforce[NOSH_MAXCALC], AtomForce *atomForce[NOSH_MAXCALC], int i)
 Combine and pretty-print force data.
 
VEXTERNC void startVio ()
 Wrapper to start MALOC Vio layer.
 
VEXTERNC int energyAPOL (APOLparm *apolparm, double sasa, double sav, double atomsasa[], double atomwcaEnergy[], int numatoms)
 Calculate non-polar energies.
 
VEXTERNC int forceAPOL (Vacc *acc, Vmem *mem, APOLparm *apolparm, int *nforce, AtomForce **atomForce, Valist *alist, Vclist *clist)
 Calculate non-polar forces.
 
VEXTERNC int initAPOL (NOsh *nosh, Vmem *mem, Vparam *param, APOLparm *apolparm, int *nforce, AtomForce **atomForce, Valist *alist)
 Upperlevel routine to the non-polar energy and force routines.
 
VEXTERNC void printFEPARM (int icalc, NOsh *nosh, FEMparm *feparm, Vfetk *fetk[NOSH_MAXCALC])
 Print out FE-specific params loaded from input.
 
VEXTERNC 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.
 
VEXTERNC void killFE (NOsh *nosh, Vpbe *pbe[NOSH_MAXCALC], Vfetk *fetk[NOSH_MAXCALC], Gem *gem[NOSH_MAXMOL])
 Kill structures initialized during an FE calculation.
 
VEXTERNC int preRefineFE (int i, FEMparm *feparm, Vfetk *fetk[NOSH_MAXCALC])
 Pre-refine mesh before solve.
 
VEXTERNC int partFE (int i, NOsh *nosh, FEMparm *feparm, Vfetk *fetk[NOSH_MAXCALC])
 Partition mesh (if applicable)
 
VEXTERNC int solveFE (int i, PBEparm *pbeparm, FEMparm *feparm, Vfetk *fetk[NOSH_MAXCALC])
 Solve-estimate-refine.
 
VEXTERNC int postRefineFE (int icalc, FEMparm *feparm, Vfetk *fetk[NOSH_MAXCALC])
 Estimate error, mark mesh, and refine mesh after solve.
 
VEXTERNC int writedataFE (int rank, NOsh *nosh, PBEparm *pbeparm, Vfetk *fetk)
 Write FEM data to files.
 
VEXTERNC Vrc_Codes loadMeshes (NOsh *nosh, Gem *gm[NOSH_MAXMOL])
 Load the meshes given in NOsh into geometry objects.
 
VEXTERNC void killMeshes (NOsh *nosh, Gem *alist[NOSH_MAXMOL])
 Destroy the loaded meshes.
 

Detailed Description

Macro Definition Documentation

◆ APBSRC

#define APBSRC   13

Return code for APBS during failure.

Definition at line 93 of file routines.h.

Typedef Documentation

◆ AtomForce

typedef struct AtomForce AtomForce

Define AtomForce type.

Definition at line 111 of file routines.h.

Function Documentation

◆ energyAPOL()

VEXTERNC int energyAPOL ( APOLparm * apolparm,
double sasa,
double sav,
double atomsasa[],
double atomwcaEnergy[],
int numatoms )

Calculate non-polar energies.

Author
David Gohara
Returns
1 if successful, 0 otherwise
Parameters
sasaAPOLparm object
savSolvent accessible surface area
atomsasaSolvent accessible volume
atomwcaEnergyArray for SASA per atom *
numatomsArray for WCA energy per atom * Number of atoms (or size of the above arrays) *

Definition at line 4674 of file routines.c.

◆ energyFE()

VEXTERNC 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
noshObject with parsed input file parameters
icalcIndex of calculation
fetkFE object array
nenergySet to number of entries in energy arrays
totEnergySet to total energy (in kT)
qfEnergySet to charge-potential energy (in kT)
qmEnergySet to mobile ion energy (in kT)
dielEnergySet to polarization energy (in kT)
Bug
"calcenergy 2" does not work
Returns
1 if successful, 0 otherwise

Calculates the electrostatic energies from an FE calculation.

< FE-specific parameters

< PBE-specific parameters

If we're not ignoring this particular NOsh object because it has been rendered invalid, call the Vfetk object's energy calculation function. The flag differences specified have to do with setting specific calculation restrictions (see color variable documentation in function code).

Parameters
noshObject with parsed input file parameters
icalcCalculation index
fetkFE object array
nenergySet to number of entries in energy arrays
totEnergySet to total energy (in kT)
qfEnergySet to charge-potential energy (in kT)
qmEnergySet to mobile ion energy (in kT)
dielEnergySet to polarization energy (in kT)

Definition at line 4179 of file routines.c.

◆ energyMG()

VEXTERNC 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
noshObject with parsed input file parameters
icalcIndex of calculation
pmgMG object
nenergySet to number of entries in energy arrays
totEnergySet to total energy (in kT)
qfEnergySet to charge-potential energy (in kT)
qmEnergySet to mobile ion energy (in kT)
dielEnergySet to polarization energy (in kT)
Returns
1 if successful, 0 otherwise

Definition at line 1569 of file routines.c.

◆ forceAPOL()

VEXTERNC int forceAPOL ( Vacc * acc,
Vmem * mem,
APOLparm * apolparm,
int * nforce,
AtomForce ** atomForce,
Valist * alist,
Vclist * clist )

Calculate non-polar forces.

Author
David Gohara
Returns
1 if successful, 0 otherwise
Parameters
accAccessiblity object
memMemory manager
apolparmApolar calculation parameter object
nforceNumber of atomic forces to calculate statements for
atomForceObject for storing atom forces
alistAtom list
clistCell list for accessibility object

Definition at line 4729 of file routines.c.

◆ forceMG()

VEXTERNC 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
memMemory management object
noshParameters from input file
pbeparmGeneric PBE parameters
mgparmMG-specific parmaeters
pmgMG object
nforceSet to number of forces in arrays
atomForceList of atom forces
alistList of atom lists
Returns
1 if successful, 0 otherwise

Definition at line 1636 of file routines.c.

◆ initAPOL()

VEXTERNC int initAPOL ( NOsh * nosh,
Vmem * mem,
Vparam * param,
APOLparm * apolparm,
int * nforce,
AtomForce ** atomForce,
Valist * alist )

Upperlevel routine to the non-polar energy and force routines.

Author
David Gohara
Returns
1 if successful, 0 otherwise

<

< Number of atoms

< Used to capture length of loops to prevent multiple calls in counters

<

<

< Temporary timing variable for debugging (PCE)

<

<

<

<

<

<

<

<

<

<

<

<

<

<

<

< WCA energy per atom

<

<

<

<

<

<

<

<

<

<

<

<

<

Parameters
noshInput parameter object
memMemory manager
paramAtom parameters
apolparmApolar calculation parameters
nforceNumber of force calculations
atomForceAtom force storage object
alistAtom list

Definition at line 4475 of file routines.c.

◆ initFE()

VEXTERNC Vrc_Codes 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
Bug
THIS FUNCTION IS HARD-CODED TO SOLVE LRPBE
Author
Nathan Baker
Bug
THIS FUNCTION IS HARD-CODED TO SOLVE LRPBE

< Loop counter

< Mesh ID

< Loop counter

< Loop counter

< Molecule ID

<

< I/O socket for reading MCSF mesh data

< Total bytes used by this operation

< High-water memory usage for this operation

< The type of mesh being used (see struct for enum values)

<

<

<

<

<

< Return codes for function calls (see struct for enum value)

< List of atoms being operated on

< Atom/molecule being operated on

Parameters
icalcIndex in pb, fetk to initialize (calculation index)
noshMaster parmaeter object
feparmFE-specific parameters
pbeparmGeneric PBE parameters
pbeArray of PBE objects
alistArray of atom lists
fetkArray of finite element objects

Definition at line 3711 of file routines.c.

◆ initMG()

VEXTERNC 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],
Vgrid * potMap[NOSH_MAXMOL] )

Initialize an MG calculation.

Author
Nathan Baker
Returns
1 if succesful, 0 otherwise

Initialize a multigrid calculation.

Parameters
icalcIndex of calculation in pmg/pmpg arrays
noshObject with parsed input file parameters
mgparmObject with MG-specific parameters
pbeparmObject with generic PBE parameters
realCenterThe actual center of the current mesh
pbeArray of Vpbe objects (one for each calc)
alistArray of atom lists
dielXMapArray of x-shifted dielectric maps
dielYMapArray of y-shifted dielectric maps
dielZMapArray of z-shifted dielectric maps
kappaMapArray of kappa maps
chargeMapArray of charge maps
pmgpArray of MG parameter objects (one for each calc)
pmgArray of MG objects (one for each calc)
potMapArray of potential maps

Definition at line 1212 of file routines.c.

◆ killChargeMaps()

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

Destroy the loaded charge maps.

Author
Nathan Baker
Parameters
noshNOsh object with input file information
chargeList of charge maps

Definition at line 984 of file routines.c.

◆ killDielMaps()

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

Destroy the loaded dielectric.

Author
Nathan Baker
Parameters
noshNOsh object with input file information
dielXMapList of x-shifted dielectric maps
dielYMapList of y-shifted dielectric maps
dielZMapList of x-shifted dielectric maps

Definition at line 639 of file routines.c.

◆ killEnergy()

VEXTERNC void killEnergy ( )

Kill arrays allocated for energies.

Author
Nathan Baker

Definition at line 1774 of file routines.c.

◆ killFE()

VEXTERNC void killFE ( NOsh * nosh,
Vpbe * pbe[NOSH_MAXCALC],
Vfetk * fetk[NOSH_MAXCALC],
Gem * gem[NOSH_MAXMOL] )

Kill structures initialized during an FE calculation.

Author
Nathan Baker
Parameters
pbeObject with parsed input file parameters
fetkArray of Vpbe objects for each calc
gemArray of FEtk objects for each calc Array of geometry manager objects for each calc

Definition at line 3683 of file routines.c.

◆ killForce()

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

Free memory from MG force calculation.

Author
Nathan Baker
Parameters
memMemory management object
noshParameters from input file
nforceNumber of forces in arrays
atomForceList of atom forces

Definition at line 1782 of file routines.c.

◆ killKappaMaps()

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

Destroy the loaded kappa maps.

Author
Nathan Baker
Parameters
noshNOsh object with input file information
kappaList of kappa maps

Definition at line 776 of file routines.c.

◆ killMeshes()

VEXTERNC void killMeshes ( NOsh * nosh,
Gem * alist[NOSH_MAXMOL] )

Destroy the loaded meshes.

Author
Nathan Baker
Parameters
noshNOsh object with input file information
alistPopulated list of geometry objects to be destroyed

◆ killMG()

VEXTERNC 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
pbeObject with parsed input file parameters
pmgpArray of Vpbe objects for each calc
pmgArray of MG parameter objects for each calc Array of MG objects for each calc

Definition at line 1461 of file routines.c.

◆ killMolecules()

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

Destroy the loaded molecules.

Author
Nathan Baker
Parameters
noshNOsh object with input file information
alistList of atom list objects

Definition at line 233 of file routines.c.

◆ killPotMaps()

VEXTERNC void killPotMaps ( NOsh * nosh,
Vgrid * pot[NOSH_MAXMOL] )

Destroy the loaded potential maps.

Author
David Gohara
Parameters
noshNOsh object with input file information
potList of potential maps

Definition at line 865 of file routines.c.

◆ loadChargeMaps()

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

Load the charge maps given in NOsh into grid objects.

Author
Nathan Baker
Parameters
noshNOsh object with input file information
chargeList of kappa maps
Returns
1 if successful, 0 otherwise
0 on failure, 1 on success

Definition at line 884 of file routines.c.

◆ loadDielMaps()

VEXTERNC 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
noshNOsh object with input file information
dielXMapList of x-shifted dielectric maps
dielYMapList of y-shifted dielectric maps
dielZMapList of x-shifted dielectric maps
Returns
1 if successful, 0 otherwise

Loads dielectric map path data into NOsh object

Returns
1 on success, 0 on error

Definition at line 250 of file routines.c.

◆ loadKappaMaps()

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

Load the kappa maps given in NOsh into grid objects.

Author
Nathan Baker
Parameters
noshNOsh object with input file information
kappaList of kappa maps
Returns
1 if successful, 0 otherwise
0 on failure, 1 on success

Definition at line 664 of file routines.c.

◆ loadMeshes()

VEXTERNC Vrc_Codes loadMeshes ( NOsh * nosh,
Gem * gm[NOSH_MAXMOL] )

Load the meshes given in NOsh into geometry objects.

Author
Nathan Baker
Returns
Error code on success/failure
Parameters
noshNOsh object with input file information
gmList of geometry objects (to be populated)

◆ loadMolecules()

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

Load the molecules given in NOsh into atom lists.

Author
Nathan Baker
Returns
1 if successful, 0 otherwise
Parameters
noshNOsh object with input file information
paramNULL (if PQR files only) or pointer to parameter object
alistList of atom list objects (to be populated)

Definition at line 95 of file routines.c.

◆ loadParameter()

VEXTERNC Vparam * loadParameter ( NOsh * nosh)

Loads and returns parameter object.

Author
Nathan Baker
Returns
Pointer to parameter object or NULL
Parameters
noshPointer to NOsh object with input file information

Definition at line 60 of file routines.c.

◆ loadPotMaps()

VEXTERNC int loadPotMaps ( NOsh * nosh,
Vgrid * map[NOSH_MAXMOL] )

Load the potential maps given in NOsh into grid objects.

Author
David Gohara
Parameters
noshNOsh object with input file information
potList of potential maps
Returns
1 if successful, 0 otherwise
0 on failure, 1 on success

Definition at line 793 of file routines.c.

◆ main()

int main ( int argc,
char ** argv )

The main APBS function.

Author
Nathan Baker, Dave Gohara, Todd Dolinsky
Returns
Status code (0 for success)
Parameters
argcNumber of arguments
argvArgument strings

Definition at line 80 of file main.c.

◆ partFE()

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

Partition mesh (if applicable)

Author
Nathan Baker
Parameters
iCalculation index
noshMaster parameter object
feparmFE-specific parameters
fetkArray of FE solver objects
Returns
1 if successful, 0 otherwise

Definition at line 4039 of file routines.c.

◆ postRefineFE()

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

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

Author
Nathan Baker
Parameters
icalcCalculation index
feparmFE-specific parameters
fetkArray 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.

Estimates the error, marks the mesh, and refines the mesh after solving.

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.

< Number of vertices in the molecular geometry

< Whether vertices are marked for refinement

Parameters
icalcCalculation index
feparmFE-specific parameters
fetkArray of FE solver objects

Definition at line 4239 of file routines.c.

◆ preRefineFE()

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

Pre-refine mesh before solve.

Author
Nathan Baker
Parameters
iCalculation index
noshMaster parameter object
feparmFE-specific parameters
fetkArray of FE solver objects
Returns
1 if successful, 0 otherwise

< Number of vertices in the mesh geometry

< Essentially a boolean; indicates whether further refinement is required after running MC's refinement algorithm.

TODO: could this be optimized by moving nverts out of the loop to just above this initial printout? This depends heavily on whether the number of vertices can change during the calculation. - PCE

Definition at line 4046 of file routines.c.

◆ printApolEnergy()

VEXTERNC int printApolEnergy ( NOsh * nosh,
int iprint )

Combine and pretty-print energy data.

Author
David Gohara
Returns
1 if successful, 0 otherwise
Parameters
noshParameters from input file
iprintIndex of energy statement to print

Definition at line 2918 of file routines.c.

◆ printApolForce()

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

Combine and pretty-print force data.

Author
David Gohara
Returns
1 if successful, 0 otherwise
Parameters
noshCommunications object
nforceParameters from input file
atomForceNumber of forces calculated
iArray of force structures Index of force statement to print

Definition at line 3471 of file routines.c.

◆ printElecEnergy()

VEXTERNC int printElecEnergy ( Vcom * com,
NOsh * nosh,
double totEnergy[NOSH_MAXCALC],
int iprint )

Combine and pretty-print energy data.

Author
David Gohara
Returns
1 if successful, 0 otherwise
Parameters
noshCommunications object
totEnergyParameters from input file
iprintArray of energies from different calculations Index of energy statement to print

Definition at line 2853 of file routines.c.

◆ printElecForce()

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

Combine and pretty-print force data.

Author
David Gohara
Returns
1 if successful, 0 otherwise
Parameters
noshCommunications object
nforceParameters from input file
atomForceNumber of forces calculated
iArray of force structures Index of force statement to print

Definition at line 3228 of file routines.c.

◆ printEnergy()

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

Combine and pretty-print energy data (deprecated...see printElecEnergy)

Author
Nathan Baker
Returns
1 if successful, 0 otherwise
Parameters
noshCommunications object
totEnergyParameters from input file
iprintArray of energies from different calculations Index of energy statement to print

Definition at line 2785 of file routines.c.

◆ printFEPARM()

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

Print out FE-specific params loaded from input.

Author
Nathan Baker
Parameters
icalcCalculation index
noshMaster parameter object
feparmFE-specific parameters
fetkArray of FE solver objects

Definition at line 3903 of file routines.c.

◆ printForce()

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

Combine and pretty-print force data (deprecated...see printElecForce)

Author
Nathan Baker
Returns
1 if successful, 0 otherwise
Parameters
noshCommunications object
nforceParameters from input file
atomForceNumber of forces calculated
iArray of force structures Index of force statement to print

Definition at line 2980 of file routines.c.

◆ printMGPARM()

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

Print out MG-specific params loaded from input.

Author
Nathan Baker
Parameters
realCenterCenter of mesh for actual calculation
mgparmMGparm object

Definition at line 1179 of file routines.c.

◆ printPBEPARM()

VEXTERNC void printPBEPARM ( PBEparm * pbeparm)

Print out generic PBE params loaded from input.

Author
Nathan Baker
Parameters
pbeparmPBEparm object

Definition at line 1002 of file routines.c.

◆ returnEnergy()

VEXTERNC double returnEnergy ( Vcom * com,
NOsh * nosh,
double totEnergy[NOSH_MAXCALC],
int iprint )

Access net local energy.

Author
Justin Xiang
Parameters
comCommunications object
noshParameters from input file
totEnergyArray of energies from different calculations
iprintIndex of energy statement to print
Returns
Net local energy

Definition at line 2753 of file routines.c.

◆ setPartMG()

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

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

Author
Nathan Baker
Parameters
noshObject with parsed input file parameters
mgparmMG parameters from input file
pmgMG object
Returns
1 if successful, 0 otherwise

Definition at line 1523 of file routines.c.

◆ solveFE()

VEXTERNC int solveFE ( int icalc,
PBEparm * pbeparm,
FEMparm * feparm,
Vfetk * fetk[NOSH_MAXCALC] )

Solve-estimate-refine.

Author
Nathan Baker
Parameters
iCalculation index
feparmFE-specific parameters
pbeparmGeneric PBE parameters
fetkArray of FE solver objects
Returns
1 if successful, 0 otherwise

Call MC's mesh solving equations depending upon the type of PBE we're dealing with.

< AM_hPcg

< Coarse-grid solver; 0 = SLU, 1 = MG, 2 = CG, 3 = BCG, 4 = PCG, 5 = PBCG

< Primal problem

< Preconditioner; 0 = identity.

Parameters
icalcCalculation index
pbeparmPBE-specific parameters
feparmFE-specific parameters
fetkArray of FE solver objects

Definition at line 4116 of file routines.c.

◆ solveMG()

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

Solve the PBE with MG.

Author
Nathan Baker
Parameters
noshObject with parsed input file parameters
pmgMG objects for this calculation
typeType of MG calculation
Returns
1 if successful, 0 otherwise

Definition at line 1487 of file routines.c.

◆ startVio()

VEXTERNC void startVio ( )

Wrapper to start MALOC Vio layer.

Author
Nathan Baker and Robert Konecny

Definition at line 58 of file routines.c.

◆ storeAtomEnergy()

VEXTERNC void storeAtomEnergy ( Vpmg * pmg,
int icalc,
double ** atomEnergy,
int * nenergy )

Store energy in arrays for future use.

Author
Todd Dolinsky
Parameters
pmgMG object
icalcCalculation number
atomEnergyPointer to storage array of doubles
nenergyStores number of atoms per calc

Definition at line 1870 of file routines.c.

◆ writedataFE()

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

Write FEM data to files.

Author
Nathan Baker
Parameters
rankRank of processor (for parallel runs)
noshNOsh object
pbeparmPBEparm object
fetkFEtk object (with solution)
Returns
1 if successful, 0 otherwise

Write FEM data to file.

<

<

< Loop counter

< Flag indicating whether data can be written to output

<

<

Parameters
rankRank of processor (for parallel runs)
noshNOsh object
pbeparmPBE-specific parameters
fetkFEtk object (with solution)

Definition at line 4300 of file routines.c.

◆ writedataFlat()

VEXTERNC int writedataFlat ( NOsh * nosh,
Vcom * com,
const char * fname,
double totEnergy[NOSH_MAXCALC],
double qfEnergy[NOSH_MAXCALC],
double qmEnergy[NOSH_MAXCALC],
double dielEnergy[NOSH_MAXCALC],
int nenergy[NOSH_MAXCALC],
double * atomEnergy[NOSH_MAXCALC],
int nforce[NOSH_MAXCALC],
AtomForce * atomForce[NOSH_MAXCALC] )

Write out information to a flat file.

Author
Todd Dolinsky
Parameters
noshParameters from input file
comThe communications object
fnameThe target XML file name
totEnergyAn array with per-calc total energies (in kT)
qfEnergyAn array with per-calc charge-potential energies (in kT)
qmEnergyAn array with per-calc mobile energies (in kT)
dielEnergyAn array with per-calc polarization energies (in kT)
nenergyAn array containing the number of atoms per-calc
atomEnergyAn array containing per-atom energies (in KT) per calc
nforceAn array containing the number of forces calculated per-calc
atomForceAn array containing per-atom forces per calc
Returns
1 if successful, 0 otherwise

Definition at line 1887 of file routines.c.

◆ writedataMG()

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

Write out observables from MG calculation to file.

Author
Nathan Baker
Parameters
rankProcessor rank (if parallel calculation)
noshParameters from input file
pbeparmGeneric PBE parameters
pmgMG object
Returns
1 if successful, 0 otherwise

Definition at line 2383 of file routines.c.

◆ writedataXML()

VEXTERNC int writedataXML ( NOsh * nosh,
Vcom * com,
const char * fname,
double totEnergy[NOSH_MAXCALC],
double qfEnergy[NOSH_MAXCALC],
double qmEnergy[NOSH_MAXCALC],
double dielEnergy[NOSH_MAXCALC],
int nenergy[NOSH_MAXCALC],
double * atomEnergy[NOSH_MAXCALC],
int nforce[NOSH_MAXCALC],
AtomForce * atomForce[NOSH_MAXCALC] )

Write out information to an XML file.

Author
Todd Dolinsky
Parameters
noshParameters from input file
comThe communications object
fnameThe target XML file name
totEnergyAn array with per-calc total energies (in kT)
qfEnergyAn array with per-calc charge-potential energies (in kT)
qmEnergyAn array with per-calc mobile energies (in kT)
dielEnergyAn array with per-calc polarization energies (in kT)
nenergyAn array containing the number of atoms per-calc
atomEnergyAn array containing per-atom energies (in KT) per calc
nforceAn array containing the number of forces calculated per-calc
atomForceAn array containing per-atom forces per calc
Returns
1 if successful, 0 otherwise

Definition at line 2123 of file routines.c.

◆ writematMG()

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

Write out operator matrix from MG calculation to file.

Author
Nathan Baker
Parameters
rankProcessor rank (if parallel calculation)
noshParameters from input file
pbeparmGeneric PBE parameters
pmgMG object
Returns
1 if successful, 0 otherwise

Definition at line 1799 of file routines.c.