00001
00072 #ifndef _VGRID_H_
00073 #define _VGRID_H_
00074
00075 #include "maloc/maloc.h"
00076 #include "apbs/vhal.h"
00077 #include "apbs/vstring.h"
00078
00079
00082 #define VGRID_DIGITS 6
00083
00089 struct sVgrid {
00090
00091 int nx;
00092 int ny;
00093 int nz;
00094 double hx;
00095 double hy;
00096 double hzed;
00097 double xmin;
00098 double ymin;
00099 double zmin;
00100 double xmax;
00101 double ymax;
00102 double zmax;
00103 double *data;
00104 int readdata;
00105 int ctordata;
00107 Vmem *mem;
00108 };
00109
00114 typedef struct sVgrid Vgrid;
00115
00116 #if !defined(VINLINE_VGRID)
00117
00125 unsigned long int Vgrid_memChk(Vgrid *thee);
00126
00127 #else
00128
00136 # define Vgrid_memChk(thee) (Vmem_bytes((thee)->vmem))
00137
00138 #endif
00139
00157 Vgrid* Vgrid_ctor(int nx, int ny, int nz,
00158 double hx, double hy, double hzed,
00159 double xmin, double ymin, double zmin,
00160 double *data);
00161
00180 int Vgrid_ctor2(Vgrid *thee, int nx, int ny, int nz,
00181 double hx, double hy, double hzed,
00182 double xmin, double ymin, double zmin,
00183 double *data);
00184
00193 int Vgrid_value(Vgrid *thee, double x[3], double *value);
00194
00200 void Vgrid_dtor(Vgrid **thee);
00201
00207 void Vgrid_dtor2(Vgrid *thee);
00208
00222 int Vgrid_curvature(Vgrid *thee, double pt[3], int cflag,
00223 double *curv);
00224
00233 int Vgrid_gradient(Vgrid *thee, double pt[3], double grad[3] );
00234
00252 void Vgrid_writeUHBD(Vgrid *thee, const char *iodev,
00253 const char *iofmt, const char *thost, const char *fname, char *title,
00254 double *pvec);
00255
00270 void Vgrid_writeDX(Vgrid *thee, const char *iodev,
00271 const char *iofmt, const char *thost, const char *fname, char *title,
00272 double *pvec);
00273
00285 int Vgrid_readDX(Vgrid *thee, const char *iodev, const char *iofmt,
00286 const char *thost, const char *fname);
00287
00294 double Vgrid_integrate(Vgrid *thee);
00295
00304 double Vgrid_normL1(Vgrid *thee);
00305
00314 double Vgrid_normL2(Vgrid *thee);
00315
00324 double Vgrid_normLinf(Vgrid *thee);
00325
00335 double Vgrid_seminormH1(Vgrid *thee);
00336
00347 double Vgrid_normH1(Vgrid *thee);
00348
00349 #endif
00350