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 _DIVNORMALREFINEMENT_H_ 00012 #define _DIVNORMALREFINEMENT_H_ 00013 00014 #include "RefinementCriterion.H" 00015 00016 #include "NamespaceHeader.H" 00017 00018 /// 00019 /** 00020 This refinement criterion refines if the change in the normal exceeds a threshold. 00021 */ 00022 template <int dim> class DivNormalRefinement: public RefinementCriterion<dim> 00023 { 00024 public: 00025 /// Null constructor 00026 DivNormalRefinement(); 00027 00028 /// Constructor which sets a threshold 00029 DivNormalRefinement(const Real & a_maxChangeThreshold, 00030 const int & a_maxNumberOfRefinements); 00031 00032 /// Destructor 00033 virtual ~DivNormalRefinement(); 00034 00035 /** 00036 Refine if the change in the normal exceeds a threshold. 00037 */ 00038 virtual bool doRefine(IndexTM<int,dim> & a_refineInDir, 00039 const CutCellMoments<dim> & a_ccm, 00040 const int & a_numberOfRefinements); 00041 00042 /** 00043 Estimate the change in the normal. 00044 */ 00045 virtual Real approximateDivNormal(const CutCellMoments<dim> & a_ccm); 00046 00047 // Set threshold 00048 virtual void setMaxChangeThreshold(const Real & a_maxChangeThreshold); 00049 00050 /// Get threshold 00051 virtual Real getMaxChangeThreshold(); 00052 00053 // Set max number of refinements 00054 virtual void setMaxNumberOfRefinements(const int & a_maxNumberOfRefinements); 00055 00056 /// Get threshold 00057 virtual int getMaxNumberOfRefinements(); 00058 00059 protected: 00060 Real m_maxChangeThreshold; 00061 int m_maxNumberOfRefinements; 00062 }; 00063 00064 #include "NamespaceFooter.H" 00065 00066 #include "DivNormalRefinementImplem.H" 00067 00068 #endif 00069