Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

Gradient.H

Go to the documentation of this file.
00001 
00002 // Gradient class: utility for computing grad(phi) for difference stencils
00003 // written by F. Miniati
00004 
00005 #ifndef _GRADIENT_H
00006 #define _GRADIENT_H
00007 
00008 #include "ProblemDomain.H"
00009 #include "FArrayBox.H"
00010 #include "FluxBox.H"
00011 #include "Box.H"
00012 
00013 enum StencilType {TwoPts, FourPts, TenPts};
00014 
00015 class Gradient
00016 {
00017 public:
00019   Gradient(){;};
00020 
00022   virtual ~Gradient(){;};
00023 
00024   // computes cell centered gradient
00025   virtual void gradient(FArrayBox&           a_grad,
00026                         const FArrayBox&     a_phi,
00027                         const ProblemDomain& a_domain,
00028                         const Real&          a_dx,
00029                         const Box&           a_box) = 0;
00030 
00031   // computes cell centered gradient
00032   virtual void gradient(FluxBox&             a_grad,
00033                         const FArrayBox&     a_phi,
00034                         const ProblemDomain& a_domain,
00035                         const Real&          a_dx,
00036                         const Box&           a_box) = 0;
00037 };
00038 
00040 class TwoPtsGradient : public Gradient
00041 {
00042 public:
00044   TwoPtsGradient() : Gradient() {;};
00045 
00047   virtual ~TwoPtsGradient(){;};
00048 
00050   virtual void gradient(FArrayBox&           a_grad,
00051                         const FArrayBox&     a_phi,
00052                         const ProblemDomain& a_domain,
00053                         const Real&          a_dx,
00054                         const Box&           a_box);
00055 
00057   virtual void gradient(FluxBox&             a_grad,
00058                         const FArrayBox&     a_phi,
00059                         const ProblemDomain& a_domain,
00060                         const Real&          a_dx,
00061                         const Box&           a_box);
00062 };
00063 
00065 class FourPtsGradient : public Gradient
00066 {
00067 public:
00069   FourPtsGradient() : Gradient() {;};
00070 
00072   virtual ~FourPtsGradient(){;};
00073 
00075   virtual void gradient(FArrayBox&           a_grad,
00076                         const FArrayBox&     a_phi,
00077                         const ProblemDomain& a_domain,
00078                         const Real&          a_dx,
00079                         const Box&           a_box);
00080 
00082   virtual void gradient(FluxBox&             a_grad,
00083                         const FArrayBox&     a_phi,
00084                         const ProblemDomain& a_domain,
00085                         const Real&          a_dx,
00086                         const Box&           a_box);
00087 };
00088 
00090 class TenPtsGradient : public Gradient
00091 {
00092 public:
00094   TenPtsGradient() : Gradient() {;};
00095 
00097   virtual ~TenPtsGradient(){;};
00098 
00100   virtual void gradient(FArrayBox&           a_grad,
00101                         const FArrayBox&     a_phi,
00102                         const ProblemDomain& a_domain,
00103                         const Real&          a_dx,
00104                         const Box&           a_box);
00105 
00107   virtual void gradient(FluxBox&             a_grad,
00108                         const FArrayBox&     a_phi,
00109                         const ProblemDomain& a_domain,
00110                         const Real&          a_dx,
00111                         const Box&           a_box);
00112 };
00113 
00114 #endif

Generated on Wed Oct 5 13:52:08 2005 for Chombo&AMRSelfGravity by  doxygen 1.4.1