Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

GridScatPt Class Reference

grid consisting of arbitrary discrete points. More...

#include <GridScatPt.h>

Inheritance diagram for GridScatPt::

GridWithPts Grid HandleId List of all members.

Public Methods

 GridScatPt ()
 ~GridScatPt ()
bool redim (int nsd, int npoints)
bool ok () const
virtual void scan (Is is)
Ptv(real) getPt (int i) const
void setPt (int i, const Ptv(real) ptcoor)
virtual void print (Os os) const
virtual int nearestPoint (const Ptv(real) &point, real &distance, bool &exact)
virtual int getNoPoints () const
virtual void startIterator ()
virtual bool nextPt (Ptv(real) &x)
virtual int getNoSpaceDim () const
virtual void getMinMaxCoord (Ptv(real) &mincoord, Ptv(real) &maxcoord) const
virtual void scale ()
virtual void unscale ()

Detailed Description

grid consisting of arbitrary discrete points.

NAME: GridScatPt - grid consisting of arbitrary discrete points

DESCRIPTION:

The class represents a collection of scattered points in space. Together with class "FieldScatPt" the grid is used to represent fields over scattered points.

The application of the class is not limited to fields over scattered points. If one needs to specify a set of ""arbitrary"" points, e.g., chosen by the user at run time, "GridScatPt" can read and hold the point data. For example, it is used in class "Store4Plotting" for reading and holding at set of spatial points at which the time evolution of fields are to be plotted.


Constructor & Destructor Documentation

GridScatPt::GridScatPt ( )
 

The constructor takes no arguments. To initialize the object it is necessary to call "redim" and give the proper number of scattered points that make up the grid. After "redim" is called, "ok" will return a true value. The coordinates of the points are read by the "scan" function in a compact format.

GridScatPt::~GridScatPt ( ) [inline]
 


Member Function Documentation

void GridScatPt::getMinMaxCoord ( Ptv(real) & mincoord,
Ptv(real) & maxcoord ) const [virtual]
 

returns the hypercube (with respect to the Cartesian coordinate system where the grid coordinates are defined) that encloses the grid. This function is only meaningful if the grid represents some kind of geometry in the problem.

Reimplemented from GridWithPts.

int GridScatPt::getNoPoints ( ) const [virtual]
 

Reimplemented from GridWithPts.

int GridScatPt::getNoSpaceDim ( ) const [virtual]
 

returns the number of space dimensions associated with the grid.

Reimplemented from GridWithPts.

Ptv(real) GridScatPt::getPt ( int i ) const
 

returns the coordinates of a grid point. The point is given by its point number.

int GridScatPt::nearestPoint ( const Ptv(real) & point,
real & distance,
bool & exact ) [virtual]
 

computes the grid point that is nearest to an arbitrarily given point. The input argument is the specified point, while the output arguments are the distance to the point and a boolean variable indicating if the given point coincides with one of the grid points. If the boolean value is true, the distance to the point is zero. The return value is the point number of the point that is nearest to the specified point. There are some overloaded versions of "nearestPoint". These are aimed at various search algorithms required by "valuePt" in finite element meshes.

Reimplemented from GridWithPts.

bool GridScatPt::nextPt ( Ptv(real) & x ) [virtual]
 

gives the coordinates of the next point in the grid. The return value is false when there are no more points in the grid. Here is an example on iteration over the grid points:

      grid.startIterator(); 
      while (grid.nextPt(p)) 
        { .... }

Reimplemented from GridWithPts.

bool GridScatPt::ok ( ) const
 

void GridScatPt::print ( Os os ) const [virtual]
 

prints the grid (usually in ascii format).

Reimplemented from Grid.

bool GridScatPt::redim ( int nsd,
int npoints )
 

redimensions the internal data structure. The argument reflects the number of points in the grid.

void GridScatPt::scale ( ) [virtual]
 

Reimplemented from GridWithPts.

void GridScatPt::scan ( Is is ) [virtual]
 

reads the coordinates of the grid points. The input syntax is as follows. First "d=2" is given to indicate the number of space dimensions ("d=2" imply 2D points). Then the number of grid points is given as "n=4". Thereafter each grid point is given in the standard "Ptv(real)" scan format. Here is a possible string:

      d=3 n=2 (1,-1,0) (8,1.1,-9)

Reimplemented from Grid.

void GridScatPt::setPt ( int i,
const Ptv(real) ptcoor )
 

assigns coordinates to a grid point. See "getPt".

void GridScatPt::startIterator ( ) [virtual]
 

initializes an iteration over the grid points.

Reimplemented from GridWithPts.

void GridScatPt::unscale ( ) [virtual]
 

Reimplemented from GridWithPts.


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.