Hermes2D  2.0
Hermes::Hermes2D::Shapeset Class Referenceabstract

Defines a set of shape functions. More...

#include <shapeset.h>

+ Inheritance diagram for Hermes::Hermes2D::Shapeset:

Public Types

typedef double(* shape_fn_t )(double, double)
 Shape-function function type. Internal.
 

Public Member Functions

int get_order (int index, ElementMode2D mode) const
 
virtual Shapesetclone ()=0
 
int get_num_components () const
 Returns 2 if this is a vector shapeset, 1 otherwise.
 
int get_max_order () const
 Returns the maximum poly degree for all shape functions.
 
virtual int get_max_index (ElementMode2D mode)=0
 Returns the highest shape function index.
 
int get_vertex_index (int vertex, ElementMode2D mode) const
 Returns the index of a vertex shape function associated with the specified vertex.
 
int get_edge_index (int edge, int ori, int order, ElementMode2D mode) const
 
virtual SpaceType get_space_type () const =0
 Returns space type.
 

Protected Member Functions

int * get_bubble_indices (int order, ElementMode2D mode) const
 Returns a complete set of indices of bubble functions for an element of the given order.
 
int get_num_bubbles (int order, ElementMode2D mode) const
 Returns the number of bubble functions for an element of the given order.
 
int get_constrained_edge_index (int edge, int order, int ori, int part, ElementMode2D mode) const
 
double get_value (int n, int index, double x, double y, int component, ElementMode2D mode)
 
double get_fn_value (int index, double x, double y, int component, ElementMode2D mode)
 
double get_dx_value (int index, double x, double y, int component, ElementMode2D mode)
 
double get_dy_value (int index, double x, double y, int component, ElementMode2D mode)
 
double get_dxx_value (int index, double x, double y, int component, ElementMode2D mode)
 
double get_dyy_value (int index, double x, double y, int component, ElementMode2D mode)
 
double get_dxy_value (int index, double x, double y, int component, ElementMode2D mode)
 
double2 * get_ref_vertex (int vertex, ElementMode2D mode)
 Returns the coordinates of the reference domain vertices.
 
virtual int get_id () const =0
 Returns shapeset identifier. Internal.
 
double * calculate_constrained_edge_combination (int order, int part, int ori, ElementMode2D mode)
 
double * get_constrained_edge_combination (int order, int part, int ori, int &nitems, ElementMode2D mode)
 
void free_constrained_edge_combinations ()
 Releases all cached coefficients.
 
double get_constrained_value (int n, int index, double x, double y, int component, ElementMode2D mode)
 

Protected Attributes

shape_fn_t *** shape_table [6]
 
int ** vertex_indices
 
int *** edge_indices
 
int *** bubble_indices
 
int ** bubble_count
 
int ** index_to_order
 
double2 ref_vert [H2D_MAX_SOLUTION_COMPONENTS][H2D_MAX_NUMBER_VERTICES]
 
int max_order
 
int num_components
 
int ebias
 first edge function. More...
 
double ** comb_table
 
int table_size
 

Friends

template<typename Scalar >
class DiscreteProblem
 
template<typename Scalar >
class Solution
 
class CurvMap
 
class RefMap
 
template<typename Scalar >
class RefinementSelectors::H1ProjBasedSelector
 
template<typename Scalar >
class RefinementSelectors::L2ProjBasedSelector
 
template<typename Scalar >
class RefinementSelectors::HcurlProjBasedSelector
 
template<typename Scalar >
class RefinementSelectors::OptimumSelector
 
class PrecalcShapeset
 
template<typename Scalar >
class Form
 
template<typename Scalar >
class MatrixForm
 
template<typename Scalar >
class VectorForm
 
template<typename Scalar >
class Space
 
template<typename Scalar >
class H1Space
 
template<typename Scalar >
class L2Space
 
template<typename Scalar >
class HcurlSpace
 
template<typename Scalar >
class HdivSpace
 
void check_leg_tri (Shapeset *shapeset)
 
void check_gradleg_tri (Shapeset *shapeset)
 

Detailed Description

Defines a set of shape functions.

This class stores mainly the definitions of the polynomials for all shape functions, but also their polynomial degrees, their types (vertex, edge, bubble), and contains mechanisms for the calculation and storage of constrained shape functions.

The class returns shape function values for both triangles and quads, depending on what mode is requested.

Each shape function is assigned a unique number - 'index'. For standard shape functions, index is positive and not greater than the value returned by get_max_index(). Negative index values are reserved for constrained shape functions. These are special edge functions designed to fit standard edge functions along a portion of an edge, used in the construction of FE spaces on meshes with hanging nodes.

The usage of Shapeset is simple: you first obtain the index of the shape function you are interested in, be it a vertex function for a given vertex, or an edge function of a given order, etc. Then you call one of the functions get_fn_value(), get_dx_value(), etc. All shape functions are defined on the reference domain. For triangles, this is the standard triangle (-1,-1), (1,-1), (-1,1), and for quads this is the square (-1,1)^2.

The polynomial degree (or 'order') is an integer typically in the range[1-10] for H1 shapesets and[0-10] for H(curl) shapesets. Quadrilaterals are allowed to have different orders in the x and y directions (of the reference domain). The 'order' for quads thus has to be formed with the macro H2D_MAKE_QUAD_ORDER(), see h2d_common.h.

Vertex shape functions in H1 shapesets are also regarded as edge functions of orders 0 and 1. This simplifies constraint calculations and BC projections.

Shape functions are always Real-valued.

Definition at line 86 of file shapeset.h.

Member Function Documentation

double * Hermes::Hermes2D::Shapeset::calculate_constrained_edge_combination ( int  order,
int  part,
int  ori,
ElementMode2D  mode 
)
protected
   numbering of edge intervals: (the variable 'part')

-+- -+- -+- | | 13 | | 5 | -+- | | 12 | 1 | -+- -+- finer interval: | | 11 | | 4 | -+- p = (p + 1) * 2 (+1) | | 10 | -+- -+- -+- ... etc. | | 9 | | 3 | -+- | | 8 | 0 | -+- -+- | | 7 | | 2 | -+- | | 6 | -+- -+- -+- Constrained edge functions are constructed by subtracting the linear part (ie., two vertex functions) from the constraining edge function and expressing the rest as a linear combination of standard edge functions. This function determines the coefficients of such linear combination by forming and solving a simple linear system.

Definition at line 26 of file shapeset.cpp.

double * Hermes::Hermes2D::Shapeset::get_constrained_edge_combination ( int  order,
int  part,
int  ori,
int &  nitems,
ElementMode2D  mode 
)
protected

Returns the coefficients for the linear combination forming a constrained edge function. This function performs the storage (caching) of these coefficients, so that they can be calculated only once.

Definition at line 101 of file shapeset.cpp.

int Hermes::Hermes2D::Shapeset::get_constrained_edge_index ( int  edge,
int  order,
int  ori,
int  part,
ElementMode2D  mode 
) const
protected

Returns the index of a constrained edge function. 'part' is 0 or 1 for edge halves, 2, 3, 4, 5 for edge quarters, etc. See shapeset.cpp.

Definition at line 211 of file shapeset.cpp.

double Hermes::Hermes2D::Shapeset::get_constrained_value ( int  n,
int  index,
double  x,
double  y,
int  component,
ElementMode2D  mode 
)
protected

Constructs the linear combination of edge functions, forming a constrained edge function.

Definition at line 148 of file shapeset.cpp.

int Hermes::Hermes2D::Shapeset::get_edge_index ( int  edge,
int  ori,
int  order,
ElementMode2D  mode 
) const

Returns the index of an edge function associated with the specified edge and of the requested order. 'ori' can be 0 or 1 and determines edge orientation (this is for shapesets with non-symmetric edge functions).

Definition at line 183 of file shapeset.cpp.

Referenced by Hermes::Hermes2D::RefMap::set_active_element(), and Hermes::Hermes2D::RefMap::untransform().

int Hermes::Hermes2D::Shapeset::get_order ( int  index,
ElementMode2D  mode 
) const

Returns the polynomial degree of the specified shape function. If on quads, it returns encoded orders. The orders has to be decoded through macros H2D_GET_H_ORDER and H2D_GET_V_ORDER.

Definition at line 223 of file shapeset.cpp.

Referenced by Hermes::Hermes2D::PrecalcShapeset::set_active_shape().

double Hermes::Hermes2D::Shapeset::get_value ( int  n,
int  index,
double  x,
double  y,
int  component,
ElementMode2D  mode 
)
protected

Obtains the value of the given shape function. (x,y) is a coordinate in the reference domain, component is 0 for Scalar shapesets and 0 or 1 for vector shapesets.

Definition at line 231 of file shapeset.cpp.

Member Data Documentation

int Hermes::Hermes2D::Shapeset::ebias
protected

first edge function.

2 for H1 shapesets, 0 for H(curl) shapesets. It is the order of the

Definition at line 161 of file shapeset.h.


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