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

ArbitraryCartesianGrid2D.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_GRID2D_H_
00032 #define _ARBCART_GRID2D_H_
00033 
00034 #include <vector>
00035 #include <string>
00036 #include <list>
00037 #include "CartesianNode2D.h"
00038 #include "grid_enums.h"
00039 #include "Anomaly2D.h"
00040 
00041 namespace FDDlib {
00042 
00049 class ArbitraryCartesianGrid2D {
00050 public:
00051   
00053   static const int DEFAULT_SPACING = 1;
00054 
00055 protected:
00056   
00058   int numx_;
00059 
00061   int numy_;
00062 
00066   struct s_offsets {
00068     int xoffset;
00069 
00071     int yoffset;
00072 
00073   };
00074 
00076   std::vector<CartesianNode2D> nodeList_;
00077   
00079   double energySpeed_;
00080   
00082   int numActiveNodes_;
00083   
00085   std::vector<double> deltax;
00086 
00088   std::vector<double> deltay;
00089 
00091   void setupNodes() throw(std::string);
00092   
00094   static const int UNKNOWN_NUMACTIVE = -1;
00095   
00096 public:
00097 
00105   ArbitraryCartesianGrid2D(int numx, int numy, 
00106                   double energySpeed) throw(std::string);
00107   
00117   ArbitraryCartesianGrid2D(int numx, int numy,
00118                   double energySpeed,
00119                   const std::vector<double> &dx,
00120                   const std::vector<double> &dy) throw(std::string);
00121 
00123   virtual ~ArbitraryCartesianGrid2D();
00124 
00133   void setDelta(const std::vector<double> &dx,
00134                 const std::vector<double> &dy) throw(std::string);
00135   
00137   std::vector<double> getDxList() const;
00138 
00140   std::vector<double> getDyList() const;
00141 
00143   virtual double averageDx() const;
00144   
00146   virtual double averageDy() const;
00147 
00148   
00150   int numX() const;
00151   
00153   int numY() const;
00154   
00169   virtual void computeNormals(int maxneighbors, int order, double tol)
00170     throw(std::string);
00171   
00179   virtual void analyticalNormals() throw(std::string);
00180 
00184   std::list<CartesianNode2D*> getBorderBySide(gridSide2D side) const;
00185 
00187   std::list<CartesianNode2D*> getAllBorders() const;
00188 
00196   int offsetsToIndex(int xoffset, int yoffset) const throw(std::string);
00197 
00199   CartesianNode2D* getNode(int ind) const throw(std::string);
00200 
00202   int numNodes() const;
00203 
00207   void fillUniformProperty(Property* prop) throw(std::string);
00208 
00213   void insertAnomaly(const Anomaly2D& anom);
00214 
00216   void setEnergySpeed(double energySpeed);
00217 
00219   double getEnergySpeed() const;
00220 
00224   int numActiveNodes() const throw(std::string);
00225 
00229   void generateLinearIndices();
00230 
00232   int numBorderNodes() const;
00233 
00234 };
00235 
00236 } // end namespace
00237 
00238 #endif

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