APBS  1.5
Vgrid class

Oracle for Cartesian mesh data. More...

Files

file  vgrid.c
 Class Vgrid methods.
 
file  vgrid.h
 Potential oracle for Cartesian mesh data.
 

Data Structures

struct  sVgrid
 Electrostatic potential oracle for Cartesian mesh data. More...
 

Macros

#define VGRID_DIGITS   6
 Number of decimal places for comparisons and formatting.
 

Typedefs

typedef struct sVgrid Vgrid
 Declaration of the Vgrid class as the sVgrid structure.
 

Functions

VEXTERNC unsigned long int Vgrid_memChk (Vgrid *thee)
 Return the memory used by this structure (and its contents) in bytes. More...
 
VEXTERNC VgridVgrid_ctor (int nx, int ny, int nz, double hx, double hy, double hzed, double xmin, double ymin, double zmin, double *data)
 Construct Vgrid object with values obtained from Vpmg_readDX (for example) More...
 
VEXTERNC int Vgrid_ctor2 (Vgrid *thee, int nx, int ny, int nz, double hx, double hy, double hzed, double xmin, double ymin, double zmin, double *data)
 Initialize Vgrid object with values obtained from Vpmg_readDX (for example) More...
 
VEXTERNC int Vgrid_value (Vgrid *thee, double x[3], double *value)
 Get potential value (from mesh or approximation) at a point. More...
 
VEXTERNC void Vgrid_dtor (Vgrid **thee)
 Object destructor. More...
 
VEXTERNC void Vgrid_dtor2 (Vgrid *thee)
 FORTRAN stub object destructor. More...
 
VEXTERNC int Vgrid_curvature (Vgrid *thee, double pt[3], int cflag, double *curv)
 Get second derivative values at a point. More...
 
VEXTERNC int Vgrid_gradient (Vgrid *thee, double pt[3], double grad[3])
 Get first derivative values at a point. More...
 
VEXTERNC int Vgrid_readGZ (Vgrid *thee, const char *fname)
 Read in OpenDX data in GZIP format. More...
 
VEXTERNC void Vgrid_writeUHBD (Vgrid *thee, const char *iodev, const char *iofmt, const char *thost, const char *fname, char *title, double *pvec)
 Write out the data in UHBD grid format. More...
 
VEXTERNC void Vgrid_writeDX (Vgrid *thee, const char *iodev, const char *iofmt, const char *thost, const char *fname, char *title, double *pvec)
 Write out the data in OpenDX grid format. More...
 
VEXTERNC int Vgrid_readDX (Vgrid *thee, const char *iodev, const char *iofmt, const char *thost, const char *fname)
 Read in data in OpenDX grid format. More...
 
VEXTERNC void Vgrid_writeDXBIN (Vgrid *thee, const char *iodev, const char *iofmt, const char *thost, const char *fname, char *title, double *pvec)
 Write out the binary data in OpenDX grid format. More...
 
VEXTERNC int Vgrid_readDXBIN (Vgrid *thee, const char *iodev, const char *iofmt, const char *thost, const char *fname)
 Read in binary data in OpenDX grid format. More...
 
VEXTERNC double Vgrid_integrate (Vgrid *thee)
 Get the integral of the data. More...
 
VEXTERNC double Vgrid_normL1 (Vgrid *thee)
 Get the $L_1$ norm of the data. This returns the integral:

\[ \| u \|_{L_1} = \int_\Omega | u(x) | dx \]

. More...

 
VEXTERNC double Vgrid_normL2 (Vgrid *thee)
 Get the $L_2$ norm of the data. This returns the integral:

\[ \| u \|_{L_2} = \left( \int_\Omega | u(x) |^2 dx \right)^{1/2} \]

. More...

 
VEXTERNC double Vgrid_normLinf (Vgrid *thee)
 Get the $L_\infty$ norm of the data. This returns the integral:

\[ \| u \|_{L_\infty} = \sup_{x \in \Omega} | u(x) | \]

. More...

 
VEXTERNC double Vgrid_seminormH1 (Vgrid *thee)
 Get the $H_1$ semi-norm of the data. This returns the integral:

\[ | u |_{H_1} = \left( \int_\Omega |\nabla u(x)|^2 dx \right)^{1/2} \]

. More...

 
VEXTERNC double Vgrid_normH1 (Vgrid *thee)
 Get the $H_1$ norm (or energy norm) of the data. This returns the integral:

\[ \| u \|_{H_1} = \left( \int_\Omega |\nabla u(x)|^2 dx + \int_\Omega |u(x)|^2 dx \right)^{1/2} \]

. More...

 

Detailed Description

Oracle for Cartesian mesh data.

Function Documentation

◆ Vgrid_ctor()

VEXTERNC Vgrid* Vgrid_ctor ( int  nx,
int  ny,
int  nz,
double  hx,
double  hy,
double  hzed,
double  xmin,
double  ymin,
double  zmin,
double *  data 
)

Construct Vgrid object with values obtained from Vpmg_readDX (for example)

Author
Nathan Baker
Parameters
nxNumber grid points in x direction
nyNumber grid points in y direction
nzNumber grid points in z direction
hxGrid spacing in x direction
hyGrid spacing in y direction
hzedGrid spacing in z direction
xminx coordinate of lower grid corner
yminy coordinate of lower grid corner
zminz coordinate of lower grid corner
datanx*ny*nz array of data. This can be VNULL if you are planning to read in data later with one of the read routines
Returns
Newly allocated and initialized Vgrid object

Definition at line 86 of file vgrid.c.

◆ Vgrid_ctor2()

VEXTERNC int Vgrid_ctor2 ( Vgrid thee,
int  nx,
int  ny,
int  nz,
double  hx,
double  hy,
double  hzed,
double  xmin,
double  ymin,
double  zmin,
double *  data 
)

Initialize Vgrid object with values obtained from Vpmg_readDX (for example)

Author
Nathan Baker
Parameters
theePointer to newly allocated Vgrid object
nxNumber grid points in x direction
nyNumber grid points in y direction
nzNumber grid points in z direction
hxGrid spacing in x direction
hyGrid spacing in y direction
hzedGrid spacing in z direction
xminx coordinate of lower grid corner
yminy coordinate of lower grid corner
zminz coordinate of lower grid corner
datanx*ny*nz array of data. This can be VNULL if you are planning to read in data later with one of the read routines
Returns
Newly allocated and initialized Vgrid object

Definition at line 112 of file vgrid.c.

◆ Vgrid_curvature()

VEXTERNC int Vgrid_curvature ( Vgrid thee,
double  pt[3],
int  cflag,
double *  curv 
)

Get second derivative values at a point.

Author
Steve Bond and Nathan Baker
Parameters
theePointer to Vgrid object
ptLocation to evaluate second derivative
cflag
  • 0: Reduced Maximal Curvature
  • 1: Mean Curvature (Laplace)
  • 2: Gauss Curvature
  • 3: True Maximal Curvature
curvSpecified curvature value
Returns
1 if successful, 0 if off grid

Definition at line 299 of file vgrid.c.

◆ Vgrid_dtor()

VEXTERNC void Vgrid_dtor ( Vgrid **  thee)

Object destructor.

Author
Nathan Baker
Parameters
theePointer to memory location of object to be destroyed

Definition at line 152 of file vgrid.c.

◆ Vgrid_dtor2()

VEXTERNC void Vgrid_dtor2 ( Vgrid thee)

FORTRAN stub object destructor.

Author
Nathan Baker
Parameters
theePointer to object to be destroyed

Definition at line 165 of file vgrid.c.

◆ Vgrid_gradient()

VEXTERNC int Vgrid_gradient ( Vgrid thee,
double  pt[3],
double  grad[3] 
)

Get first derivative values at a point.

Author
Nathan Baker and Steve Bond
Parameters
theePointer to Vgrid object
ptLocation to evaluate gradient
gradGradient
Returns
1 if successful, 0 if off grid

Definition at line 379 of file vgrid.c.

◆ Vgrid_integrate()

VEXTERNC double Vgrid_integrate ( Vgrid thee)

Get the integral of the data.

Author
Nathan Baker
Parameters
theeVgrid object
Returns
Integral of data

Definition at line 1790 of file vgrid.c.

◆ Vgrid_memChk()

VEXTERNC unsigned long int Vgrid_memChk ( Vgrid thee)

Return the memory used by this structure (and its contents) in bytes.

Author
Nathan Baker
Parameters
theeVgrid object
Returns
The memory used by this structure and its contents in bytes

Definition at line 63 of file vgrid.c.

◆ Vgrid_normH1()

VEXTERNC double Vgrid_normH1 ( Vgrid thee)

Get the $H_1$ norm (or energy norm) of the data. This returns the integral:

\[ \| u \|_{H_1} = \left( \int_\Omega |\nabla u(x)|^2 dx + \int_\Omega |u(x)|^2 dx \right)^{1/2} \]

.

Author
Nathan Baker
Parameters
theeVgrid object
Returns
Integral of data

Definition at line 1931 of file vgrid.c.

◆ Vgrid_normL1()

VEXTERNC double Vgrid_normL1 ( Vgrid thee)

Get the $L_1$ norm of the data. This returns the integral:

\[ \| u \|_{L_1} = \int_\Omega | u(x) | dx \]

.

Author
Nathan Baker
Parameters
theeVgrid object
Returns
$L_1$ norm of data

Definition at line 1828 of file vgrid.c.

◆ Vgrid_normL2()

VEXTERNC double Vgrid_normL2 ( Vgrid thee)

Get the $L_2$ norm of the data. This returns the integral:

\[ \| u \|_{L_2} = \left( \int_\Omega | u(x) |^2 dx \right)^{1/2} \]

.

Author
Nathan Baker
Parameters
theeVgrid object
Returns
$L_2$ norm of data

Definition at line 1858 of file vgrid.c.

◆ Vgrid_normLinf()

VEXTERNC double Vgrid_normLinf ( Vgrid thee)

Get the $L_\infty$ norm of the data. This returns the integral:

\[ \| u \|_{L_\infty} = \sup_{x \in \Omega} | u(x) | \]

.

Author
Nathan Baker
Parameters
theeVgrid object
Returns
$L\infty$ norm of data

Definition at line 1946 of file vgrid.c.

◆ Vgrid_readDX()

VEXTERNC int Vgrid_readDX ( Vgrid thee,
const char *  iodev,
const char *  iofmt,
const char *  thost,
const char *  fname 
)

Read in data in OpenDX grid format.

Note
All dimension information is given in order: z, y, x
Author
Nathan Baker
Parameters
theeVgrid object
iodevInput device type (FILE/BUFF/UNIX/INET)
iofmtInput device format (ASCII/XDR)
thostInput hostname (for sockets)
fnameInput FILE/BUFF/UNIX/INET name
Returns
1 if sucessful, 0 otherwise

Load grid from an input file using sockets.

Author
Nathan Baker

Definition at line 586 of file vgrid.c.

◆ Vgrid_readDXBIN()

VEXTERNC int Vgrid_readDXBIN ( Vgrid thee,
const char *  iodev,
const char *  iofmt,
const char *  thost,
const char *  fname 
)

Read in binary data in OpenDX grid format.

Note
All dimension information is given in order: z, y, x
Author
Juan Brandi
Parameters
theeVgrid object
iodevInput device type (FILE/BUFF/UNIX/INET)
iofmtInput device format (ASCII/XDR)
thostInput hostname (for sockets)
fnameInput FILE/BUFF/UNIX/INET name
Returns
1 if sucessful, 0 otherwise

Load grid from an input dx binary file.

Author
Juan Brandi

Definition at line 810 of file vgrid.c.

◆ Vgrid_readGZ()

VEXTERNC int Vgrid_readGZ ( Vgrid thee,
const char *  fname 
)

Read in OpenDX data in GZIP format.

Author
Dave Gohara
Returns
1 if successful, 0 otherwise
Parameters
theeObject with grid data to write
fnamePath to write to

Definition at line 462 of file vgrid.c.

◆ Vgrid_seminormH1()

VEXTERNC double Vgrid_seminormH1 ( Vgrid thee)

Get the $H_1$ semi-norm of the data. This returns the integral:

\[ | u |_{H_1} = \left( \int_\Omega |\nabla u(x)|^2 dx \right)^{1/2} \]

.

Author
Nathan Baker
Parameters
theeVgrid object
Returns
Integral of data

Definition at line 1888 of file vgrid.c.

◆ Vgrid_value()

VEXTERNC int Vgrid_value ( Vgrid thee,
double  x[3],
double *  value 
)

Get potential value (from mesh or approximation) at a point.

Author
Nathan Baker
Parameters
theeVgrid obejct
xPoint at which to evaluate potential
valueValue of data at point x
Returns
1 if successful, 0 if off grid

Definition at line 179 of file vgrid.c.

◆ Vgrid_writeDX()

VEXTERNC void Vgrid_writeDX ( Vgrid thee,
const char *  iodev,
const char *  iofmt,
const char *  thost,
const char *  fname,
char *  title,
double *  pvec 
)

Write out the data in OpenDX grid format.

Author
Nathan Baker
Parameters
theeGrid object
iodevOutput device type (FILE/BUFF/UNIX/INET)
iofmtOutput device format (ASCII/XDR)
thostOutput hostname (for sockets)
fnameOutput FILE/BUFF/UNIX/INET name
titleTitle to be inserted in grid file
pvecPartition weight ( if 1: point in current partition, if 0 point not in current partition if > 0 && < 1 point on/near boundary )

Definition at line 1206 of file vgrid.c.

◆ Vgrid_writeDXBIN()

VEXTERNC void Vgrid_writeDXBIN ( Vgrid thee,
const char *  iodev,
const char *  iofmt,
const char *  thost,
const char *  fname,
char *  title,
double *  pvec 
)

Write out the binary data in OpenDX grid format.

Author
Nathan Baker
Parameters
theeGrid object
iodevOutput device type (FILE/BUFF/UNIX/INET)
iofmtOutput device format (ASCII/XDR)
thostOutput hostname (for sockets)
fnameOutput FILE/BUFF/UNIX/INET name
titleTitle to be inserted in grid file
pvecPartition weight ( if 1: point in current partition, if 0 point not in current partition if > 0 && < 1 point on/near boundary )

Definition at line 1458 of file vgrid.c.

◆ Vgrid_writeUHBD()

VEXTERNC void Vgrid_writeUHBD ( Vgrid thee,
const char *  iodev,
const char *  iofmt,
const char *  thost,
const char *  fname,
char *  title,
double *  pvec 
)

Write out the data in UHBD grid format.

Note
  • The mesh spacing should be uniform
  • Format changed from %12.6E to %12.5E
Author
Nathan Baker
Parameters
theeGrid object
iodevOutput device type (FILE/BUFF/UNIX/INET)
iofmtOutput device format (ASCII/XDR)
thostOutput hostname (for sockets)
fnameOutput FILE/BUFF/UNIX/INET name
titleTitle to be inserted in grid file
pvecPartition weight ( if 1: point in current partition, if 0 point not in current partition if > 0 && < 1 point on/near boundary )
Bug:
This routine does not respect partition information

Definition at line 1692 of file vgrid.c.