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

FDDlib::ArbitraryCartesianGrid3D Class Reference

A semi-regular grid. More...

#include <ArbitraryCartesianGrid3D.h>

Inheritance diagram for FDDlib::ArbitraryCartesianGrid3D:

FDDlib::RegularCartesianGrid3D List of all members.

Public Methods

 ArbitraryCartesianGrid3D (int numx, int numy, int numz, double energySpeed) throw (std::string)
 Constructor.

 ArbitraryCartesianGrid3D (int numx, int numy, int numz, double energySpeed, const std::vector< double > &dx, const std::vector< double > &dy, const std::vector< double > &dz) throw (std::string)
 Constructor.

virtual ~ArbitraryCartesianGrid3D ()
 Destructor.

void setDelta (const std::vector< double > &dx, const std::vector< double > &dy, const std::vector< double > &dz) throw (std::string)
 Set the grid distance (delta) lists.

std::vector< double > getDxList () const
 Returns the DeltaX list.

std::vector< double > getDyList () const
 Returns the DeltaY list.

std::vector< double > getDzList () const
 Returns the DeltaZ list.

virtual double averageDx () const
 Get the average Dx value.

virtual double averageDy () const
 Get the average Dy value.

virtual double averageDz () const
 Get the average Dz value.

int numX () const
 number of nodes in the X direction

int numY () const
 number of nodes in the Y direction

int numZ () const
 number of nodes in the Z direction

virtual void computeNormals (int maxneighbors, int order, double tol) throw (std::string)
 Compute the normal vectors of all boundary nodes.

virtual void analyticalNormals () throw (std::string)
 Compute the normal vectors analytically.

std::list< CartesianNode3D * > getBorderBySide (gridSide3D side) const
 Gets a list of nodes that are on a given side of the grid.

std::list< CartesianNode3D * > getAllBorders () const
 Get a list of all border nodes.

int offsetsToIndex (int xoffset, int yoffset, int zoffset) const throw (std::string)
 Convert the offset of a node (in 3D) from node zero to its index.

CartesianNode3DgetNode (int ind) const throw (std::string)
 Get a pointer to a node by its index.

int numNodes () const
 Get the number of nodes.

void fillUniformProperty (Property *prop) throw (std::string)
 Fill the grid with a constant property.

void insertAnomaly (const Anomaly3D &anom)
 Insert an anomaly into the grid.

void setEnergySpeed (double energySpeed)
 Set the speed of energy propagation through the grid.

double getEnergySpeed () const
 Get the speed of energy propagation.

int numActiveNodes () const throw (std::string)
 Get the number of active nodes in the grid
Exceptions:
string  if the active node count has not been calculated.


void generateLinearIndices ()
 Generate linear indices for all nodes. This also calculates numActiveNodes().

void createLayeredBackground (const std::vector< Property * > &proplist, const std::vector< int > &zdepthlist) throw (std::string)
 Create a layered background.

int numBorderNodes () const
 Count and return the number of border nodes.


Static Public Attributes

const int DEFAULT_SPACING = 1
 The default unit spacing between nodes (if no delta lists are provided).


Protected Methods

void setupNodes () throw (std::string)
 Destructively sets up the node data to correspond with our delta lists.


Protected Attributes

int numx_
 number of nodes in the x direction

int numy_
 number of nodes in the y direction

int numz_
 number of nodes in the z direction

std::vector< CartesianNode3DnodeList_
 the list of nodes. Each node includes location and property data

double energySpeed_
 the nominal speed of energy propagation through the medium

int numActiveNodes_
 number of nodes in the grid with an active property

std::vector< double > deltax
 distances between nodes in x direction

std::vector< double > deltay
 distances between nodes in y direction

std::vector< double > deltaz
 distances between nodes in z direction


Static Protected Attributes

const int UNKNOWN_NUMACTIVE = -1
 the number given to numActivePoints_ when it has not been calculated


Detailed Description

A semi-regular grid.

Nodes are connected in rectangular patterns rather than arbitrarily.

Author:
Kyle Guilbert


Constructor & Destructor Documentation

FDDlib::ArbitraryCartesianGrid3D::ArbitraryCartesianGrid3D int    numx,
int    numy,
int    numz,
double    energySpeed
throw (std::string)
 

Constructor.

Since it is unlikely the grid distances will be available at the time of construction, we will set that data later.

Parameters:
numx  number of nodes in the x direction. Range: [1, inf)
numy  number of nodes in the y direction. Range: [1, inf)
numz  number of nodes in the z direction. Range: [1, inf)
energySpeed  nominal speed of the radiation through this grid

FDDlib::ArbitraryCartesianGrid3D::ArbitraryCartesianGrid3D int    numx,
int    numy,
int    numz,
double    energySpeed,
const std::vector< double > &    dx,
const std::vector< double > &    dy,
const std::vector< double > &    dz
throw (std::string)
 

Constructor.

Since it is unlikely the grid distances will be available at the time of construction, we will set that data later.

Parameters:
numx  number of nodes in the x direction. Range: [1, inf)
numy  number of nodes in the y direction. Range: [1, inf)
numz  number of nodes in the z direction. Range: [1, inf)
energySpeed  nominal speed of the radiation through this grid
dx  deltax list
dy  deltay list
dz  deltaz list


Member Function Documentation

virtual void FDDlib::ArbitraryCartesianGrid3D::analyticalNormals   throw (std::string) [virtual]
 

Compute the normal vectors analytically.

This only works if we are not using irregular boundaries (the condition where the number of active nodes equals the number of total nodes). This is called from computeNormals() if this condition is found to be true.

Exceptions:
string  if (numActivePoints() != numPoints()), i.e. if there are any nodes with inactive properties in the grid.

virtual void FDDlib::ArbitraryCartesianGrid3D::computeNormals int    maxneighbors,
int    order,
double    tol
throw (std::string) [virtual]
 

Compute the normal vectors of all boundary nodes.

Basically, we first populate a sparse matrix giving the Hamming distance of each boundary node from its neighbors. Then we fit a polynomial surface at that node, and compute the normal by taking the cross- product of two tangents. Then we verify that the normal vector is nodeing outwards (reversing direction if it is not).

Author:
Greg Boverman
Parameters:
maxneighbors  Maximum number of nearest neighbors. Range: [1, inf)
order  order of the polynomial to use. Range: [1, inf)
tol  Tolerance for acceptance of a solution. Range: [0.0, inf) @bugfix 11/12/02 Normals are now computed correctly.
Exceptions:
string  if any arguments are out of range, or if the estimation was worse than the error tolerance for any nodes.

void FDDlib::ArbitraryCartesianGrid3D::createLayeredBackground const std::vector< Property * > &    proplist,
const std::vector< int > &    zdepthlist
throw (std::string)
 

Create a layered background.

These layers are applied consecutively, with each layer having a depth of its corresponding element in zdepthlist.

Parameters:
proplist  list of property pointers
zdepthlist  list of depths (in z direction)
Exceptions:
string  if vector lengths do not match or if zdepthlist is incomplete (sum of the elements != numZ())

void FDDlib::ArbitraryCartesianGrid3D::fillUniformProperty Property   prop throw (std::string)
 

Fill the grid with a constant property.

Parameters:
prop  the Property to fill

std::list<CartesianNode3D*> FDDlib::ArbitraryCartesianGrid3D::getBorderBySide gridSide3D    side const
 

Gets a list of nodes that are on a given side of the grid.

Parameters:
side  the grid side we are looking for

void FDDlib::ArbitraryCartesianGrid3D::insertAnomaly const Anomaly3D   anom
 

Insert an anomaly into the grid.

This effects the Property of every node in the grid which the anomaly encloses.

Parameters:
anom  the Anomaly3D

int FDDlib::ArbitraryCartesianGrid3D::offsetsToIndex int    xoffset,
int    yoffset,
int    zoffset
const throw (std::string)
 

Convert the offset of a node (in 3D) from node zero to its index.

Parameters:
xoffset  X offset (range: 0 through numX()-1)
yoffset  Y offset (range: 0 through numY()-1)
zoffset  Z offset (range: 0 through numZ()-1)
Returns:
position this represents in the node list
Exceptions:
string  if invalid parameters or result out of range @bugfix 11/12/02 Parameters are now sufficiently error-checked

void FDDlib::ArbitraryCartesianGrid3D::setDelta const std::vector< double > &    dx,
const std::vector< double > &    dy,
const std::vector< double > &    dz
throw (std::string)
 

Set the grid distance (delta) lists.

The number of elements in each array should be one less than the number of nodes in the respective dimension (i.e. dx should have numx-1 elements). Note that these values are copied into this object.

Parameters:
dx  DeltaX list. Range for each element: (0.0, inf)
dy  DeltaY list. Range for each element: (0.0, inf)
dz  DeltaZ list. Range for each element: (0.0, inf)
Exceptions:
string  if invalid value(s) are found.


The documentation for this class was generated from the following file:
Generated on Mon Aug 30 15:41:09 2004 for FDDLib by doxygen1.2.18