00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _REFERENCEHEIGHTIF_H_
00012 #define _REFERENCEHEIGHTIF_H_
00013
00014 #include "Notation.H"
00015 #include "RealVect.H"
00016 #include "IndexTM.H"
00017 #include "BaseIF.H"
00018 #include "NamespaceHeader.H"
00019
00021
00029 class ReferenceHeightIF : public BaseIF
00030 {
00031 public:
00032
00037 ReferenceHeightIF(const BaseIF & a_implicitFunction,
00038 const Real & a_referenceHeight):
00039 m_implicitFunction(a_implicitFunction.newImplicitFunction()),
00040 m_referenceHeight(a_referenceHeight){;}
00041
00043 virtual ~ReferenceHeightIF()
00044 {
00045 delete m_implicitFunction;
00046 }
00047
00049
00056 virtual Real value(const RealVect& a_point) const
00057 {
00058 IndexTM<Real,GLOBALDIM> pt;
00059
00060 for (int idir = 0; idir < SpaceDim; ++idir)
00061 {
00062 pt[idir] = a_point[idir];
00063 }
00064
00065 if (GLOBALDIM == 3 && SpaceDim == 2)
00066 {
00067 pt[SpaceDim] = m_referenceHeight;
00068 }
00069
00070 return value(pt);
00071 }
00072
00073
00075
00078 virtual Real value(const IndexTM<Real,GLOBALDIM>& a_point) const
00079 {
00080 return m_implicitFunction->value(a_point);
00081 };
00082
00084
00087 virtual IndexTM<Real,GLOBALDIM> grad(const IndexTM<Real,GLOBALDIM>& a_point) const
00088 {
00089 return m_implicitFunction->grad(a_point);
00090 };
00091
00093
00096 virtual IndexTM<Real,GLOBALDIM> normal(const IndexTM<Real,GLOBALDIM>& a_point) const
00097 {
00098 return m_implicitFunction->normal(a_point);
00099 };
00100
00102
00105 virtual Vector<IndexTM <Real,GLOBALDIM> > gradGrad(const IndexTM<Real,GLOBALDIM>& a_point) const
00106 {
00107 return m_implicitFunction->gradGrad(a_point);
00108 };
00109
00111
00114 virtual Vector<IndexTM <Real,GLOBALDIM> > gradNormal(const IndexTM<Real,GLOBALDIM>& a_point) const
00115 {
00116 return m_implicitFunction->gradNormal(a_point);
00117 };
00118
00120
00124 virtual ReferenceHeightIF* newImplicitFunction() const
00125 {
00126 return new ReferenceHeightIF(*m_implicitFunction, m_referenceHeight);
00127 }
00128
00130
00133 Real getReferenceHeight() const
00134 {
00135 return m_referenceHeight;
00136 }
00137
00138 private:
00139
00140
00141
00142
00143 ReferenceHeightIF()
00144 {
00145 }
00146
00147 BaseIF* m_implicitFunction;
00148 Real m_referenceHeight;
00149 };
00150
00151 #include "NamespaceFooter.H"
00152 #endif