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

PolarBL.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 _PolarBL_H_
00030 #define _PolarBL_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 Polar.
00044    It follows the BaseLocalGeometry base class.
00045    Returns C_z+sqrt (radius-(x-C_x)squared+(y-C_y)squared));
00046  */
00047 class PolarBL: public BaseLevelSet
00048 {
00049 public:
00050 
00052   PolarBL(const Real&         a_coeffA,
00053           const Real&         a_coeffB,
00054           const Real&         a_coeffC,
00055           const RealVect&     a_center,
00056           const bool&         a_insideRegular,
00057           const Real&         a_dx);
00058 
00060   virtual ~PolarBL();
00061 
00062   
00063   /*
00064       Return true if every cell in region is regular at the
00065       refinement described by dx.
00066   */
00067   virtual bool isRegular(const Box&      region,
00068                          const Box&      domain,
00069                          const RealVect& origin,
00070                          const Real&     dx) const;
00071 
00073   /* 
00074       Return true if every cell in region is covered at the
00075       refinement described by dx.
00076   */
00077   virtual bool isCovered(const Box&           region,
00078                          const Box&           domain,
00079                          const RealVect&      origin,
00080                          const Real&          dx) const;
00081 
00083   /*
00084      This returns the signed integer which  most closely
00085      represents the normal direction.  The first integer
00086      of the pair is of the interface at an irregular cell
00087      (which coordinate direction has the largest normal component). 
00088      This will only be called if the cell is irregular.
00089    */
00090    
00091 
00092   virtual
00093   pair<int, Side::LoHiSide> upDirection(const RealVect& midPt,const IntVect& a_iv) const;
00094 
00096   
00097   //     Return the value at the dependent coordinate given the independent
00098   //  coordinates. Returns C_z+sqrt (radius-(x-C_x)squared+(y-C_y)squared));
00099   //  Where the center is (C_x,C_y,C_z)
00100    
00101   
00102   virtual Real localFuncValue(const RealVect& a_independentCoords, 
00103                               const int& a_upDirection,
00104                               const IntVect& a_iv, 
00105                               const Box& a_domain, 
00106                               const RealVect& a_origin, 
00107                               const Real& a_dx) const;  
00108 
00109  
00110   
00111   //   Return a newly allocated derived class.  The responsibility
00112   //  for deleting the memory is left to the calling function.
00113   
00114   virtual
00115   BaseLevelSet* new_baseLevelSet() const;   
00116   // calculates the max coordiante of a RealVect
00117   virtual Real maxabs(const RealVect& vec)const;
00118   // calculates the magnitude of a RealVect
00119   virtual Real magnitude(const RealVect& vec)const;
00120   // a polar equation
00121   virtual Real star(const RealVect& vec)const;
00122   virtual Real starX(const RealVect& vec)const;
00123   virtual Real starY(const RealVect& vec)const;
00124   virtual Real star(const Real x, Real y)const;
00125 protected:
00126   Real m_coeffA;
00127   Real m_coeffB;
00128   Real m_coeffC;
00129   RealVect m_center;
00130   bool m_insideRegular;
00131   Real m_dx;
00132 
00133 
00134 private:
00136   PolarBL()
00137   {
00138     MayDay::Error("PolarBL uses strong construction");
00139   }
00140   PolarBL(const PolarBL& a_center)
00141   {
00142     MayDay::Error("PolarBL disallows copy construction");
00143   }
00144   void operator=(const PolarBL& a_center)
00145   {
00146     MayDay::Error("PolarBL disallows assignment");
00147   }
00148 
00149 };
00150 #endif

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