Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

vdb.hpp

Go to the documentation of this file.
00001 //************************************************************************************//
00002 // Module       : vdb.hpp
00003 // Date         : 8/5/03 (DLR)
00004 // Copyright    : 2003-2006 Copyright University Corporation for Atmospheric
00005 //                Research
00006 // Description  : Encapsulates the methods and data associated with
00007 //                a voxel database object
00008 // Derived From : none.
00009 // Modifications:
00010 //************************************************************************************//
00011 #if !defined(VDB_HPP)
00012 #define VDB_HPP
00013 
00014 #include "gtbuffer.hpp"
00015 #include "gtlist.hpp"
00016 #include "gkeygen.hpp"
00017 
00018 
00019 #if !defined(GVDB_STRUCT)
00020 #define GVDB_STRUCT
00021 #define NVDBST_MEM 6
00022 #define NULL_HOSTKEY -1
00023 struct GVDBst {
00024   GKEY  hostkey;
00025   GKEY  hostrootkey;
00026   GINT  hostid;
00027   GINT  id;
00028   GINT  ancillary;
00029   GDOUBLE x    [GDIM];
00030 };
00031 #endif
00032 
00033 class VDB 
00034 {
00035 public:
00036                   VDB();
00037                  ~VDB();
00038                   VDB(const VDB &a);
00039 
00040 void              add(Point3D *point, GKEY *key,  GKEY *hostkey, 
00041                       GKEY *hostrootkey, GINT  *localid, GINT  *ancillary, GINT  *hostid,
00042                       GSHORT  *iproc, GINT  num=1);                              // add entries
00043 GBOOL             del(Point3D *point, GINT  num=1);                             // delete entries
00044 GBOOL             del(GKEY    *key  , GINT  num=1);                             // delete entries
00045 GINT              size();                                                       // total number of records
00046 GINT              multiplicity(Point3D *point);                                 // get multiplicity of point
00047 GINT              multiplicity(GKEY *key);                                      // get multiplicity of key
00048 void              multiplicity(Point3D *point, GINT  *&mult, GINT  num=1);      // get multiplicity of point array
00049 void              multiplicity(GKEY    *hostkey  , GINT  *&mult, GINT  num=1);  // get multiplicity of key array
00050 void              procs(Point3D *point, GSBuffer   **&iprocs, GINT  num=1);     // get proc list for point
00051 void              procs(GKEY     *hostkey , GSBuffer   **&iprocs, GINT  num=1); // get proc list for key
00052 void              synch       ();                                               // synch VBD on all processors
00053 VDBData          *record(GINT  irec);                                           // get record via local index
00054 VDBData          *record(Point3D &point, VDBData **&vdbelems, GINT  &num);      // get record(s) by point
00055 VDBData          *record(GKEY    &key  , VDBData **&vdbelems, GINT  &num);      // get record(s) by key
00056 GBOOL             duplicates(VDBData &rec, GINT  *&indices, GINT  &num);        // get indices of duplicate records
00057 void              SetKeyGen(GKeyGen *keygen);                                   // Set key-generator object
00058 void              CleanAll();                                                   // Remove all data from DB
00059 void              Bracket(GDOUBLE eps);                                           // Set fuzziness in points
00060 friend ostream&   operator<<(ostream&, VDB &);                                  // Output stream operator
00061 
00062 
00063 private:
00064 // Private methods:
00065 void              CleanNonLocal();                                              // Remove non-local data from DB
00066  
00067 
00068 // Private data:
00069 GSHORT             nprocs_;                         // number of processors
00070 GSHORT             this_rank_;                      // rank of current processor
00071 GDOUBLE            eps_;                            // fuzziness in point positions, for comparing
00072 VDBList            vdb_list_;                       // list of vdb data elements
00073 GKeyGen            *keygen_;                        // key-generator object
00074 GC_DATATYPE        vdbst_type_;                     // GVDBst data type for communications
00075 
00076 };
00077 #endif
00078 

Generated on Wed Dec 21 16:00:49 2005 for Geophysics & Astrophysics Spectral Element Adaptive Refinement (GASpAR) 2D Code by  doxygen 1.4.4