APBS  1.5
vgrid.h
Go to the documentation of this file.
1 
62 #ifndef _VGRID_H_
63 #define _VGRID_H_
64 
65 #include "apbscfg.h"
66 
67 #include "maloc/maloc.h"
68 
69 #include "generic/vhal.h"
70 #include "generic/vstring.h"
71 
74 #define VGRID_DIGITS 6
75 
81 struct sVgrid {
82 
83  int nx;
84  int ny;
85  int nz;
86  double hx;
87  double hy;
88  double hzed;
89  double xmin;
90  double ymin;
91  double zmin;
92  double xmax;
93  double ymax;
94  double zmax;
95  double *data;
96  int readdata;
97  int ctordata;
99  Vmem *mem;
100 };
101 
106 typedef struct sVgrid Vgrid;
107 
108 #if !defined(VINLINE_VGRID)
109 
117  VEXTERNC unsigned long int Vgrid_memChk(Vgrid *thee);
118 
119 #else /* if defined(VINLINE_VGRID) */
120 
128 #define Vgrid_memChk(thee) (Vmem_bytes((thee)->vmem))
129 
130 #endif /* if !defined(VINLINE_VPMG) */
131 
149 VEXTERNC Vgrid* Vgrid_ctor(int nx, int ny, int nz,
150  double hx, double hy, double hzed,
151  double xmin, double ymin, double zmin,
152  double *data);
153 
172 VEXTERNC int Vgrid_ctor2(Vgrid *thee, int nx, int ny, int nz,
173  double hx, double hy, double hzed,
174  double xmin, double ymin, double zmin,
175  double *data);
176 
185 VEXTERNC int Vgrid_value(Vgrid *thee, double x[3], double *value);
186 
192 VEXTERNC void Vgrid_dtor(Vgrid **thee);
193 
199 VEXTERNC void Vgrid_dtor2(Vgrid *thee);
200 
214 VEXTERNC int Vgrid_curvature(Vgrid *thee, double pt[3], int cflag,
215  double *curv);
216 
225 VEXTERNC int Vgrid_gradient(Vgrid *thee, double pt[3], double grad[3] );
226 
231 VEXTERNC int Vgrid_readGZ(
232  Vgrid *thee,
233  const char *fname
234  );
235 
239 VEXTERNC void Vgrid_writeGZ(
240  Vgrid *thee,
241  const char *iodev,
242  const char *iofmt,
243  const char *thost,
244  const char *fname,
245  char *title,
246  double *pvec
247  );
248 
266 VEXTERNC void Vgrid_writeUHBD(Vgrid *thee, const char *iodev,
267  const char *iofmt, const char *thost, const char *fname, char *title,
268  double *pvec);
269 
284 VEXTERNC void Vgrid_writeDX(Vgrid *thee, const char *iodev,
285  const char *iofmt, const char *thost, const char *fname, char *title,
286  double *pvec);
287 
299 VEXTERNC int Vgrid_readDX(Vgrid *thee, const char *iodev, const char *iofmt,
300  const char *thost, const char *fname);
301 
316 VEXTERNC void Vgrid_writeDXBIN(Vgrid *thee, const char *iodev,
317  const char *iofmt, const char *thost, const char *fname, char *title,
318  double *pvec);
319 
320 
332 VEXTERNC int Vgrid_readDXBIN(Vgrid *thee, const char *iodev, const char *iofmt,
333  const char *thost, const char *fname);
334 
341 VEXTERNC double Vgrid_integrate(Vgrid *thee);
342 
351 VEXTERNC double Vgrid_normL1(Vgrid *thee);
352 
361 VEXTERNC double Vgrid_normL2(Vgrid *thee);
362 
371 VEXTERNC double Vgrid_normLinf(Vgrid *thee);
372 
382 VEXTERNC double Vgrid_seminormH1(Vgrid *thee);
383 
394 VEXTERNC double Vgrid_normH1(Vgrid *thee);
395 
396 #endif
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.
Definition: vgrid.c:1458
double xmin
Definition: vgrid.h:89
VEXTERNC double Vgrid_normH1(Vgrid *thee)
Get the norm (or energy norm) of the data. This returns the integral: .
Definition: vgrid.c:1931
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.
Definition: vgrid.c:1206
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.
Definition: vgrid.c:1692
VEXTERNC double Vgrid_normL1(Vgrid *thee)
Get the norm of the data. This returns the integral: .
Definition: vgrid.c:1828
double ymax
Definition: vgrid.h:93
VEXTERNC void Vgrid_dtor(Vgrid **thee)
Object destructor.
Definition: vgrid.c:152
VEXTERNC double Vgrid_normLinf(Vgrid *thee)
Get the norm of the data. This returns the integral: .
Definition: vgrid.c:1946
Electrostatic potential oracle for Cartesian mesh data.
Definition: vgrid.h:81
VEXTERNC int Vgrid_readGZ(Vgrid *thee, const char *fname)
Read in OpenDX data in GZIP format.
Definition: vgrid.c:462
int ny
Definition: vgrid.h:84
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.
Definition: vgrid.c:810
int nz
Definition: vgrid.h:85
VEXTERNC void Vgrid_writeGZ(Vgrid *thee, const char *iodev, const char *iofmt, const char *thost, const char *fname, char *title, double *pvec)
Write out OpenDX data in GZIP format.
Definition: vgrid.c:1011
VEXTERNC int Vgrid_curvature(Vgrid *thee, double pt[3], int cflag, double *curv)
Get second derivative values at a point.
Definition: vgrid.c:299
double * data
Definition: vgrid.h:95
double xmax
Definition: vgrid.h:92
int nx
Definition: vgrid.h:83
VEXTERNC void Vgrid_dtor2(Vgrid *thee)
FORTRAN stub object destructor.
Definition: vgrid.c:165
VEXTERNC double Vgrid_integrate(Vgrid *thee)
Get the integral of the data.
Definition: vgrid.c:1790
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)
Definition: vgrid.c:112
int ctordata
Definition: vgrid.h:97
Contains declarations for class Vstring.
VEXTERNC int Vgrid_gradient(Vgrid *thee, double pt[3], double grad[3])
Get first derivative values at a point.
Definition: vgrid.c:379
Vmem * mem
Definition: vgrid.h:99
VEXTERNC unsigned long int Vgrid_memChk(Vgrid *thee)
Return the memory used by this structure (and its contents) in bytes.
Definition: vgrid.c:63
Contains generic macro definitions for APBS.
double zmin
Definition: vgrid.h:91
int readdata
Definition: vgrid.h:96
double ymin
Definition: vgrid.h:90
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.
Definition: vgrid.c:586
VEXTERNC double Vgrid_normL2(Vgrid *thee)
Get the norm of the data. This returns the integral: .
Definition: vgrid.c:1858
VEXTERNC double Vgrid_seminormH1(Vgrid *thee)
Get the semi-norm of the data. This returns the integral: .
Definition: vgrid.c:1888
VEXTERNC int Vgrid_value(Vgrid *thee, double x[3], double *value)
Get potential value (from mesh or approximation) at a point.
Definition: vgrid.c:179
double hy
Definition: vgrid.h:87
double hzed
Definition: vgrid.h:88
double hx
Definition: vgrid.h:86
double zmax
Definition: vgrid.h:94
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)
Definition: vgrid.c:86