Data Structures | Files | Defines | Typedefs | Functions

Vgrid class

Oracle for Cartesian mesh data. More...

Data Structures

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

Files

file  vgrid.h
 

Potential oracle for Cartesian mesh data.


file  vgrid.c
 

Class Vgrid methods.


Defines

#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.
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)
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)
VEXTERNC int Vgrid_value (Vgrid *thee, double x[3], double *value)
 Get potential value (from mesh or approximation) at a point.
VEXTERNC void Vgrid_dtor (Vgrid **thee)
 Object destructor.
VEXTERNC void Vgrid_dtor2 (Vgrid *thee)
 FORTRAN stub object destructor.
VEXTERNC int Vgrid_curvature (Vgrid *thee, double pt[3], int cflag, double *curv)
 Get second derivative values at a point.
VEXTERNC int Vgrid_gradient (Vgrid *thee, double pt[3], double grad[3])
 Get first derivative values at a point.
VEXTERNC int Vgrid_readGZ (Vgrid *thee, const char *fname)
 Read in OpenDX data in GZIP format.
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.
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.
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.
VEXTERNC double Vgrid_integrate (Vgrid *thee)
 Get the integral of the data.
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 \]

.

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} \]

.

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) | \]

.

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} \]

.

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} \]

.


Detailed Description

Oracle for Cartesian mesh data.


Function Documentation

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 70 of file vgrid.c.

Here is the caller graph for this function:

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 89 of file vgrid.c.

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 274 of file vgrid.c.

Here is the caller graph for this function:

VEXTERNC void Vgrid_dtor ( Vgrid **  thee )

Object destructor.

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

Definition at line 129 of file vgrid.c.

Here is the caller graph for this function:

VEXTERNC void Vgrid_dtor2 ( Vgrid thee )

FORTRAN stub object destructor.

Author:
Nathan Baker
Parameters:
theePointer to object to be destroyed

Definition at line 142 of file vgrid.c.

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 354 of file vgrid.c.

Here is the caller graph for this function:

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 1320 of file vgrid.c.

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 55 of file vgrid.c.

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 1457 of file vgrid.c.

Here is the call graph for this function:

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 1357 of file vgrid.c.

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 1386 of file vgrid.c.

Here is the caller graph for this function:

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 1472 of file vgrid.c.

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

Definition at line 555 of file vgrid.c.

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 437 of file vgrid.c.

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 1415 of file vgrid.c.

Here is the call graph for this function:

Here is the caller graph for this function:

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 156 of file vgrid.c.

Here is the caller graph for this function:

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 973 of file vgrid.c.

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 1223 of file vgrid.c.