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

ArbitraryCartesianGrid3D.h

00001 /****************************************************************************
00002  *                                                                          *
00003  *  Program: FDDlib                                                         *
00004  *  Version: 1.1                                                            *
00005  *                                                                          *
00006  *  Copyright (C) 2002 - 2004 by Eric Miller and Dana Brooks                *
00007  *  All rights reserved.                                                    *
00008  *                                                                          *
00009  *  This software is Version 1.1 of the fddlib tomography toolbox.          *
00010  *  It is not to be redistributed or used for any commercial purpose        *
00011  *  without the prior written consent of the authors and Northeastern       *
00012  *  University.                                                             *
00013  *                                                                          *
00014  *  This software is provided as is, and any express or implied warranties, *
00015  *  including but not limited to the implied warranty of merchantability    *
00016  *  and the implied warranty of fitness for a particular purpose, are dis-  *
00017  *  claimed.  In no event shall the authors or Northeastern University be   *
00018  *  liable for any direct, indirect, incidental, special, exemplary, or     *
00019  *  consequential damages (including but not limited to procurement of      * 
00020  *  substitute goods or services; loss of use, data, or profits; or busi-   *
00021  *  ness interruption) however caused and on any theory of liability,       *
00022  *  whether in contract, strict liability, or tort (including negligence or *
00023  *  otherwise) arising in any way from the use of this software, even if    *
00024  *  advised of the possibility of such damage.                              *
00025  *                                                                          *
00026  *  Portions of this code benefit from ideas from Kyle Guilbert, Greg       *
00027  *  Boverman, Derek Uluski, David Kaeli, and Jennifer Black                 *
00028  *                                                                          *
00029  ****************************************************************************/
00030 
00031 #ifndef _ARBCART_GRID3D_H_
00032 #define _ARBCART_GRID3D_H_
00033 
00034 #include <vector>
00035 #include <string>
00036 #include <list>
00037 #include "CartesianNode3D.h"
00038 #include "grid_enums.h"
00039 #include "Anomaly3D.h"
00040 
00041 namespace FDDlib {
00042 
00049 class ArbitraryCartesianGrid3D {
00050 public:
00051   
00053   static const int DEFAULT_SPACING = 1;
00054 
00055 protected:
00056   
00058   int numx_;
00059 
00061   int numy_;
00062 
00064   int numz_;
00065   
00069   struct s_offsets {
00071     int xoffset;
00072 
00074     int yoffset;
00075 
00077     int zoffset;
00078   };
00079 
00081   std::vector<CartesianNode3D> nodeList_;
00082   
00084   double energySpeed_;
00085   
00087   int numActiveNodes_;
00088   
00090   std::vector<double> deltax;
00091 
00093   std::vector<double> deltay;
00094 
00096   std::vector<double> deltaz;
00097 
00099   void setupNodes() throw(std::string);
00100   
00102   static const int UNKNOWN_NUMACTIVE = -1;
00103   
00104 public:
00105 
00114   ArbitraryCartesianGrid3D(int numx, int numy, int numz, 
00115                   double energySpeed) throw(std::string);
00116   
00128   ArbitraryCartesianGrid3D(int numx, int numy, int numz, 
00129                   double energySpeed, 
00130                   const std::vector<double> &dx,
00131                   const std::vector<double> &dy,
00132                   const std::vector<double> &dz) throw(std::string);
00133 
00135   virtual ~ArbitraryCartesianGrid3D();
00136   
00146   void setDelta(const std::vector<double> &dx, 
00147                 const std::vector<double> &dy, 
00148                 const std::vector<double> &dz) throw(std::string);
00149   
00151   std::vector<double> getDxList() const;
00152 
00154   std::vector<double> getDyList() const;
00155 
00157   std::vector<double> getDzList() const;
00158 
00160   virtual double averageDx() const;
00161   
00163   virtual double averageDy() const;
00164   
00166   virtual double averageDz() const;
00167   
00169   int numX() const;
00170   
00172   int numY() const;
00173   
00175   int numZ() const;
00176   
00191   virtual void computeNormals(int maxneighbors, int order, double tol)
00192     throw(std::string);
00193   
00201   virtual void analyticalNormals() throw(std::string);
00202   
00206   std::list<CartesianNode3D*> getBorderBySide(gridSide3D side) const;
00207 
00209   std::list<CartesianNode3D*> getAllBorders() const;
00210   
00219   int offsetsToIndex(int xoffset, int yoffset, int zoffset) const throw(std::string);
00220 
00222   CartesianNode3D* getNode(int ind) const throw(std::string);
00223 
00225   int numNodes() const;
00226 
00230   void fillUniformProperty(Property* prop) throw(std::string);
00231 
00236   void insertAnomaly(const Anomaly3D& anom);
00237 
00239   void setEnergySpeed(double energySpeed);
00240 
00242   double getEnergySpeed() const;
00243 
00247   int numActiveNodes() const throw(std::string);
00248 
00250   void generateLinearIndices();
00251   
00260   void createLayeredBackground(const std::vector<Property*> &proplist,
00261        const std::vector<int> &zdepthlist) throw(std::string);
00262 
00264   int numBorderNodes() const;
00265 
00266 };
00267 
00268 } // end namespace
00269 
00270 #endif

Generated on Mon Aug 30 15:41:05 2004 for FDDLib by doxygen1.2.18