Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

HaField3D Class Reference

Class for a scalar field on a rectangular grid. More...

#include <hasurface.h>

Inheritance diagram for HaField3D:

List of all members.

Public Member Functions

virtual void clear ()
 erase the field and deallocate the memory it takes

void FillZeros ()
 Fill the field with zeros.

int SaveToFile (const char *fname, int binary=TRUE)
 Save the field to a file.

int RestoreFromFile (const char *fname, int binary=TRUE)
 Restor the field from a file.

virtual void copy_from (const HaField3D &ref_field)
virtual bool SetDimensions (int new_Nx, int new_Ny, int new_Nz)
 Set the grid dimensions.

int GetNx () const
 return number of grid points along X axes

int GetNy () const
 return number of grid points along Y axes

int GetNz () const
 return number of grid points along Z axes

double GetXmin () const
 return Min X coordinate of the grid

double GetYmin () const
 return Min Y coordinate of the grid

double GetZmin () const
 return Min Z coordinate of the grid

double GetXmax () const
 return Max X coordinate of the grid

double GetYmax () const
 return Max Y coordinate of the grid

double GetZmax () const
 return Max Z coordinate of the grid

double GetXstep () const
 return the length of the step along X axes

double GetYstep () const
 return the length of the step along Y axes

double GetZstep () const
 return the length of the step along Z axes

bool SetGridCornersCoord (double xmin_new, double ymin_new, double zmin_new, double xmax_new, double ymax_new, double zmax_new)
 set min and max expansions of the grid

int GetLinIdx (int ix, int iy, int iz)
 Get linear index of the point of the grid.

float * GetFieldPtr ()
 Get the pointer to the beginning of the grid data.

bool GetXYZ (float &x, float &y, float &z, const int ix, const int iy, const int iz)
 get cartesian coordinates of the point of the grid with grid indexes (ix,iy,iz)

float * GetValPtr (int ix, int iy, int iz)
 get pointer to the value of the field at the grid point

float GetValue (int ix, int iy, int iz)
void SetValue (int ix, int iy, int iz, float val)
 Set Value of the grid point.

int GetClosestGridPoint (double x, double y, double z, int &ix, int &iy, int &iz)
double GetInterpolValAtPoint (double x, double y, double z)
 Interpolate the value of the field in the point.

bool grid_to_xyz_float (const int numverts, const float *vr, const float *vc, const float *vl, float *xyz_coord)
 convert vertices from grid to (x,y,z) coordinates


Protected Attributes

float xmin
float xmax
 grid maximum and minimum expansions along X axes

float ymin
float ymax
 grid maximum and minimum expansions along Y axes

float zmin
float zmax
 grid maximum and minimum expansions along Z axes

float xstep
 grid step along X axes

float ystep
 grid step along Y axes

float zstep
 grid step along Z axes

int m_Nx
int m_Ny
int m_Nz
 Grid dimensions along X,Y and Z axes.

HaVec_float m_field_data
 Linear array of the field data.


Detailed Description

Class for a scalar field on a rectangular grid.


Member Function Documentation

float HaField3D::GetValue int  ix,
int  iy,
int  iz
 

get Value of the field at the grid point (1 - based indexing) < first point of the grid is (1,1,1)

int HaField3D::GetClosestGridPoint double  x,
double  y,
double  z,
int &  ix,
int &  iy,
int &  iz
 

get a grid vertex closest to < the given point (x,y,z)


The documentation for this class was generated from the following files:
Generated on Tue Feb 17 02:03:17 2004 for harlem by doxygen 1.3.6