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

PolyGeom.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
00028 
00029 #ifndef _PolyGeom_H_
00030 #define _PolyGeom_H_
00031 
00032 #include "REAL.H"
00033 #include "RealVect.H"
00034 #include "Tuple.H"
00035 #include "Vector.H"
00036 
00037 
00038 class EBISBox;
00040 
00047 class PolyGeom
00048 {
00049 public:
00050 
00052 
00054   static void setTolerance(const Real& a_tolerance);
00055 
00057 
00059   static void setVectDx(const RealVect& a_vectDx);
00060 
00062 
00064   static void setVolumeTolerance(const Real& a_tolerance);
00065 
00067 
00069   static void setAreaTolerance(const Real& a_tolerance);
00070 
00072 
00074   static void setLengthTolerance(const Real& a_tolerance);
00075 
00077 
00081   static RealVect cross(const RealVect& a_xvec1,
00082                         const RealVect& a_xvec0);
00083 
00085 
00089   static Real dot(const RealVect& a_xvec1,
00090                   const RealVect& a_xvec0);
00091     
00093 
00095   static const Real& getTolerance();
00096 
00098 
00100   static const RealVect& getVectDx();
00101 
00103 
00105   static const Real& getVolumeTolerance();
00106 
00108 
00110   static const Real& getAreaTolerance();
00111 
00112 
00114 
00116   static const Real& getLengthTolerance();
00117 
00118 
00120 
00125   static RealVect normal(const VolIndex& a_vof, 
00126                          const EBISBox& a_ebisBox,
00127                          const Real& a_bndryArea);
00128 
00130 
00132   static Real bndryArea(const VolIndex& a_vof,
00133                         const EBISBox& a_ebisBox);
00134 
00136 
00142   static Real computeAlpha(const Real& a_volFrac,
00143                            const RealVect& a_normal);
00144 
00145 
00147 
00151   static Real computeVolume(const Real& a_alpha,
00152                             const RealVect& a_normal);
00153 
00155 
00163   static void computeNormalAndAlpha(Real& a_alpha,
00164                                     RealVect& a_normal,
00165                                     const int& a_upDir,
00166                                     const Tuple<RealVect, CH_SPACEDIM>& a_poly);
00167 
00168   // solve ax = b (gives icomp component of x using cramers rule).
00169   static Real 
00170   matrixSolveComp(const Vector<Vector<Real> >& a_A,
00171                   const  Vector<Real>& a_rhs,
00172                   const int& a_icomp);
00173 
00174 
00175   //return the determinant of a
00176   static Real 
00177   determinant(const Vector< Vector<Real> >& a_A);
00178 
00188   static Real sAndZVolume(const Real& a_alpha,
00189                           const RealVect& a_normal);
00190                           
00191                           
00192 
00194   PolyGeom()
00195   {;}
00197   ~PolyGeom()
00198   {;}
00199 
00201 
00205   static void sortVector(RealVect& vect, IntVect& ivmap);
00206 
00208   static void posifyVector(RealVect& vect, IntVect& signs);
00209 
00211   static void unifyVector(RealVect& normal, Real& sumSquare);
00212 
00214   static Tuple<int, CH_SPACEDIM-1> computeTanDirs(int upDir);
00215 
00216 protected:
00217 
00218   static Real   twoDFunc(const Real& arg);
00219   static Real threeDFunc(const Real& arg);
00220 
00221   static Real computeAnyVolume(const Real& a_alpha,
00222                                const Real& a_norm0,
00223                                const Real& a_norm1,
00224                                const Real& a_norm2);
00225 
00226   static RealVect s_vectDx;
00227 
00228   static Real s_tolerance;
00229 
00230   static Real s_lengthtolerance;
00231 
00232   static Real s_areatolerance;
00233 
00234   static RealVect tetCentroid(const RealVect& normal,
00235                               const Real& alpha);
00236                               
00237   static Real tetVolume(const RealVect& normal,
00238                         const Real& alpha);
00239                               
00240 
00241 private:
00242 };
00243 
00244 #endif
00245 

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