00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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 }
00269
00270 #endif