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 00028 #ifndef _STENCILS_H_ 00029 #define _STENCILS_H_ 00030 00031 #include "Vector.H" 00032 #include "VolIndex.H" 00033 #include "FaceIndex.H" 00034 #include "REAL.H" 00035 00037 00043 class VoFStencil 00044 { 00045 public: 00047 00050 VoFStencil(); 00051 00053 ~VoFStencil(); 00054 00056 void clear(); 00057 00059 00065 void 00066 add(const VolIndex& vof,const Real& weight); 00067 00069 00072 int 00073 size() const; 00074 00076 00079 const VolIndex& 00080 vof(int i) const; 00081 00083 00086 const Real& 00087 weight(int i) const; 00088 00090 00098 VoFStencil& 00099 operator+=(const VoFStencil& a_vofsten); 00100 00101 00103 00105 void operator*=(const Real& scaling); 00106 00108 VoFStencil& 00109 operator=(const VoFStencil& a_vofsten); 00110 00112 VoFStencil(const VoFStencil& a_vofstenin); 00113 00115 bool isDefined() const; 00116 00117 protected: 00118 00119 bool m_isDefined; 00121 Vector<VolIndex> vofs; 00123 Vector<Real> weights; 00124 }; 00125 00126 00128 00131 class FaceStencil 00132 { 00133 public: 00135 FaceStencil(); 00136 00138 ~FaceStencil(); 00139 00141 void clear(); 00142 00144 00149 void 00150 add(const FaceIndex& face,const Real& weight); 00151 00153 00156 int 00157 size() const; 00158 00160 00162 const FaceIndex& 00163 face(int i) const; 00164 00166 00169 const Real& 00170 weight(int i) const; 00171 00173 00181 FaceStencil& 00182 operator+=(const FaceStencil& a_facesten); 00183 00185 FaceStencil& 00186 operator=(const FaceStencil& a_facesten); 00187 00189 FaceStencil(const FaceStencil& a_facesten); 00190 00192 00194 void operator*=(const Real& scaling); 00195 00196 private: 00198 Vector<FaceIndex> faces; 00200 Vector<Real> weights; 00201 }; 00202 00203 #endif