GridRefinement Class Reference
[Grid classes]

List of all members.

Static Public Member Functions

template<int dim, class Vector>
static void refine (Triangulation< dim > &tria, const Vector &criteria, const double threshold)
template<int dim, class Vector>
static void coarsen (Triangulation< dim > &tria, const Vector &criteria, const double threshold)
template<int dim, class Vector>
static void refine_and_coarsen_fixed_number (Triangulation< dim > &tria, const Vector &criteria, const double top_fraction_of_cells, const double bottom_fraction_of_cells, const unsigned int max_n_cells=std::numeric_limits< unsigned int >::max())
template<int dim, class Vector>
static void refine_and_coarsen_fixed_fraction (Triangulation< dim > &tria, const Vector &criteria, const double top_fraction, const double bottom_fraction, const unsigned int max_n_cells=std::numeric_limits< unsigned int >::max())
template<int dim, class Vector>
static void refine_and_coarsen_optimize (Triangulation< dim > &tria, const Vector &criteria)

Static Private Member Functions

template<class Vector>
static void qsort_index (const Vector &a, std::vector< unsigned int > &ind, int l, int r)

Classes

class  ExcInvalidParameterValue


Detailed Description

This class provides several function that flag certain cells for coarsening or refinement based on a vector of ``error'' indicators and some selection algorithm. The central function is refine (const Vector &criterion, const double threshold): it takes a vector of values, one per active cell, which denote the criterion according to which the triangulation is to be refined. It marks all cells for which the criterion is greater than the threshold being given as the second argument. Analogously, coarsen (const Vector &criterion, const double threshold) flags those cells for coarsening for which the criterion is less than the threshold.

There are two variations of these functions, which rely on refine and coarsen by computing the thresholds from other information:

There are other functions relying on different methods to flag cells for refinement or coarsening. See their documentation for further information.

For a more thorough discussion of advantages and disadvantages of the different strategies for refinement, see the paper of R. Becker and R. Rannacher titled "A Feed-Back Approach to Error Control in Finite Element Methods: Basic Analysis and Examples".

It is assumed that the criterion is a value in a certain norm over each element, such that the square of the total error is the sum over the squares of the criteria on the cells. The criteria shall be positive.

You can suppress coarsening or refining by giving zero as the fraction for one of the operations.

Author:
Wolfgang Bangerth, 1998, 2000; Thomas Richter, 2000

Member Function Documentation

template<int dim, class Vector>
static void GridRefinement::refine ( Triangulation< dim > &  tria,
const Vector criteria,
const double  threshold 
) [inline, static]

Refine the triangulation according to the given criteria. The criterion is a double value for each cell which determines which cells are to be refined by comparison with the threshold: if the value for a cell is larger than the threshold, the cell is flagged for refinement. It is your duty to guarantee that the threshold value is in a resonable range. Please note that the criteria array may contain negative values (sometimes, error estimators are evaluated in a way which produces positive and negative values), but the comparison with threshold is done only on the absolute values of the criteria.

The cells are only flagged for refinement, they are not actually refined. To do so, you have to call the execute_coarsening_and_refinement function.

There are more sophisticated strategies for mesh refinement; refer to the following functions and to the general doc for this class for more information.

template<int dim, class Vector>
static void GridRefinement::coarsen ( Triangulation< dim > &  tria,
const Vector criteria,
const double  threshold 
) [inline, static]

Analogue to the refine function: flag all cells for coarsening for which the absolute value of the criterion is less than the given threshold.

template<int dim, class Vector>
static void GridRefinement::refine_and_coarsen_fixed_number ( Triangulation< dim > &  tria,
const Vector criteria,
const double  top_fraction_of_cells,
const double  bottom_fraction_of_cells,
const unsigned int  max_n_cells = std::numeric_limits< unsigned int >::max() 
) [inline, static]

Refine the triangulation by refining a certain fraction top_fraction_of_cells with the highest error. Likewise coarsen the fraction bottom_fraction_of_cells with the least error. To actually perform the refinement, call execute_coarsening_and_refinement.

fraction_of_cells shall be a value between zero and one.

The last argument can be used to specify a maximal number of cells. If this number is going to be exceeded upon refinement, then refinement and coarsening fractions are going to be adjusted in an attempt to reach the maximum number of cells. In practice, it is complicated to reach this number exactly, so the argument is only an indication. The default value of this argument is to impose no limit on the number of cells.

Refer to the general doc of this class for more information.

template<int dim, class Vector>
static void GridRefinement::refine_and_coarsen_fixed_fraction ( Triangulation< dim > &  tria,
const Vector criteria,
const double  top_fraction,
const double  bottom_fraction,
const unsigned int  max_n_cells = std::numeric_limits< unsigned int >::max() 
) [inline, static]

Refine the triangulation by flagging those cells which make up a certain top_fraction of the total error. Likewise, coarsen all cells which make up only bottom_fraction. To actually perform the refinement, call execute_coarsening_and_refinement.

*_fraction shall be a values between zero and one.

The last argument can be used to specify a maximal number of cells. If this number is going to be exceeded upon refinement, then refinement and coarsening fractions are going to be adjusted in an attempt to reach the maximum number of cells. In practice, it is complicated to reach this number exactly, so the argument is only an indication. The default value of this argument is to impose no limit on the number of cells.

Refer to the general doc of this class for more information.

template<int dim, class Vector>
static void GridRefinement::refine_and_coarsen_optimize ( Triangulation< dim > &  tria,
const Vector criteria 
) [inline, static]

Refine the triangulation by flagging certain cells to reach an optimal grid: We try to minimize the error multiplied with the number of cells in the new grid. All cells with large error indicator are refined to generate an optimal grid in the above sense. We assume that the error in one cell is reduced to a quarter after refinement. The new triangulation has three new cells for every flagged cell.

Refer to the general doc of this class for more information.

template<class Vector>
static void GridRefinement::qsort_index ( const Vector a,
std::vector< unsigned int > &  ind,
int  l,
int  r 
) [inline, static, private]

Sorts the vector ind as an index vector of a in increasing order. This implementation of quicksort seems to be faster than the STL version and is needed in refine_and_coarsen_optimize


The documentation for this class was generated from the following file:

deal.II documentation generated on Fri Nov 21 07:13:11 2008 by doxygen 1.5.6