Diffpack Documentation

(Functionality not available, requires installation of an additional Diffpack Toolbox)


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

RefinementInd Class Reference

base class for refinement indicators for adaptive grids. More...

#include <RefinementInd.h>

Inheritance diagram for RefinementInd::

HandleId ErrorEstimator GeometricInd List of all members.

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

FEMsimulator
Handle(FieldFEsolution
Handle(FieldFuncsome_func
Handle(FieldFEinterpolated_solution
Handle(RefinementInd_prmparameters

Detailed Description

base class for refinement indicators for adaptive grids.

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
This will lead to refinement of all elements whose centroids are inside a rectangle "[-0.2,1]x[0.85,1]" and two disks with radius 0.2 and 0.1, centered at (0,0) and (0.8,0.7), respectively.

"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);
if "refcrit1" is a "GridRefAdm" object and the solver ("this") is derived from "FEM". The refinement indicators that need access to the solver for error estimation are managed by class "ErrorEstimator", a subclass of "RefinementInd".

"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);
if "u" is of type "Handle(FieldFE)". Such a statement is conveniently placed in the "scan" (or "redim") function. It is not necessary that the attached field is the solution - it can be any field on the grid.

"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());
in the solver code prior to calling "refcrit1->refine". The name of the indicator in this case is "Functor".

"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);
where "pts" is a "VecSimple(Ptv(real))" array of points. Compared with disks in the "GeometricRegions" indicator, the "Points" indicator results a continuous range of indicator values. Moreover, the simulator can be in charge of prescribing the points.

"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);
where elist is an array of integers, containing the element numbers of the elements to be refined, and "refneighbors" is a boolean variable that is true if all the neighbors of the elements in "elist" are to be refined as well (all elements having nodes in common with the current element are considered as neighbors). The same type of refinement indicator can be obtained by the "OwnIndicator" procedure.

"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.


Constructor & Destructor Documentation

RefinementInd::RefinementInd ( const RefinementInd_prm & pm )
 

The construction and initialization is handled through class "GridRefAdm".

RefinementInd::~RefinementInd ( ) [inline]
 


Member Function Documentation

void RefinementInd::attach ( FieldFunc & f ) [inline]
 

See documentation of one of the overloaded functions.

void RefinementInd::attach ( FieldFE & u ) [inline]
 

See documentation of one of the overloaded functions.

void RefinementInd::attach ( FEM & users_class ) [inline]
 

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.

void RefinementInd::check ( FEM * sim,
const char * func ) [protected]
 

void RefinementInd::check ( Handle(FieldFunc) & f,
const char * func ) [protected]
 

void RefinementInd::check ( Handle(FieldFE) & u,
Handle(FieldFE) & u4current_grid,
FieldPiWisConst & rf,
const char * func ) [protected]
 

void RefinementInd::detach ( )
 

void RefinementInd::evalRefInd ( FieldPiWisConst & refinement_field,
bool init = true ) [pure virtual]
 

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.


Friends And Related Function Documentation

class GridRefAdm [friend]
 

Reimplemented in GeometricInd.


Member Data Documentation

Handle(FieldFE) RefinementInd::interpolated_solution [protected]
 

Handle(RefinementInd_prm) RefinementInd::parameters [protected]
 

FEM * RefinementInd::simulator [protected]
 

Handle(FieldFE) RefinementInd::solution [protected]
 

Handle(FieldFunc) RefinementInd::some_func [protected]
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.