AMROC Main     Blockstructured Adaptive Mesh Refinement in object-oriented C++


Main Page   Class Hierarchy   Compound List   File List  

DAGHGhostInteraction.h

Go to the documentation of this file.
00001 #ifndef _included_DAGHGhostInteraction_h
00002 #define _included_DAGHGhostInteraction_h
00003 
00009 #include "DAGHParams.h"
00010 #include "GridDataParams.h"
00011 #include "DAGHDefaults.h"
00012 
00013 #include "BBox.h"
00014 
00015 #ifndef DAGHDefaultInteraction
00016 #define DAGHDefaultInteraction  (DAGHGhostInteraction)
00017 #endif
00018 
00019 
00020 class GhostInteraction 
00021   {
00022    friend ostream& operator << (ostream&, const GhostInteraction &);
00023 
00024    short Irank;   /* Dimensions 1, 2, or 3 */
00025    short Itype;   /* Ghost Interactions ? */
00026    short Iwidth;  /* Radius of interactions */
00027     
00028    short Itotal;
00029 
00030    short Icounts[DAGHMaxAxis][DAGHMaxDirs];
00031    short *Ilists[DAGHMaxAxis][DAGHMaxDirs];
00032 
00033    short Iinside;
00034  
00035    short Iface_cnt;
00036    short *Ifaces;
00037 
00038    //short Iface_cnt[DAGHMaxAxis][DAGHMaxDirs];
00039    //short *Ifaces[DAGHMaxAxis][DAGHMaxDirs];
00040    //short Icorner_cnt[DAGHMaxAxis][DAGHMaxDirs];
00041    //short *Icorners[DAGHMaxAxis][DAGHMaxDirs];
00042    //short Iedge_cnt[DAGHMaxAxis][DAGHMaxDirs];
00043    //short *Iedges[DAGHMaxAxis][DAGHMaxDirs];
00044 
00045    short FaceFlag;
00046    short CornerFlag;
00047    short EdgeFlag;
00048 
00049    short SimpleFlag;
00050 
00051 public:
00052     
00053    GhostInteraction( const int rank, 
00054                      const int type,
00055                      const int width );    
00056 
00057    GhostInteraction( const int rank, 
00058                      const int fflag, 
00059                      const int cflag, 
00060                      const int eflag, 
00061                      const int type,
00062                      const int width,
00063                      const int simple=DAGHFalse );    
00064 
00065    GhostInteraction( const GhostInteraction &other );
00066 
00067    ~GhostInteraction();    
00068 
00069    void compute_interactions( const int fflag,
00070                               const int cflag,
00071                               const int eflag, 
00072                               const int simple );
00073 
00074    inline int total_interactions() const { return Itotal; }
00075 
00076    inline int num_interactions( const int axis, const int dir ) const
00077                 { return Icounts[axis][dir]; }
00078    inline short const *interactions( const int axis, const int dir ) const
00079                 { return Ilists[axis][dir]; }
00080 
00081    inline int simple() const { return (SimpleFlag == DAGHTrue); }
00082     
00083    inline int inside() const { return Iinside; }
00084 
00085    inline int complement(const int d) const { return Itotal-1-d; }
00086 
00087    //int is_forward(const int i);
00088    //int is_forward(const int i, const int d);
00089 
00090    //int is_backward(const int i);
00091    //int is_backward(const int i, const int d);
00092 
00093    inline int num_faces( const int axis, const int dir ) const
00094                 { return Iface_cnt; }
00095    inline short const *faces( ) const
00096                 { return Ifaces; }
00097    inline short faces( const int axis, const int dir ) const
00098                 { return Ifaces[2*axis+dir]; }
00099     
00100    //inline int num_faces( const int axis, const int dir ) 
00101    //           { return Iface_cnt[axis][dir]; }
00102    //inline short const *faces( const int axis, const int dir ) 
00103    //           { return Ifaces[axis][dir]; }
00104     
00105    //inline int num_corners( const int axis, const int dir ) 
00106    //           { return Icorner_cnt[axis][dir]; }
00107    //inline short const *corners( const int axis, const int dir ) 
00108    //           { return Icorners[axis][dir]; }
00109     
00110    //inline int num_edges( const int axis, const int dir ) 
00111    //           { return Iedge_cnt[axis][dir]; }
00112    //inline short const *edges( const int axis, const int dir ) 
00113    //           { return Iedges[axis][dir]; }
00114     
00115    BBox Ibbox( BBox const &mybb, const int dir, short const *rad ) const ;
00116    BBox Ibbox( BBox const &mybb, const int axis, const int dir, 
00117                short const *rad ) const ;
00118    BBox IbboxFrom( BBox const &mybb, const int dir, short const *rad, 
00119                    const short* olap ) const ;
00120 
00121    inline static int face_flag(const int cf)
00122      { return (cf == DAGHCommSimple || 
00123                cf != DAGHCommNoFace); }
00124 
00125    inline static int corner_flag(const int cf)
00126      { return (cf == DAGHCommSimple || 
00127                cf != DAGHCommFaceOnly && 
00128                cf != DAGHCommNoCorner); }
00129    
00130    inline static int edge_flag(const int cf)
00131      { return (cf == DAGHCommSimple ||
00132                cf != DAGHCommFaceOnly && 
00133                cf != DAGHCommNoEdge); }
00134    
00135    inline static int simple_flag(const int cf)
00136      { return (cf == DAGHCommSimple); }
00137 
00138 private:
00139 
00140    inline int is_inside( const int x, const int y, const int z )
00141                 { return (x==1 && y==1 && z==1); }
00142    inline int is_face( const int x, const int y, const int z )
00143                 { return ((x==1 && y==1 && z!=1) || 
00144                           (x==1 && y!=1 && z==1) ||
00145                           (x!=1 && y==1 && z==1)); }
00146    inline int is_corner( const int x, const int y, const int z )
00147                 { return (x!=1 && y!=1 && z!=1 ); }
00148    inline int is_edge( const int x, const int y, const int z )
00149                 { return ((x==1 && y!=1 && z!=1) || 
00150                           (x!=1 && y==1 && z!=1) ||
00151                           (x!=1 && y!=1 && z==1)); }
00152   };
00153 
00154 #endif


Quickstart     Users Guide     Programmers Reference     Installation      Examples     Download



AMROC Main      Home      Contact
last update: 06/01/04