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

MultiSphereBL.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 _MultiSphereBL_H_
00030 #define _MultiSphereBL_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 Sphere.
00044   It follows the BaseLocalGeometry base class.
00045   Returns C_z+sqrt (radius-(x-C_x)squared+(y-C_y)squared));
00046 */
00047 class MultiSphereBL: public BaseLevelSet
00048 {
00049 public:
00050 
00052   MultiSphereBL(const Vector<Real>&     a_radius, 
00053                 const Vector<RealVect>& a_center,
00054                 const Real&             a_dx);
00055 
00057   virtual ~MultiSphereBL();
00058 
00059   
00060   /*
00061     Return true if every cell in region is regular at the
00062     refinement described by dx.
00063   */
00064   virtual bool isRegular(const Box&      region,
00065                          const Box&      domain,
00066                          const RealVect& origin,
00067                          const Real&     dx) const;
00068 
00070   /* 
00071      Return true if every cell in region is covered at the
00072      refinement described by dx.
00073   */
00074   virtual bool isCovered(const Box&           region,
00075                          const Box&           domain,
00076                          const RealVect&      origin,
00077                          const Real&          dx) const;
00078 
00080   /*
00081     This returns the signed integer which  most closely
00082     represents the normal direction.  The first integer
00083     of the pair is of the interface at an irregular cell
00084     (which coordinate direction has the largest normal component). 
00085     This will only be called if the cell is irregular.
00086   */
00087   virtual
00088   pair<int, Side::LoHiSide>  
00089   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   
00098   virtual Real localFuncValue(const RealVect& a_independentCoords, 
00099                               const int& a_upDirection,
00100                               const IntVect& a_iv, 
00101                               const Box& a_domain, 
00102                               const RealVect& a_origin, 
00103                               const Real& a_dx) const;  
00104 
00105  
00106   
00107   //   Return a newly allocated derived class.  The responsibility
00108   //  for deleting the memory is left to the calling function.
00109   
00110   virtual
00111   BaseLevelSet* new_baseLevelSet() const;   
00112   // calculates the max coordiante of a RealVect
00113   virtual Real max(const RealVect& vec)const;
00114   // calculates the magnitude of a RealVect
00115   virtual Real magnitude(const RealVect& vec)const;
00116  
00117   int closestSphere(const RealVect& a_vec) const;
00118 protected:
00119   
00120   Vector<RealVect> m_center;
00121   Vector<Real>     m_radius;
00122   Real m_dx;
00123   int m_numSpheres;
00124 
00125 
00126 private:
00128   MultiSphereBL()
00129   {
00130     MayDay::Error("MultiSphereBL uses strong construction");
00131   }
00132   MultiSphereBL(const MultiSphereBL& a_radius)
00133   {
00134     MayDay::Error("sphereBaselevel disallows copy construction");
00135   }
00136   void operator=(const MultiSphereBL& a_radius)
00137   {
00138     MayDay::Error("MultiSphereBL disallows assignment");
00139   }
00140 
00141 };
00142 #endif

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