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 _FIXEDREFINEMENT_H_ 00012 #define _FIXEDREFINEMENT_H_ 00013 00014 #include "RefinementCriterion.H" 00015 00016 #include "NamespaceHeader.H" 00017 00018 /// 00019 /** 00020 This refinement criterion refines a fixed number of levels. 00021 */ 00022 template <int dim> class FixedRefinement: public RefinementCriterion<dim> 00023 { 00024 public: 00025 /// Null constructor 00026 FixedRefinement(); 00027 00028 /// Constructor which sets number of refinements 00029 FixedRefinement(const int & a_maxNumberOfRefinements); 00030 00031 /// Destructor 00032 virtual ~FixedRefinement(); 00033 00034 /// Refine a fixed number of times 00035 /** 00036 Refine if the number of refinements already finished is smaller than the max number of refinements. 00037 */ 00038 virtual bool doRefine(IndexTM<int,dim> & a_refineInDir, 00039 const CutCellMoments<dim> & a_ccm, 00040 const int & a_numberOfRefinements); 00041 00042 /// Set the number of refinements 00043 virtual void setMaxNumberOfRefinements(const int & a_maxNumberOfRefinements); 00044 00045 /// Get the number of refinements 00046 virtual int getMaxNumberOfRefinements(); 00047 00048 protected: 00049 int m_maxNumberOfRefinements; 00050 }; 00051 00052 #include "NamespaceFooter.H" 00053 00054 #include "FixedRefinementImplem.H" 00055 00056 #endif