Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

DEMBL.H

Go to the documentation of this file.
00001 /* _______              __
00002   / ___/ /  ___  __ _  / /  ___
00003  / /__/ _ \/ _ \/  ' \/ _ \/ _ \
00004  \___/_//_/\___/_/_/_/_.__/\___/ 
00005 */
00006 //
00007 // This software is copyright (C) by the Lawrence Berkeley
00008 // National Laboratory.  Permission is granted to reproduce
00009 // this software for non-commercial purposes provided that
00010 // this notice is left intact.
00011 // 
00012 // It is acknowledged that the U.S. Government has rights to
00013 // this software under Contract DE-AC03-765F00098 between
00014 // the U.S.  Department of Energy and the University of
00015 // California.
00016 //
00017 // This software is provided as a professional and academic
00018 // contribution for joint exchange. Thus it is experimental,
00019 // is provided ``as is'', with no warranties of any kind
00020 // whatsoever, no support, no promise of updates, or printed
00021 // documentation. By using this software, you acknowledge
00022 // that the Lawrence Berkeley National Laboratory and
00023 // Regents of the University of California shall have no
00024 // liability with respect to the infringement of other
00025 // copyrights by any part of this software.
00026 //
00027 //  ANAG, LBNL, DTG
00028 
00029 #ifndef _DEMBL_H_
00030 #define _DEMBL_H_
00031 
00032 #include "MayDay.H"
00033 #include "LoHiSide.H"
00034 #include "IntVect.H"
00035 #include "RealVect.H"
00036 #include "BaseLevelSet.H"
00037 #include "REAL.H"
00038 #include "BoxIterator.H"
00039 using std::pair;
00040 
00042 /*
00043    This is the workshop class for a DEM.
00044    It follows the BaseLocalGeometry base class.
00045    Returns C_z+sqrt (radius-(x-C_x)squared+(y-C_y)squared));
00046  */
00047 class DEMBL: public BaseLevelSet
00048 {
00049 public:
00050 
00052   DEMBL(const IntVect&    a_ncell,
00053                 const int&        a_interpType,
00054                 const Real&       a_dx,
00055                 const RealVect&   a_vectDx);
00056 
00058   virtual ~DEMBL();
00059 
00060    
00061   /*
00062       Return true if DEM is read
00063   */
00064   virtual bool readDEM(const bool& a_justhead);
00065 
00067   /*
00068       Return true if DEM is read
00069   */
00070   virtual bool fixDEM();
00071 
00073 
00074   /*
00075       Return true if every cell in region is regular at the
00076       refinement described by dx.
00077   */
00078   virtual bool isRegular(const Box&      region,
00079                          const Box&      domain,
00080                          const RealVect& origin,
00081                          const Real&     dx) const;
00082 
00084   /* 
00085       Return true if every cell in region is covered at the
00086       refinement described by dx.
00087   */
00088   virtual bool isCovered(const Box&           region,
00089                          const Box&           domain,
00090                          const RealVect&      origin,
00091                          const Real&          dx) const;
00092 
00094   /*
00095      This returns the signed integer which  most closely
00096      represents the normal direction.  The first integer
00097      of the pair is of the interface at an irregular cell
00098      (which coordinate direction has the largest normal component). 
00099      This will only be called if the cell is irregular.
00100    */
00101      virtual
00102   pair<int, Side::LoHiSide>  upDirection(const RealVect& a_midpt,const IntVect& a_iv)  const; 
00103 
00105   
00106   //     Return the value at the dependent coordinate given the independent
00107   //  coordinates. Returns C_z+sqrt (radius-(x-C_x)squared+(y-C_y)squared));
00108   //  Where the center is (C_x,C_y,C_z)
00109    
00110   
00111   virtual Real localFuncValue(const RealVect& a_independentCoords, 
00112                               const int& a_upDirection,
00113                               const IntVect& a_iv, 
00114                               const Box& a_domain, 
00115                               const RealVect& a_origin, 
00116                               const Real& a_dx) const;  
00117 
00118  
00119   
00120   //   Return a newly allocated derived class.  The responsibility
00121   //  for deleting the memory is left to the calling function.
00122   
00123   virtual
00124   BaseLevelSet* new_baseLevelSet() const;   
00125   // calculates the max coordiante of a RealVect
00126   virtual Real max(const RealVect& vec)const;
00127   // calculates the magnitude of a RealVect
00128   virtual Real magnitude(const RealVect& vec)const;
00129  
00130  
00131 protected:
00132   
00133   int m_ncols, m_nrows,m_NODATA;
00134   Real m_xllcorner,m_yllcorner,m_cellsize ,m_cellvalue;
00135   Real **m_DEM;
00136   Real m_dx;
00137   RealVect m_vectDx;
00138   IntVect m_ncell;
00139   int m_interpType;
00140   Real m_highground;
00141   Real m_minDEM;
00142   Real m_maxDEM;
00143 
00144 
00145 private:
00147   DEMBL()
00148   {
00149     MayDay::Error("DEMBL uses strong construction");
00150   }
00151   DEMBL(const DEMBL& a_radius)
00152   {
00153     MayDay::Error("sphereBaselevel disallows copy construction");
00154   }
00155   void operator=(const DEMBL& a_radius)
00156   {
00157     MayDay::Error("DEMBL disallows assignment");
00158   }
00159 
00160 };
00161 #endif

Generated on Wed Apr 16 14:31:04 2003 for EBChombo by doxygen1.2.16