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

GeometryShop.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 _GeometryShopBase_H_
00030 #define _GeometryShopBase_H_
00031 
00032 #include "REAL.H"
00033 #include "RealVect.H"
00034 #include "Box.H"
00035 #include "IntVect.H"
00036 #include "EBISBox.H"
00037 #include "BaseLevelSet.H"
00038 #include "GeometryService.H"
00039 #include "Moments.H"
00040 #include "CylinderBL.H"
00042 
00047 class GeometryShop: public GeometryService
00048 {
00049 public:
00051 
00054   //  GeometryShop(const BaseLevelSet& a_localGeom,int verbosity = 0);
00055   GeometryShop(const BaseLevelSet& a_localGeom,
00056                            int verbosity = 0,
00057                            RealVect a_vectDx = RealVect::Zero);
00058               
00059               
00060 
00062   ~GeometryShop();
00063 
00065   bool twoEdgeIntersections(edgeMo a_edges[4])const;
00066   bool tooManyUpDir(const IntVect& a_iv, 
00067                     const Real& a_dx,
00068                     const int& a_faceNormal)const;
00069   
00070 
00075   bool isRegular(const Box& region,
00076                  const Box& domain,
00077                  const RealVect& origin,
00078                  const Real& dx) const;
00079 
00081 
00085   bool isCovered(const Box& region,
00086                  const Box& domain,
00087                  const RealVect& origin,
00088                  const Real& dx) const;
00089 
00091 
00094   virtual void fillGraph(BaseFab<int>&       a_regIrregCovered,
00095                          Vector<IrregNode>&  a_nodes,
00096                          const Box&          a_validRegion,
00097                          const Box&          a_ghostRegion,
00098                          const Box&          a_domain,
00099                          const RealVect&     a_origin,
00100                          const Real&         a_dx) const;
00101 
00104   void computeVoFInternals(Real&               a_volFrac,
00105                            Vector<int>         a_loArc[SpaceDim],
00106                            Vector<int>         a_hiArc[SpaceDim],
00107                            Vector<Real>        a_loAreaFrac[SpaceDim],
00108                            Vector<Real>        a_hiAreaFrac[SpaceDim],
00109                            Real&               a_bndryArea,
00110                            RealVect&           a_normal,
00111                            RealVect&           a_volCentroid,
00112                            RealVect&           a_bndryCentroid,
00113                            Vector<RealVect>    a_loFaceCentroid[SpaceDim],
00114                            Vector<RealVect>    a_hiFaceCentroid[SpaceDim],
00115                            const IntVectSet&   a_ivsIrreg,
00116                            const VolIndex&     a_vof,
00117                            const Box&          a_domain, 
00118                            const RealVect&     a_origin, 
00119                            const Real&         a_dx,
00120                            const RealVect&     a_vectDx,
00121                            const IntVect&      a_iv) const;                
00122 
00123 
00124   
00125 private:
00126   int m_numCellsClipped;
00127   int m_verbosity;
00128   Real m_threshold; 
00129   RealVect m_vectDx;  
00130   
00131   const BaseLevelSet* m_localGeomPtr;
00132 
00134   //  const BaseLocalGeometry* m_localGeomPtr;
00135  
00136   void edgeData3D(
00137                   edgeMo a_edges[4],
00138                   bool& a_faceCovered,
00139                   bool& a_faceRegular,
00140                   bool& a_faceDontKnow,
00141                   const int a_hiLoFace,
00142                   const int a_faceNormal,
00143                                   const Real& a_dx,
00144                                   const RealVect& a_vectDx,           
00145                                   const IntVect& a_coord, 
00146                   const Box& a_domain,
00147                   const RealVect& a_origin
00148                   )const;
00149   void edgeData2D(
00150                   edgeMo a_edges[4],
00151                   bool& a_faceCovered,
00152                   bool& a_faceRegular,
00153                   bool& a_faceDontKnow,
00154                                   const Real& a_dx,
00155                                   const RealVect& a_vectDx,
00156                                   const IntVect& a_coord, 
00157                   const Box& a_domain,
00158                   const RealVect& a_origin
00159                   )const;
00160   void edgeType(bool& a_regular,
00161                 bool& a_covered, 
00162                 bool&a_dontKnow,
00163                 Real& a_signHi,
00164                 Real& a_signLo,
00165                 const pair<int,Side::LoHiSide>& a_upDir)const;
00166 
00167 Real BrentRootFinder
00168 (
00169   const RealVect& a_x1,
00170   const RealVect& a_x2,
00171   const int& a_upDir,
00172   const IntVect& a_iv,
00173   const Box& a_domain,
00174   const RealVect& a_origin,
00175   const Real& a_dx,
00176   const int& a_range
00177   )const;
00178 
00179    
00180 
00181   int getNumCellsClipped();
00182 
00183   Real Min(const Real x, const Real y)const;
00184 
00185 
00186   //stuff disallowed for all the usual reasons.
00187   GeometryShop()
00188   {
00189     MayDay::Error("GeometryShop uses strong construction only");
00190   }
00191   GeometryShop(const GeometryShop& a_workshopin)
00192   {
00193     MayDay::Error("GeometryShop disallows copy contruction");
00194   }
00195   void operator=(const GeometryShop& a_workshopin)
00196   {
00197     MayDay::Error("GeometryShop disallows the assignment operator");
00198   }
00199 
00200 };
00201 #endif

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