Adaptive (EquationSystems &es, const std::string &name, const unsigned int number)
~Adaptive ()
virtual void solve ()
unsigned int refinement_step () const
unsigned int n_refinement_steps () const
unsigned int & n_refinement_steps ()
unsigned int max_refinement_level () const
unsigned int & max_refinement_level ()
Protected Member Functions
unsigned int & refinement_step ()
Private Attributes
unsigned int _refinement_step
unsigned int _n_refinement_steps
unsigned int _max_refinement_level
Detailed Description
template<class T = Linear<>> class Adaptive< T >
This is a generic class that defines a adaptive to be used in a simulation. A user can define a adaptive by deriving from this class and implementing certain functions.
Author:
Benjamin S. Kirk, 2003-2004.
Definition at line 47 of file adaptive.h.
Constructor & Destructor Documentation
template<class T > Adaptive< T >::Adaptive (EquationSystems &es)Constructor. Requires a reference to a system to be solved.
Definition at line 133 of file adaptive.h.
:
T (es), // Call the base class constructor
_refinement_step (0), // Solver parameters
_n_refinement_steps (1),
_max_refinement_level(100)
{
}
template<class T > Adaptive< T >::Adaptive (EquationSystems &es, const std::string &name, const unsigned intnumber)Constructor. Requires a referece to the EquationSystems object.
Definition at line 144 of file adaptive.h.
:
Adaptive (es),
T (es, name, number)
{
}
template<class T > Adaptive< T >::~Adaptive ()Destructor.
Definition at line 155 of file adaptive.h.
{
}
Member Function Documentation
template<class T = Linear<>> unsigned int Adaptive< T >::max_refinement_level () const [inline]Returns:
the maximum level for mesh refinement.
Definition at line 92 of file adaptive.h.
References Adaptive< T >::_max_refinement_level.
{ return _max_refinement_level; }
template<class T = Linear<>> unsigned int& Adaptive< T >::max_refinement_level () [inline]Sets the maximum level for mesh refinement.
Definition at line 97 of file adaptive.h.
References Adaptive< T >::_max_refinement_level.
{ return _max_refinement_level; }
template<class T = Linear<>> unsigned int Adaptive< T >::n_refinement_steps () const [inline]Returns:
the number of refinement steps to take.
Definition at line 82 of file adaptive.h.
References Adaptive< T >::_n_refinement_steps.
{ return _n_refinement_steps; }
template<class T = Linear<>> unsigned int& Adaptive< T >::n_refinement_steps () [inline]Sets the number of refinement steps to take.
Definition at line 87 of file adaptive.h.
References Adaptive< T >::_n_refinement_steps.
{ return _n_refinement_steps; }
template<class T = Linear<>> unsigned int Adaptive< T >::refinement_step () const [inline]Returns:
the current refinement step.
Definition at line 77 of file adaptive.h.
References Adaptive< T >::_refinement_step.
{ return _refinement_step; }
template<class T = Linear<>> unsigned int& Adaptive< T >::refinement_step () [inline, protected]Sets the current refinement step.
Definition at line 106 of file adaptive.h.
References Adaptive< T >::_refinement_step.
{ return _refinement_step; }
template<class T > void Adaptive< T >::solve () [virtual]Re-implement the solve member to do a fixed number of linear solves
Definition at line 162 of file adaptive.h.
References JumpErrorEstimator::estimate_error(), MeshRefinement::flag_elements_by_error_fraction(), and MeshRefinement::refine_and_coarsen_elements().
{
// First solve the base system
T::solve ();
for (this->refinement_step()=0;
this->refinement_step() < this->n_refinement_steps();
this->refinement_step()++)
{
// Then estimate the error in the base system
// and refine the mesh
{
ErrorVector error;
KellyErrorEstimator error_estimator;
error_estimator.estimate_error (this->system(), 'incomp_ns', error);
MeshRefinement mesh_refinement (this->mesh());
mesh_refinement.flag_elements_by_error_fraction (error,
0.40,
0.40,
this->max_refinement_level());
mesh_refinement.refine_and_coarsen_elements ();
this->system().reinit ();
}
// Then re-solve the base system
T::solve ();
}
}
Member Data Documentation
template<class T = Linear<>> unsigned int Adaptive< T >::_max_refinement_level [private]The maximum allowable levels of refinement.
Definition at line 125 of file adaptive.h.
Referenced by Adaptive< T >::max_refinement_level().
template<class T = Linear<>> unsigned int Adaptive< T >::_n_refinement_steps [private]The number of refinement steps to take.
Definition at line 120 of file adaptive.h.
Referenced by Adaptive< T >::n_refinement_steps().
template<class T = Linear<>> unsigned int Adaptive< T >::_refinement_step [private]The current refinement step.
Definition at line 115 of file adaptive.h.
Referenced by Adaptive< T >::refinement_step().
Author
Generated automatically by Doxygen for libMesh from the source code.