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

EBData.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 _EBISData_H_
00030 #define _EBISData_H_
00031 
00032 #include "REAL.H"
00033 #include "EBGraph.H"
00034 #include "IrregNode.H"
00035 #include "BaseIVFAB.H"
00036 #include "BaseIFFAB.H"
00037 #include "RealVect.H"
00038 
00040 
00042 class VolData
00043 {
00044 public:
00045   Real     m_volFrac;
00046   Real     m_bndryArea;
00047   RealVect m_normal;
00048   RealVect m_volCentroid;
00049   RealVect m_bndryCentroid;
00050 };
00051 
00053 
00055 class FaceData
00056 {
00057 public:
00058   Real     m_areaFrac;
00059   RealVect m_faceCentroid;     
00060 };
00061 
00063 
00067 class EBDataImplem
00068 {
00069 
00070 public:
00071 
00073   EBDataImplem();
00074 
00076   ~EBDataImplem();
00077   
00079 
00082   void define(const Box& box, int comps);
00083 
00084 
00086 
00089   EBDataImplem(const Box& a_box, int a_comps);
00090 
00092 
00098   void copy(const Box&      a_regionFrom, 
00099             const Interval& a_Cd, 
00100             const Box&      a_regionto, 
00101             const EBDataImplem&   a_source, 
00102             const Interval& a_Cs);
00103 
00105   void 
00106   defineVoFData(const EBGraph& a_graph, const Box& a_region);
00107 
00109   void 
00110   defineFaceData(const EBGraph& a_graph, const Box& a_region);
00111 
00112 
00114   void
00115   define(const EBGraph&           a_graph,
00116          const Vector<IrregNode>& a_irregData,
00117          const Box&               a_validBox);
00118 
00120   void 
00121   coarsenVoFs(const EBDataImplem&   a_fineEBDataImplem,
00122               const EBGraph&        a_fineGraph,
00123               const EBGraph&        a_coarGraph,
00124                const Box&           a_validRegion);
00125 
00126 
00128   void 
00129   coarsenFaces(const EBDataImplem& a_fineEBDataImplem, 
00130                const EBGraph&      a_fineGraph,
00131                const EBGraph&      a_coarGraph,
00132                const Box&          a_validRegion);
00134   const Real& volFrac(const VolIndex& a_vof) const;
00135   
00137   const Real& areaFrac(const FaceIndex& a_face1) const;
00138   
00140   const RealVect& centroid(const FaceIndex& facein) const;
00141   
00143   const RealVect& centroid(const VolIndex& a_vof) const;
00144    
00146   const RealVect& bndryCentroid(const VolIndex& a_vof) const;
00147   
00149   const Real& bndryArea(const VolIndex& a_vof) const;
00150   
00152   const RealVect& normal(const VolIndex& a_vof) const;
00153 
00155 
00158   int size(const Box& R, const Interval& comps) const;
00159 
00161   void linearOut(void* buf, const Box& R, const Interval& comps) const;
00162 
00164   void linearIn(void* buf, const Box& R, const Interval& comps);
00165 
00167   static int preAllocatable()
00168   {
00169     return 2; // dyanmic allocatable.  
00170   }
00171 
00172   BaseIVFAB<VolData>& getVolData()
00173   {
00174     return m_volData;
00175   }
00176   const BaseIVFAB<VolData>& getVolData() const
00177   {
00178     return m_volData;
00179   }
00180 private:
00182   BaseIVFAB<VolData>   m_volData;
00183 
00185   BaseIFFAB<FaceData>  m_faceData[SpaceDim];
00186 
00188   bool m_isFaceDataDefined;
00189 
00191   bool m_isVoFDataDefined;
00192 
00193   void operator=(const EBDataImplem& ebiin)
00194   {;}
00195 
00196   EBDataImplem(const EBDataImplem& ebiin)
00197   {;}
00198 
00199   void
00200   coarsenFaceCentroid(RealVect&                a_centroidCoar, 
00201                       const Vector<RealVect>&  a_centroidsFine,
00202                       const Vector<Real>&      a_areaFracFine,
00203                       const Vector<FaceIndex>& a_facesFine, 
00204                       const FaceIndex&         a_faceCoar);
00205   void 
00206   coarsenAreaFrac(Real& a_areaFracCoar,
00207                   const Vector<Real>& a_areaFracFine);
00208 
00209   void
00210   coarsenVolFracAndCentroid(Real&                   a_volFracCoar,
00211                             RealVect&               a_volCentroidCoar,
00212                             const Vector<Real>&     a_volFracFine,
00213                             const Vector<RealVect>& a_volCentroidFine,
00214                             const Vector<VolIndex>& a_fineVoFs,
00215                             const VolIndex&         a_coarVoF);
00216 
00217 
00218   void
00219   coarsenBoundaryAreaAndNormal(Real&                    a_bndryAreaCoar,
00220                                RealVect&                a_normalCoar,
00221                                const Vector<Real>&      a_bndryAreaFine,
00222                                const Vector<RealVect>&  a_normalFine);
00223 
00224   RealVect 
00225   fineToCoarseTransform(const RealVect& a_finePoint,
00226                         const IntVect&  a_coarCell,
00227                         const IntVect&  a_fineCell);
00228 
00229   void
00230   coarsenBndryCentroid(RealVect&               a_bndryCentroidCoar,
00231                        const Vector<RealVect>& a_bndryCentroidFine,
00232                        const Vector<Real>&     a_bndryAreaFine,
00233                        const Vector<VolIndex>& a_fineVoFs,
00234                        const VolIndex&         a_coarVoF);
00235 
00236 };
00237 
00239 
00242 class EBData
00243 {
00244 public:
00245 
00247   EBData();
00248 
00250   ~EBData();
00251   
00253 
00256   void define(const Box& box, int comps);
00257 
00258 
00260 
00263   EBData(const Box& a_box, int a_comps);
00264 
00266 
00272   void copy(const Box&      a_regionFrom, 
00273             const Interval& a_Cd, 
00274             const Box&      a_regionto, 
00275             const EBData&   a_source, 
00276             const Interval& a_Cs);
00277 
00279   void 
00280   defineVoFData(const EBGraph& a_graph, const Box& a_region);
00281 
00283   void 
00284   defineFaceData(const EBGraph& a_graph, const Box& a_region);
00285 
00286 
00288   void
00289   define(const EBGraph&           a_graph,
00290          const Vector<IrregNode>& a_irregData,
00291          const Box&               a_validBox);
00292 
00294   void 
00295   coarsenVoFs(const EBData&   a_fineEBData,
00296               const EBGraph&  a_fineGraph,
00297               const EBGraph&  a_coarGraph,
00298               const Box&      a_validRegion);
00299 
00300 
00301   void 
00302   coarsenFaces(const EBData&  a_fineEBData, 
00303                const EBGraph& a_fineGraph,
00304                const EBGraph& a_coarGraph,
00305                const Box&     a_validRegion);
00307   Real volFrac(const VolIndex& a_vof) const;
00308 
00310   Real areaFrac(const FaceIndex& a_face1) const;
00311 
00313   RealVect centroid(const FaceIndex& facein) const;
00314 
00316   RealVect centroid(const VolIndex& a_vof) const;
00317 
00319   RealVect bndryCentroid(const VolIndex& a_vof) const;
00320   
00322   Real bndryArea(const VolIndex& a_vof) const;
00323 
00325   RealVect normal(const VolIndex& a_vof) const;
00326 
00328   EBData(const EBData& a_ebiin);
00329 
00331 
00334   bool operator==(const EBData& a_ebiin);
00335 
00337   EBData& operator=(const EBData& a_ebiin);
00338 
00340 
00343   int size(const Box& R, const Interval& comps) const;
00344 
00346   void linearOut(void* buf, const Box& R, const Interval& comps) const;
00347 
00349   void linearIn(void* buf, const Box& R, const Interval& comps);
00350 
00351   void 
00352   computeNormalsAndBoundaryAreas(const EBGraph& a_graph, 
00353                                  const Box&     a_validRegion);
00354 
00356   static int preAllocatable()
00357   {
00358     return 2; // dyanmic allocatable.  
00359   }
00360 private:
00361 
00363   RefCountedPtr<EBDataImplem> m_implem;
00364 
00365 };
00366 
00367 
00368 
00369 #endif

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