BfldMeshVoronoi Class Reference

#include <BfldMeshVoronoi.h>

Inheritance diagram for BfldMeshVoronoi:
BfldMesh BfldRefCnt

List of all members.

Public Member Functions

 BfldMeshVoronoi ()
 BfldMeshVoronoi (BfldGrid::Grid_t grid, Int_t variant)
virtual ~BfldMeshVoronoi ()
virtual TVector3 GetGeneratorPosition (Int_t generator)
Int_t FindANSYSGenerator (Int_t VoronCellID)

Protected Attributes

TObjArray * fPositions
Bool_t fReadOk
std::string fFilename

Detailed Description

Definition at line 22 of file BfldMeshVoronoi.h.


Constructor & Destructor Documentation

BfldMeshVoronoi::BfldMeshVoronoi (  ) 

Definition at line 31 of file BfldMeshVoronoi.cxx.

00032    : BfldMesh()
00033 {
00034 
00035 }

BfldMeshVoronoi::BfldMeshVoronoi ( BfldGrid::Grid_t  grid,
Int_t  variant 
)

Definition at line 38 of file BfldMeshVoronoi.cxx.

References bfld::AsString(), fFilename, fPositions, fReadOk, Msg::kDebug, BfldGrid::kNearCoarseV, Msg::kWarning, and MSG.

00039    : BfldMesh(grid,variant)
00040 {
00041    // read in a Mesh ... generator positions currently in Map file
00042 
00043    // map from grid+variant to a file or database record
00044    switch (grid) {
00045    case BfldGrid::kNearCoarseV: fFilename = "NearDetMesh.default";
00046       break;
00047    default:
00048       MSG("Bfld",Msg::kWarning)
00049          << "BfldMeshVoronoi not yet supported for grid " <<
00050          BfldGrid::AsString(grid) << endl;
00051       return;
00052       break;
00053    }
00054 
00055    Msg::LogLevel_t verbosity = Msg::kDebug;
00056 
00057    MSG("Bfld",verbosity) << "BfldMeshVoronoi::ctor "
00058                          << fFilename << endl;
00059 
00060    Int_t ngen = 0;
00061    Int_t i = 0;
00062    Int_t NodeID = 0;
00063    Int_t VorCell;
00064    Int_t VorCellLast = -999;
00065    Float_t x, y;
00066 
00067    ifstream DATA(fFilename.c_str(),ios::in);
00068    if(!DATA) {
00069       MSG("Bfld",Msg::kWarning) << "BfldMeshVoronoi No such file: " 
00070                                 << fFilename << endl;
00071       return;
00072    }
00073 
00074    DATA >> ngen;
00075    // allocate a container
00076    fPositions = new TClonesArray("TVector3",ngen);
00077 
00078    while(!DATA.eof()){
00079       DATA >> NodeID >> VorCell >> x >> y;
00080       if (NodeID>=0 && VorCell != VorCellLast) {
00081          //         fPositions->Add(new TVector3(x,y,VorCell),NodeID); 
00082          new((*fPositions)[NodeID]) TVector3(x,y,VorCell);
00083          VorCellLast = VorCell;
00084       } else {
00085          MSG("Bfld",verbosity) 
00086             << "BfldMeshVoronoi::ctor NodeID<0 "
00087             << NodeID << " ( VorCell " << VorCell << " ) " << endl;
00088       }
00089       i++; 
00090    }
00091    DATA.close(); 
00092 
00093    MSG("Bfld",verbosity) << "BfldMeshVoronoi file read in " 
00094                          << i << " nodes " << endl;
00095 
00096    fReadOk = kTRUE;
00097 
00098 }

BfldMeshVoronoi::~BfldMeshVoronoi (  )  [virtual]

Definition at line 101 of file BfldMeshVoronoi.cxx.

References bfld::AsString(), BfldMesh::fGrid, Msg::kDebug, and MSG.

00102 {
00103    MSG("Bfld",Msg::kDebug) 
00104      << "~BfldMeshVoroni grid " << BfldGrid::AsString(fGrid) 
00105      << endl;
00106 }


Member Function Documentation

Int_t BfldMeshVoronoi::FindANSYSGenerator ( Int_t  VoronCellID  ) 

Definition at line 119 of file BfldMeshVoronoi.cxx.

References fPositions.

00120 {
00121   Int_t NodeID = 1;
00122   TIter next(fPositions);
00123   TVector3 * genVec3;
00124 
00125   while( (genVec3 = (TVector3*)next()) ) {
00126      if( genVec3->Z() == VoronCellID ) return NodeID;
00127      NodeID++;  
00128   }
00129 
00130   return -1;
00131 }

TVector3 BfldMeshVoronoi::GetGeneratorPosition ( Int_t  generator  )  [virtual]

Reimplemented from BfldMesh.

Definition at line 109 of file BfldMeshVoronoi.cxx.

Referenced by BFLInterpolation::IsInsideANSYSCell().

00110 {
00111    // return the TVector3 associated with a generator (mesh node)
00112 
00113    Float_t x = 0;
00114    Float_t y = 0;
00115    return TVector3(x,y,0.);
00116 }


Member Data Documentation

std::string BfldMeshVoronoi::fFilename [protected]

Definition at line 39 of file BfldMeshVoronoi.h.

Referenced by BfldMeshVoronoi().

TObjArray* BfldMeshVoronoi::fPositions [protected]

Reimplemented from BfldMesh.

Definition at line 34 of file BfldMeshVoronoi.h.

Referenced by BfldMeshVoronoi(), and FindANSYSGenerator().

Bool_t BfldMeshVoronoi::fReadOk [protected]

Definition at line 38 of file BfldMeshVoronoi.h.

Referenced by BfldMeshVoronoi().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1