00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _PETSCCOMPGRIDVTO_H_
00012 #define _PETSCCOMPGRIDVTO_H_
00013 #include "PetscCompGrid.H"
00014 #include "NamespaceHeader.H"
00015
00016
00017
00018
00019 class PetscCompGridVTO : public PetscCompGrid
00020 {
00021 public:
00022
00023
00024 virtual ~PetscCompGridVTO()
00025 {
00026 #ifdef CH_USE_PETSC
00027 clean();
00028 #endif
00029 }
00030
00031 #ifdef CH_USE_PETSC
00032
00033 PetscCompGridVTO(Real a_al=0., Real a_beta=1.0) :
00034 PetscCompGrid(CH_SPACEDIM), m_alpha(a_al), m_beta(a_beta)
00035 {
00036 }
00037 virtual void clean();
00038
00039 void defineCoefs( Real a_alpha, Real a_beta,
00040 Vector<RefCountedPtr<LevelData<FluxBox> > > &a_mu,
00041 Vector<RefCountedPtr<LevelData<FluxBox> > > &a_lambda,
00042 Vector<RefCountedPtr<LevelData<FArrayBox> > > &a_a)
00043 {
00044 m_alpha = a_alpha;
00045 m_beta = a_beta;
00046 m_a = a_a;
00047 m_eta = a_mu;
00048 m_lamb = a_lambda;
00049 }
00050
00051 virtual IntVect getGhostVect()const
00052 {
00053 return IntVect::Unit;
00054 }
00055 Real getAlpha()const{return m_alpha;}
00056 Real getBeta()const{return m_beta;}
00057 void setAlpha(Real a_b) {m_alpha = a_b;}
00058 void setBeta(Real a_b) {m_beta = a_b;}
00059 protected:
00060 virtual void createOpStencil(IntVect,int,const DataIndex&,StencilTensor&);
00061 virtual void applyBCs(IntVect,int,const DataIndex&,Box,StencilTensor &);
00062 Real m_alpha;
00063 Real m_beta;
00064
00065 Vector<RefCountedPtr<LevelData<FluxBox> > > m_eta;
00066 Vector<RefCountedPtr<LevelData<FluxBox> > > m_lamb;
00067 Vector<RefCountedPtr<LevelData<FArrayBox> > > m_a;
00068 #endif // ifdef petsc
00069 };
00070
00071 class CompGridVTOBC : public CompBC
00072 {
00073 public:
00074 CompGridVTOBC(int a_nSource=1, IntVect a_nGhosts=IntVect::Unit) : CompBC(a_nSource,a_nGhosts)
00075 {
00076 for (int comp=0; comp<SpaceDim; comp++)
00077 {
00078 m_bcDiri[0][0][comp] = true;
00079 m_bcDiri[0][1][comp] = true;
00080 m_bcDiri[1][0][comp] = true;
00081 m_bcDiri[1][1][comp] = true;
00082 }
00083 }
00084
00085 virtual ~CompGridVTOBC()
00086 {
00087 }
00088
00089
00090 void setDiri(int dir, int side, int comp, bool a_diri = true) {m_bcDiri[dir][side][comp] = a_diri;}
00091 bool isDiri(int dir, int side, int comp) { return m_bcDiri[dir][side][comp]; }
00092 virtual void createCoefs();
00093 virtual void operator()( FArrayBox& a_state,
00094 const Box& a_valid,
00095 const ProblemDomain& a_domain,
00096 Real a_dx,
00097 bool a_homogeneous);
00098
00099 virtual void operator()( FArrayBox& a_state,
00100 const Box& a_valid,
00101 const ProblemDomain& a_domain,
00102 Real a_dx,
00103 const DataIndex& a_index,
00104 bool a_homogeneous)
00105 {
00106 operator()(a_state, a_valid, a_domain, a_dx, a_homogeneous);
00107 }
00108
00109
00110 bool m_bcDiri[CH_SPACEDIM][2][CH_SPACEDIM];
00111 };
00112
00113 #include "NamespaceFooter.H"
00114 #endif