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

Moments.H

Go to the documentation of this file.
00001 
00002 /* _______              __
00003   / ___/ /  ___  __ _  / /  ___
00004  / /__/ _ \/ _ \/  ' \/ _ \/ _ \
00005  \___/_//_/\___/_/_/_/_.__/\___/ 
00006 */
00007 //
00008 // This software is copyright (C) by the Lawrence Berkeley
00009 // National Laboratory.  Permission is granted to reproduce
00010 // this software for non-commercial purposes provided that
00011 // this notice is left intact.
00012 // 
00013 // It is acknowledged that the U.S. Government has rights to
00014 // this software under Contract DE-AC03-765F00098 between
00015 // the U.S.  Department of Energy and the University of
00016 // California.
00017 //
00018 // This software is provided as a professional and academic
00019 // contribution for joint exchange. Thus it is experimental,
00020 // is provided ``as is'', with no warranties of any kind
00021 // whatsoever, no support, no promise of updates, or printed
00022 // documentation. By using this software, you acknowledge
00023 // that the Lawrence Berkeley National Laboratory and
00024 // Regents of the University of California shall have no
00025 // liability with respect to the infringement of other
00026 // copyrights by any part of this software.
00027 #ifndef _Moments_H_
00028 #define _Moments_H_
00029 
00031 class edgeMo
00032 {
00033 private: 
00034   RealVect m_Lo;
00035   RealVect m_Hi;
00036   Real m_edgeLength;
00037   RealVect m_edgeCentroid;
00038   bool m_covered;
00039   int m_varOfInt;
00040 
00041 public:
00042   void define (const RealVect& a_loPt,
00043                const RealVect& a_hiPt, 
00044                const int& a_direction, 
00045                const bool& a_covered);
00046   
00047   edgeMo(){};
00048   
00049   //access member data
00050   RealVect getLo();
00051   RealVect getHi();
00052   Real getEdgeLength();
00053   RealVect getEdgeCentroid();
00054   bool isCovered();
00055   int direction();
00056   
00057   //integrate monomial
00058   Real moment(const IntVect& monomial);
00059   
00060 };
00062 class faceMo
00063  {
00064  private: 
00065    edgeMo m_edges[4]; //lexigraphic order:0Lo,0Hi,1Lo,1Hi,2Ho,2Hi
00066    Real m_normalVec[2];
00067    bool m_regular;
00068    bool m_covered;
00069    bool m_dontKnow;
00070    RealVect m_centroid;
00071    Real m_areaFrac;
00072    int m_faceNormal;
00073    Real m_bdLength;
00074    
00075    public:
00076    void setFaceArea(const Real& area);
00077    Real getFaceArea();
00078    void setFaceCentroid(const RealVect& centroid);
00079    RealVect getFaceCentroid();
00080    bool m_normalConstructed;
00081    bool isRegular()const;
00082    bool isCovered()const;
00083    bool dontKnow() const;
00084    void define(edgeMo a_edges[4],
00085                int& faceNormal, 
00086                bool& covered,
00087                bool& regular, 
00088                bool& dontKnow);
00089    faceMo(){};
00090    void getNormal(Real normal[2])const;
00091    Real getBdLength()const;
00092    void makeNormal();
00093    void getEdges(edgeMo Edges[4])const;
00094    bool normalConstructed()const;
00095    int getFaceNormal()const;
00096    void normalize(Real normalVec[2]);
00097  
00098  private:
00099     // disallowed for all the usual reasons
00100   void operator=(const faceMo& a_input)
00101   {
00102     MayDay::Error("invalid operator");
00103   };
00104 
00105   // disallowed for all the usual reasons
00106   faceMo(const faceMo& a_input)
00107   {
00108     MayDay::Error("invalid operator");
00109   };
00110 };
00111  
00113 class vofMo
00114 {
00115 private:
00116   faceMo m_faces[6];
00117   Real m_normalVec[3];
00118   Real m_bdArea;
00119 
00120 public:
00121   void define(faceMo a_faces[6]);
00122   vofMo(){};
00123   void makeNormal();
00124   void getNormal(Real normalVec[3])const;
00125   void getFaces(faceMo faces[6])const;
00126   
00127   void setNormal(Real normalVec[3]);
00128   void normalize(Real normalVec[3]);
00129   Real getBdArea();
00130  };
00131 
00133 class Moments
00134 {
00135 public: 
00136   
00137   Moments();
00138   
00139   Vector<Real> momentCalc3D(const int& a_order,
00140                              vofMo& a_vof);
00141   
00142   Vector<Real> momentCalc2D(const int& a_order,
00143                             const faceMo& a_face);
00144   
00145   void  listOfMoments(const int& a_order,
00146                       Vector<IntVect>& a_exponents);
00147   
00148   void makeMatrix(const Vector<IntVect>& a_list,
00149                   const Vector<IntVect>& a_listPlus,
00150                   const Vector<Real>& a_normalVec,
00151                   Real** a_A,
00152                   const int& a_faceNormal=999
00153                   );//use default faceNormal for 3D matrix or when SpaceDim==2
00154 };
00155 
00156 
00157 
00158 #endif

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