00001 00002 // 00003 // BFLNode2ACell 00004 // 00005 // A simple object to serve as an entry at the ANSYS <-> Voronoi 00006 // lookup table. Essentially it holds 00007 // Ansys Node -- Ansys Cell -- List of the rest cell nodes 00008 // for each Ansys Node 00009 // One could argue that there is a certain redundancy in this approach. 00010 // Well, there is but at the same time it makes 'searching' more 00011 // efficient 00012 // 00013 // Author: C.Andreopoulos, March 5, 2001 00014 // (c) 2001 - University of Athens 00015 // 00017 00018 #ifndef BFLNODE2ACELL_H 00019 #define BFLNODE2ACELL_H 00020 00021 #include <iostream> 00022 using std::cout; 00023 using std::endl; 00024 00025 #include "TString.h" 00026 #include "TObject.h" 00027 00028 const Int_t kNMaxNodesPerACell = 4; 00029 00030 //_________________________________________________________________________ 00031 class BFLNode2ACell: public TObject { 00032 00033 public: 00034 00035 BFLNode2ACell() { } 00036 BFLNode2ACell(Int_t cell, Int_t node, Int_t nodeslist[kNMaxNodesPerACell]): 00037 fANSYSCellID(cell),fANSYSNodeID(node) { *fCellNodes=*nodeslist; } 00038 virtual ~BFLNode2ACell() { } 00039 00040 virtual void SetCellID(Int_t cell) { fANSYSCellID = cell; } 00041 virtual void SetNodeID(Int_t node) { fANSYSNodeID = node; } 00042 virtual void SetCellNodes(Int_t nodes[kNMaxNodesPerACell]) {*fCellNodes = *nodes; } 00043 00044 virtual Int_t GetCellID(void) { return fANSYSCellID; } 00045 virtual Int_t GetNodeID(void) { return fANSYSNodeID; } 00046 virtual void GetCellNodes(Int_t nodes[kNMaxNodesPerACell]) { 00047 Int_t i = 0; 00048 while(i<kNMaxNodesPerACell) { 00049 nodes[i] = fCellNodes[i]; 00050 i++; 00051 } 00052 } 00053 00054 virtual void Print(Option_t *) const { 00055 cout << "Cell-> " << fANSYSCellID << endl; 00056 Int_t i = 0; 00057 cout << "List of nodes in this cell " << endl; 00058 while(i < kNMaxNodesPerACell && fCellNodes[i] != -1) { 00059 cout << fCellNodes[i] << endl; 00060 i++; 00061 } 00062 } 00063 virtual Bool_t IsSortable() const { return kTRUE; } 00064 00065 virtual Bool_t IsEqual(const TObject *obj) const { // soft by nodes 00066 return fANSYSNodeID == ((BFLNode2ACell*)obj)->GetNodeID(); 00067 } 00068 Int_t Compare(const TObject *obj) const { 00069 if ( fANSYSCellID == ((BFLNode2ACell*)obj)->GetCellID() ) 00070 return 0; 00071 else if (fANSYSCellID < ((BFLNode2ACell*)obj)->GetCellID() ) 00072 return -1; 00073 else 00074 return 1; 00075 } 00076 00077 private: 00078 00079 Int_t fANSYSCellID; 00080 Int_t fANSYSNodeID; 00081 Int_t fCellNodes[kNMaxNodesPerACell]; 00082 00083 ClassDef(BFLNode2ACell,0) // ANSYS Nodes <-> ANSYS Cells table entry 00084 }; 00085 00086 #endif
1.3.9.1