00001
00055 #ifndef _VGRID_H_
00056 #define _VGRID_H_
00057
00058 #include "maloc/maloc.h"
00059 #include "apbs/vhal.h"
00060 #include "apbs/vstring.h"
00061
00062
00065 #define VGRID_DIGITS 6
00066
00072 struct sVgrid {
00073
00074 int nx;
00075 int ny;
00076 int nz;
00077 double hx;
00078 double hy;
00079 double hzed;
00080 double xmin;
00081 double ymin;
00082 double zmin;
00083 double xmax;
00084 double ymax;
00085 double zmax;
00086 double *data;
00087 int readdata;
00088 int ctordata;
00090 Vmem *mem;
00091 };
00092
00097 typedef struct sVgrid Vgrid;
00098
00099 #if !defined(VINLINE_VGRID)
00100
00108 VEXTERNC unsigned long int Vgrid_memChk(Vgrid *thee);
00109
00110 #else
00111
00119 # define Vgrid_memChk(thee) (Vmem_bytes((thee)->vmem))
00120
00121 #endif
00122
00140 VEXTERNC Vgrid* Vgrid_ctor(int nx, int ny, int nz,
00141 double hx, double hy, double hzed,
00142 double xmin, double ymin, double zmin,
00143 double *data);
00144
00163 VEXTERNC int Vgrid_ctor2(Vgrid *thee, int nx, int ny, int nz,
00164 double hx, double hy, double hzed,
00165 double xmin, double ymin, double zmin,
00166 double *data);
00167
00176 VEXTERNC int Vgrid_value(Vgrid *thee, double x[3], double *value);
00177
00183 VEXTERNC void Vgrid_dtor(Vgrid **thee);
00184
00190 VEXTERNC void Vgrid_dtor2(Vgrid *thee);
00191
00205 VEXTERNC int Vgrid_curvature(Vgrid *thee, double pt[3], int cflag,
00206 double *curv);
00207
00216 VEXTERNC int Vgrid_gradient(Vgrid *thee, double pt[3], double grad[3] );
00217
00222 VEXTERNC int Vgrid_readGZ(
00223 Vgrid *thee,
00224 const char *fname
00225 );
00226
00230 VEXTERNC void Vgrid_writeGZ(
00231 Vgrid *thee,
00232 const char *iodev,
00233 const char *iofmt,
00234 const char *thost,
00235 const char *fname,
00236 char *title,
00237 double *pvec
00238 );
00239
00257 VEXTERNC void Vgrid_writeUHBD(Vgrid *thee, const char *iodev,
00258 const char *iofmt, const char *thost, const char *fname, char *title,
00259 double *pvec);
00260
00275 VEXTERNC void Vgrid_writeDX(Vgrid *thee, const char *iodev,
00276 const char *iofmt, const char *thost, const char *fname, char *title,
00277 double *pvec);
00278
00290 VEXTERNC int Vgrid_readDX(Vgrid *thee, const char *iodev, const char *iofmt,
00291 const char *thost, const char *fname);
00292
00299 VEXTERNC double Vgrid_integrate(Vgrid *thee);
00300
00309 VEXTERNC double Vgrid_normL1(Vgrid *thee);
00310
00319 VEXTERNC double Vgrid_normL2(Vgrid *thee);
00320
00329 VEXTERNC double Vgrid_normLinf(Vgrid *thee);
00330
00340 VEXTERNC double Vgrid_seminormH1(Vgrid *thee);
00341
00352 VEXTERNC double Vgrid_normH1(Vgrid *thee);
00353
00354 #endif