gf_fem_get — General function for querying information about FEM objects.
int I = gf_fem_get(fem F,'nbdof') int I = gf_fem_get(fem F,'dim') int I = gf_fem_get(fem F,'target_dim') mat P = gf_fem_get(fem F,'pts') int I = gf_fem_get(fem F,'is_equivalent') int I = gf_fem_get(fem F,'is_lagrange') int I = gf_fem_get(fem F,'is_polynomial') int I = gf_fem_get(fem F,'estimated_degree') mat V = gf_fem_get(fem F,'base_value', vec X) mat V = gf_fem_get(fem F,'grad_base_value', vec X) mat V = gf_fem_get(fem F,'hess_base_value', vec X) string S = gf_fem_get(fem F,'poly_str') string S = gf_fem_get(fem F,'char')
The number of degrees of freedom of a specific fem F are returned by gf_fem_get(F,'nbdof'), while its dimension (i.e. the dimension of the reference convex) is given by gf_fem_get(F,'dim').
The target dimension, i.e. the dimension of the target space (denoted Q in the introduction to the finite element kernel) is returned by gf_fem_get(F,'target dim') (it is always 1 except for vector FEM).
The geometrical nodes (on the reference convex) associated with each degree of freedom of the fem is given in the columns of gf_fem_get(F,'pts').
gf_fem_get(F,'is equivalent'), gf_fem_get(F,'is lagrange'), or gf_fem_get(F,'is polynomial') gives some important properties of a FEM (a polynomial fem is a necessary condition for an exact integration method, and a interpolation a function of a Lagrangian fem is easy).
gf_fem_get(F,'estimated_degree') : return an estimation of the polynomial degree of a fem (this is an estimation for fem which are not polynomials).
gf_fem_get(F,'base_value',X) evaluate the values of all basis functions of the FEM at point X (X is supposed to be in the reference convex!). gf_fem_get(F,'grad_base_value',X) and gf_fem_get(F,'hess_base_value',X) evaluate respectively the first and second derivative of the basis functions.
gf_fem_get(F, 'char') return the canonical name of the FEM in getfem, and gf_fem_get(F, 'poly_str') return the polynomial expression of its basis functions in the reference convex (of course this will fail on non-polynomial FEMs).
n = gf_fem_get(fem,'nbdof'[, int cv]) Return the number of dof for the
Fem. Some specific Fem (for example 'interpolated_fem') may require a
convex number cv
to give their result. In most of
the case, you can omit this convex number.
d = gf_fem_get(fem,'dim') Return the dimension (dimension of the reference convex) of the Fem.
td = gf_fem_get(fem,'target_dim') Return the dimension of the target space. The target space dimension is usually 1, except for vector Fem (none of them has been implemented in getfem++ for now).
P = gf_fem_get(fem,'pts'[, int cv]) Get the location of the dof on the
reference element. Some specific Fem may require a convex number
cv
to give their result (for example
'interpolated_fem'). In most of the case, you can omit this convex
number.
b = gf_fem_get(fem,'is_equivalent') Return 0 if the Fem is not equivalent. Equivalent Fem are evaluated on the reference convex. This is the case of most classical Fem's.
b = gf_fem_get(fem,'is_lagrange') Return 0 if the Fem is not of Lagrange type.
b = gf_fem_get(fem,'is_polynomial') Return 0 if the basis functions are not polynomials.
d = gf_fem_get(fem,'estimated_degree') Return an estimation of the polynomial degree of the Fem. This is an estimation for fem which are not polynomials.
E = gf_fem_get(fem,'base_value',mat p) Evaluate all basis functions of
the FEM at point p
. p
is
supposed to be in the reference convex!
EH = gf_fem_get(fem,'hess_base_value',mat p) Evaluate the Hessian of
all base functions of the Fem at point p
.
p
is supposed to be in the reference
convex!.
gf_fem_get(fem,'poly_str') Return the polynomial expressions of its basis functions in the reference convex. The result is expressed as a list of strings. Of course this will fail on non-polynomial Fem's.
str = gf_fem_get(fem,'char') Ouput a (unique) string representation of the Fem. This can be used to perform comparisons between two different Fem objects.
Plotting the basis functions of the P5 fem on a segment:
f = gf_fem('FEM_PK(1,5)'); n = 100; M = zeros(gf_fem_get(f,'nbdof'),n); for i=1:n, M(:,i)=gf_fem_get(f,'base_value',(i-1)/(n-1)); end plot((0:n-1)/n,M);
Viewing the basis function of the Argyris FEM:
f=gf_fem('FEM_ARGYRIS'); gf_fem_get(f, 'poly_str')