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

CylinderBL.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 
00028 #ifndef _CylinderBL_H_
00029 #define _CylinderBL_H_
00030 
00031 #include "MayDay.H"
00032 #include "LoHiSide.H"
00033 #include "IntVect.H"
00034 #include "RealVect.H"
00035 #include "BaseLevelSet.H"
00036 #include "REAL.H"
00037 #include "BoxIterator.H"
00038 using std::pair;
00039 
00041 /*
00042    This is the workshop class for a Cylinder.
00043    It follows the BaseLocalGeometry base class.
00044    Returns C_z+sqrt (radius-(x-C_x)squared+(y-C_y)squared));
00045  */
00046 class CylinderBL: public BaseLevelSet
00047 {
00048 public:
00049 
00051   CylinderBL(const Real&     a_radius,
00052              const Real&     a_height,
00053              const RealVect& a_center,
00054              const int&      a_axis,
00055              const bool&     a_interior,
00056              const Real&     a_dx);
00057 
00059   virtual ~CylinderBL();
00060 
00061   
00062   /*
00063       Return true if every cell in region is regular at the
00064       refinement described by dx.
00065   */
00066   virtual bool isRegular(const Box&      a_region,
00067                          const Box&      a_domain,
00068                          const RealVect& a_origin,
00069                          const Real&     a_dx) const;
00070 
00072   /* 
00073       Return true if every cell in region is covered at the
00074       refinement described by dx.
00075   */
00076   virtual bool isCovered(const Box&      a_region,
00077                          const Box&      a_domain,
00078                          const RealVect& a_origin,
00079                          const Real&     a_dx) const;
00080 
00082   /*
00083      This returns the signed integer which  most closely
00084      represents the normal direction.  The first integer
00085      of the pair is of the interface at an irregular cell
00086      (which coordinate direction has the largest normal component). 
00087      This will only be called if the cell is irregular.
00088    */
00089   virtual pair<int, Side::LoHiSide> upDirection(const RealVect& a_midpt,const IntVect& a_iv) const; 
00090 
00092   
00093   //     Return the value at the dependent coordinate given the independent
00094   //  coordinates. Returns C_z+sqrt (radius-(x-C_x)squared+(y-C_y)squared));
00095   //  Where the center is (C_x,C_y,C_z)
00096   
00097   virtual Real localFuncValue(const RealVect& a_independentCoords, 
00098                               const int&      a_upDirection,
00099                               const IntVect&  a_iv, 
00100                               const Box&      a_domain, 
00101                               const RealVect& a_origin, 
00102                               const Real&     a_dx) const;  
00103   
00104   //   Return a newly allocated derived class.  The responsibility
00105   //  for deleting the memory is left to the calling function.
00106   
00107   virtual BaseLevelSet* new_baseLevelSet() const;   
00108  
00109 protected:
00110   Real LevelSurface(const RealVect& a_vec) const;
00111 
00112   RealVect m_center;
00113   Real     m_radius;
00114   Real     m_height;
00115   int      m_axis;
00116   bool     m_interior;
00117   Real     m_dx;
00118 
00119 private:
00120   CylinderBL()
00121   {
00122     MayDay::Error("CylinderBL uses strong construction");
00123   }
00124 
00125   CylinderBL(const CylinderBL& a_radius)
00126   {
00127     MayDay::Error("CylinderBaselevel disallows copy construction");
00128   }
00129 
00130   void operator=(const CylinderBL& a_radius)
00131   {
00132     MayDay::Error("CylinderBL disallows assignment");
00133   }
00134 };
00135 
00136 #endif

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