APBS 3.0.0
Loading...
Searching...
No Matches
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
81struct 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;
99 Vmem *mem;
100};
101
106typedef 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
149VEXTERNC 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
172VEXTERNC 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
185VEXTERNC int Vgrid_value(Vgrid *thee, double x[3], double *value);
186
192VEXTERNC void Vgrid_dtor(Vgrid **thee);
193
199VEXTERNC void Vgrid_dtor2(Vgrid *thee);
200
214VEXTERNC int Vgrid_curvature(Vgrid *thee, double pt[3], int cflag,
215 double *curv);
216
225VEXTERNC int Vgrid_gradient(Vgrid *thee, double pt[3], double grad[3] );
226
231VEXTERNC int Vgrid_readGZ(
232 Vgrid *thee,
233 const char *fname
234 );
235
239VEXTERNC 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
266VEXTERNC void Vgrid_writeUHBD(Vgrid *thee, const char *iodev,
267 const char *iofmt, const char *thost, const char *fname, char *title,
268 double *pvec);
269
284VEXTERNC void Vgrid_writeDX(Vgrid *thee, const char *iodev,
285 const char *iofmt, const char *thost, const char *fname, char *title,
286 double *pvec);
287
299VEXTERNC int Vgrid_readDX(Vgrid *thee, const char *iodev, const char *iofmt,
300 const char *thost, const char *fname);
301
316VEXTERNC 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
332VEXTERNC int Vgrid_readDXBIN(Vgrid *thee, const char *iodev, const char *iofmt,
333 const char *thost, const char *fname);
334
341VEXTERNC double Vgrid_integrate(Vgrid *thee);
342
351VEXTERNC double Vgrid_normL1(Vgrid *thee);
352
361VEXTERNC double Vgrid_normL2(Vgrid *thee);
362
371VEXTERNC double Vgrid_normLinf(Vgrid *thee);
372
382VEXTERNC double Vgrid_seminormH1(Vgrid *thee);
383
394VEXTERNC double Vgrid_normH1(Vgrid *thee);
395
396#endif
VEXTERNC void Vgrid_dtor(Vgrid **thee)
Object destructor.
Definition vgrid.c:152
VEXTERNC unsigned long int Vgrid_memChk(Vgrid *thee)
Return the memory used by this structure (and its contents) in bytes.
Definition vgrid.c:63
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
VEXTERNC double Vgrid_normLinf(Vgrid *thee)
Get the norm of the data. This returns the integral:
Definition vgrid.c:1946
VEXTERNC double Vgrid_integrate(Vgrid *thee)
Get the integral of the data.
Definition vgrid.c:1790
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 int Vgrid_gradient(Vgrid *thee, double pt[3], double grad[3])
Get first derivative values at a point.
Definition vgrid.c:379
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
VEXTERNC void Vgrid_dtor2(Vgrid *thee)
FORTRAN stub object destructor.
Definition vgrid.c:165
VEXTERNC double Vgrid_normL1(Vgrid *thee)
Get the norm of the data. This returns the integral:
Definition vgrid.c:1828
VEXTERNC int Vgrid_curvature(Vgrid *thee, double pt[3], int cflag, double *curv)
Get second derivative values at a point.
Definition vgrid.c:299
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 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
VEXTERNC int Vgrid_readGZ(Vgrid *thee, const char *fname)
Read in OpenDX data in GZIP format.
Definition vgrid.c:462
VEXTERNC double Vgrid_normH1(Vgrid *thee)
Get the norm (or energy norm) of the data. This returns the integral:
Definition vgrid.c:1931
VEXTERNC double Vgrid_normL2(Vgrid *thee)
Get the norm of the data. This returns the integral:
Definition vgrid.c:1858
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 int Vgrid_value(Vgrid *thee, double x[3], double *value)
Get potential value (from mesh or approximation) at a point.
Definition vgrid.c:179
VEXTERNC double Vgrid_seminormH1(Vgrid *thee)
Get the semi-norm of the data. This returns the integral:
Definition vgrid.c:1888
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
Electrostatic potential oracle for Cartesian mesh data.
Definition vgrid.h:81
int nx
Definition vgrid.h:83
double hx
Definition vgrid.h:86
double hy
Definition vgrid.h:87
Vmem * mem
Definition vgrid.h:99
double * data
Definition vgrid.h:95
double xmax
Definition vgrid.h:92
double ymin
Definition vgrid.h:90
int ny
Definition vgrid.h:84
double zmin
Definition vgrid.h:91
double xmin
Definition vgrid.h:89
int readdata
Definition vgrid.h:96
int nz
Definition vgrid.h:85
int ctordata
Definition vgrid.h:97
double zmax
Definition vgrid.h:94
double hzed
Definition vgrid.h:88
double ymax
Definition vgrid.h:93
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
Contains generic macro definitions for APBS.
Contains declarations for class Vstring.