00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _SINEIF_H_ 00012 #define _SINEIF_H_ 00013 00014 #include "MayDay.H" 00015 #include "RealVect.H" 00016 00017 #include "BaseIF.H" 00018 00019 #include "NamespaceHeader.H" 00020 00021 /// 00022 /** 00023 This implicit function specifies a 00024 sine function 00025 given constants 00026 x0, y0 00027 A (magnitude) 00028 F (frequency (first two comps)) 00029 2d: 00030 f(x,y) = y - y0 + A*sin(pi*F(x-x0)) 00031 3d: 00032 f(x,y,z) = z - z0 + A0*sin(pi*F0(x-x0))+ A1*sin(pi*F1(y-y0)) 00033 00034 */ 00035 class SineIF: public BaseIF 00036 { 00037 public: 00038 /// 00039 /** 00040 last comp of frequency ignored 00041 2d: 00042 point = (x0, y0) 00043 freq = (f0, f1) 00044 f(x,y) = y - y0 + A0*sin(pi*f0(x-x0)) 00045 3d: 00046 point = (x0, y0, z0) 00047 freq = (f0, f1, f2) 00048 f(x,y,z) = z - z0 + A0*sin(pi*(x-x0)) + A1*sin(pi*(y*y0)) 00049 00050 */ 00051 SineIF(const RealVect & a_A, 00052 const RealVect & a_point, 00053 const RealVect & a_F, 00054 const bool & a_inside); 00055 00056 /// Destructor 00057 virtual ~SineIF() 00058 { 00059 } 00060 00061 virtual Real value(const IndexTM<int,SpaceDim> & a_partialDerivative, 00062 const IndexTM<Real,SpaceDim>& a_point) const; 00063 00064 virtual Real value(const RealVect& a_point) const; 00065 00066 virtual Real value(const IndexTM<Real,SpaceDim>& a_point) const; 00067 00068 virtual BaseIF* newImplicitFunction() const; 00069 00070 protected: 00071 00072 RealVect m_A; 00073 RealVect m_point; 00074 RealVect m_F; 00075 bool m_inside; 00076 RealVect m_factor; 00077 RealVect m_piF; 00078 private: 00079 SineIF(); 00080 00081 }; 00082 00083 #include "NamespaceFooter.H" 00084 #endif