| Line |  | 
|---|
| 1 | #ifndef BZ_GEOMETRY_H | 
|---|
| 2 | #define BZ_GEOMETRY_H | 
|---|
| 3 |  | 
|---|
| 4 | #ifndef BZ_ARRAY_H | 
|---|
| 5 | #error <blitz/array/geometry.h> must be included after <blitz/array.h> | 
|---|
| 6 | #endif | 
|---|
| 7 |  | 
|---|
| 8 | BZ_NAMESPACE(blitz) | 
|---|
| 9 |  | 
|---|
| 10 | typedef double T_defaultSpatialCoordinate; | 
|---|
| 11 |  | 
|---|
| 12 | template<int N_dim, class T = T_defaultSpatialCoordinate> | 
|---|
| 13 | class UniformOrthoGeometry { | 
|---|
| 14 | public: | 
|---|
| 15 | }; | 
|---|
| 16 |  | 
|---|
| 17 | template<int N_dim, class T = T_defaultSpatialCoordinate> | 
|---|
| 18 | class UniformCubicGeometry { | 
|---|
| 19 | T h_; | 
|---|
| 20 | T recip_h_; | 
|---|
| 21 | T recip2_h_; | 
|---|
| 22 | T recip3_h_; | 
|---|
| 23 | TinyVector<T,N_dim> zero_; | 
|---|
| 24 |  | 
|---|
| 25 | public: | 
|---|
| 26 | typedef T T_coord; | 
|---|
| 27 |  | 
|---|
| 28 | UniformCubicGeometry() | 
|---|
| 29 | { | 
|---|
| 30 | h_ = 0.0; | 
|---|
| 31 | recip_h_ = 0.0; | 
|---|
| 32 | recip2_h_ = 0.0; | 
|---|
| 33 | recip3_h_ = 0.0; | 
|---|
| 34 | zero_ = 0.0; | 
|---|
| 35 | } | 
|---|
| 36 |  | 
|---|
| 37 | UniformCubicGeometry(T spatialStep) | 
|---|
| 38 | { | 
|---|
| 39 | h_ = spatialStep; | 
|---|
| 40 | zero_ = T(0); | 
|---|
| 41 | setup(); | 
|---|
| 42 | } | 
|---|
| 43 |  | 
|---|
| 44 | UniformCubicGeometry(T spatialStep, TinyVector<T,N_dim> zeroCoordinates) | 
|---|
| 45 | { | 
|---|
| 46 | h_ = spatialStep; | 
|---|
| 47 | zero_ = zeroCoordinates; | 
|---|
| 48 | setup(); | 
|---|
| 49 | } | 
|---|
| 50 |  | 
|---|
| 51 | TinyVector<T,N_dim> toSpatial(TinyVector<int,N_dim> logicalCoord) const | 
|---|
| 52 | { | 
|---|
| 53 | return zero_ + h_ * logicalCoord; | 
|---|
| 54 | } | 
|---|
| 55 |  | 
|---|
| 56 | T spatialStep() const | 
|---|
| 57 | { return h_; } | 
|---|
| 58 |  | 
|---|
| 59 | T recipSpatialStep() const | 
|---|
| 60 | { return recip_h_; } | 
|---|
| 61 |  | 
|---|
| 62 | T recipSpatialStepPow2() const | 
|---|
| 63 | { return recip2_h_; } | 
|---|
| 64 |  | 
|---|
| 65 | private: | 
|---|
| 66 | void setup() | 
|---|
| 67 | { | 
|---|
| 68 | recip_h_ = 1.0 / h_; | 
|---|
| 69 | recip2_h_ = 1.0 / pow2(h_); | 
|---|
| 70 | recip3_h_ = 1.0 / pow3(h_); | 
|---|
| 71 | } | 
|---|
| 72 | }; | 
|---|
| 73 |  | 
|---|
| 74 | template<int N_dim, class T = T_defaultSpatialCoordinate> | 
|---|
| 75 | class TensorProductGeometry { | 
|---|
| 76 | public: | 
|---|
| 77 | }; | 
|---|
| 78 |  | 
|---|
| 79 | BZ_NAMESPACE_END | 
|---|
| 80 |  | 
|---|
| 81 | #endif // BZ_GEOMETRY_H | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.