BFLAnsysLookup Class Reference

#include <BFLAnsysLookup.h>

Inheritance diagram for BFLAnsysLookup:
BFLLookupTable BfldRefCnt

List of all members.

Public Member Functions

 BFLAnsysLookup ()
 BFLAnsysLookup (BfldGrid::Grid_t grid)
virtual ~BFLAnsysLookup ()
void LoadLookupTable (TString filename)
void FindNode (Int_t node, TObjArray *result)
void FindCell (Int_t cell, TObjArray *result)

Protected Attributes

TObjArray * fTable
TString fLookupFilename

Detailed Description

Definition at line 20 of file BFLAnsysLookup.h.


Constructor & Destructor Documentation

BFLAnsysLookup::BFLAnsysLookup (  ) 

Definition at line 19 of file BFLAnsysLookup.cxx.

00020    : BFLLookupTable()
00021 {
00022 
00023 }

BFLAnsysLookup::BFLAnsysLookup ( BfldGrid::Grid_t  grid  ) 

Definition at line 25 of file BFLAnsysLookup.cxx.

References fLookupFilename, BfldGrid::kNearCoarseV, and LoadLookupTable().

00026    : BFLLookupTable(grid)
00027 {
00028 
00029    switch(grid) {
00030    case BfldGrid::kNearCoarseV: 
00031        fLookupFilename = "NearDetANSYSLookup.default"; // tmp - hardcoded
00032        LoadLookupTable(fLookupFilename);
00033        break;
00034    default:
00035       // MSG("BFL",Msg::kWarning)
00036       //    << "Lookup table not yet supported for grid " <<
00037       //    BfldGrid::AsString(grid) << endl;
00038        break;
00039    }
00040 
00041 }

BFLAnsysLookup::~BFLAnsysLookup (  )  [virtual]

Definition at line 43 of file BFLAnsysLookup.cxx.

References BFLLookupTable::fGrid, fTable, and BfldGrid::kUndefined.

00044 {
00045    fGrid = BfldGrid::kUndefined;   
00046    if(fTable) fTable->Delete();
00047    delete fTable;
00048 }


Member Function Documentation

void BFLAnsysLookup::FindCell ( Int_t  cell,
TObjArray *  result 
)

Definition at line 61 of file BFLAnsysLookup.cxx.

References fTable, and BFLNode2ACell::GetCellID().

00062 {
00063 // return all lookup table entries where Cell ID = cell
00064 //
00065   TIter next(fTable);
00066   BFLNode2ACell * entry;
00067   while( (entry = (BFLNode2ACell*)next()) ){
00068      if( entry->GetCellID() == cell ) result->Add(entry->Clone());
00069   }
00070 } 

void BFLAnsysLookup::FindNode ( Int_t  node,
TObjArray *  result 
)

Definition at line 50 of file BFLAnsysLookup.cxx.

References fTable, and BFLNode2ACell::GetNodeID().

Referenced by BFLInterpolation::BilinearInterpolation().

00051 {
00052 // return all lookup table entries where Node ID = node
00053 //
00054   TIter next(fTable);
00055   BFLNode2ACell * entry;
00056   while( (entry = (BFLNode2ACell*)next()) ){
00057      if( entry->GetNodeID() == node ) result->Add(entry->Clone());
00058   }
00059 } 

void BFLAnsysLookup::LoadLookupTable ( TString  filename  ) 

Definition at line 72 of file BFLAnsysLookup.cxx.

References exit(), fTable, and kNMaxNodesPerACell.

Referenced by BFLAnsysLookup().

00073 {
00074    Int_t CellID = -1, Node1 = -1, Node2 = -1, Node3 = -1, Node4 = -1,  i = 0;
00075    Int_t nodes[kNMaxNodesPerACell] = { 0, 1, 2, 3};
00076 
00077    ifstream LOOKUP(filename,ios::in);
00078    if(!LOOKUP) {
00079       cerr << "BFLAnsysLookup::LoadLookupTable : No such file as " << filename << endl;
00080       exit(1);
00081    }
00082 
00083    // --- lookup table has a very simple (repetitive) structure
00084    while(!LOOKUP.eof()) {
00085       LOOKUP >> CellID >> Node1 >> Node2 >> Node3 >> Node4;
00086 
00087       // again -> this structure of the lookup table makes searching easier
00088       fTable->AddAtAndExpand( new BFLNode2ACell(CellID,Node1,nodes), i++);
00089       fTable->AddAtAndExpand( new BFLNode2ACell(CellID,Node2,nodes), i++);
00090       fTable->AddAtAndExpand( new BFLNode2ACell(CellID,Node3,nodes), i++);
00091       fTable->AddAtAndExpand( new BFLNode2ACell(CellID,Node4,nodes), i++);
00092    }
00093    fTable->Sort();
00094 }


Member Data Documentation

TString BFLAnsysLookup::fLookupFilename [protected]

Definition at line 37 of file BFLAnsysLookup.h.

Referenced by BFLAnsysLookup().

TObjArray* BFLAnsysLookup::fTable [protected]

Reimplemented from BFLLookupTable.

Definition at line 36 of file BFLAnsysLookup.h.

Referenced by FindCell(), FindNode(), LoadLookupTable(), and ~BFLAnsysLookup().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1