#include <RefinementInd.h>
Inheritance diagram for RefinementInd::

Public Methods | |
| RefinementInd (const RefinementInd_prm &pm) | |
| ~RefinementInd () | |
| void | attach (FEM &users_class) |
| void | attach (FieldFE &u) |
| void | attach (FieldFunc &f) |
| void | detach () |
| virtual void | evalRefInd (FieldPiWisConst &refinement_field, bool init=true)=0 |
Protected Methods | |
| void | check (Handle(FieldFE) &u, Handle(FieldFE) &u4current_grid, FieldPiWisConst &rf, const char *func) |
| void | check (Handle(FieldFunc) &f, const char *func) |
| void | check (FEM *sim, const char *func) |
Protected Attributes | |
| FEM* | simulator |
| Handle(FieldFE) | solution |
| Handle(FieldFunc) | some_func |
| Handle(FieldFE) | interpolated_solution |
| Handle(RefinementInd_prm) | parameters |
NAME: RefinementInd - base class for refinement indicators for adaptive grids
DESCRIPTION:
The class is a base class for a hierarchy of methods dealing with data and functionality for grid refinement indicators. The subclasses can evaluate the value of a refinement indicator in each element, while "GridRefAdm" puts these values into a criterion for determining if a particular element is to be refined or not.
Some examples on available refinement indicators are given below.
"GeometricRegions": Refine all elements inside a prescribed geometric region, for example, a set of disks or hypercubes. On the menu you can set
set refinement criterion = GeometricRegions set hypercube regions = Hypercubes d=2 n=1 [-0.2,1.0]x[0.85,1.0]
set disk regions = Disks d=2 n=2 (0,0)->0.2 (0.8,0.7)->0.1
"OwnIndicator": This indicator calls a virtual function "evalOwnIndicator" in the simulator class and leaves it up to the user to provide a suitable indicator, for example, based on error estimation or other procedures that depend on the particular PDE being solved. This requires access to the simulator:
refcrit1->getRefinementInd().attach (*this);
"Gradient": Given a field "u" over the grid, this indicator is based on the gradient of "u" (i.e. elements are ranked for refinement after their value of the norm of the gradient at the centroid of the element). Of course, the libraries need to access "u", which is performed by
refcrit1->getRefinementInd().attach (*u);
"Value": Here we attach a field (see "Gradient" example) and use the value of the field as an indicator. For example, attaching a coefficient of the PDE and adjusting the high and low limits used for the refinement criterion (see the "GridRefAdm" menu) properly, one can refine elements with values inside a jump (discontinuity) of the coefficient.
"Contour": First, we determine the set of all the nodes in the elements that intersect the contour surface "u=u_c" of an attached field (see "Gradient" indicator for how to attach fields). Then we refine the elements that are closest to the centroids of the elements containing the contour. The result is local mesh refinements in the vicinity of a contour. The attached field can also be a functor (derived from "FieldFunc"), and the point of time for evaluating the functor can be adjusted by
refcrit1->getRefinementIndPrm().setFuncTime (tip->time());
"Points": Here the indicator value is the inverse distance from an element to the nearest point in a set of prescribed points. The indicator leads to refinement in the vicinity of points. The points must be given by the simulator class through a statement of the type
refcrit1->getRefinementIndPrm().addPoints (pts);
"ElementList": Here we do not use indicator values, but prescribe the list of elements to be refined directly. This is accomplished by a statement of the form
refcrit1->getRefinementIndPrm().attach (elist, refneighbors);
"ElementListWithNeighbors": as "ElementList", but all the neighbors of the prescribed elements under "ElementList" are also marked for refinement. This allows for ""neighbors of neighbors"".
"ZZ": This is the indicator based on the ZZ error estimator. The simulator must be attached to the refinement indicator as demonstrated for the "OwnIndicator" criterion.
|
|
The construction and initialization is handled through class "GridRefAdm". |
|
|
|
|
|
See documentation of one of the overloaded functions. |
|
|
See documentation of one of the overloaded functions. |
|
|
these functions give access to fields in the simulator class. The "simulator" handle is always filled correctly at initialization time by the managing "GridRefAdm" object, and points to the simulator class. The other two handles must be manually attached if an indicator that needs these handles is applied. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
main function that evaluates the indicator for a refinement strategy. There is one value per element. The subclasses implement specific versions of this function. Reimplemented in ErrorEstimator, and GeometricInd. |
|
|
Reimplemented in GeometricInd. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|