3 %
class representing a continous piecewise polynomial function of arbitrary
4 % dimension.
'DOFS' correspond to the values of Lagrange-nodes.
7 % \endlink yields the global index of the first dof of the basis
function
8 % corresponding to the given Lagrange node and element elid.
9 %
'gid:(gid+dimrange-1)' are the subsequent dofs of the vectorial
function in
10 % the lagrange node. first all dofs in nodes are counted, then all dofs in
11 % element interior, then the dofs on edge-interiors.
13 % The Lagrange nodes
'l_1,...,l_m' with
'm=0.5*(pdeg+1)*(pdeg+2)'
14 % are sorted in the following order:
26 % v_1 = l_1 v_2 = l_(pdeg+1)
29 % where
'v_1, v_2, v_3' denote the sorting of the triangles corners.
31 % Bernard Haasdonk 11.1.2011
34 pdeg; % polynomial degree
36 dimrange; % dimension of range space
38 grid; % grid of type .gridbase
40 df_info; % discrete
function information of type .feminfo
44 % dependent variables:
52 % number of DOFs per grid element
55 % the global dof index
63 % constructor, dofs possibly [], grid required!
66 % dofs: a vector of #
'df.ndofs' global degress of freedom
for the
67 % discrete
function,
if '==[]' a zero vector is created.
68 % df_info:
object of type .feminfo describing the structure of the
69 % underlying discrete
function space
71 % required fields of df_info:
72 % pdeg: polynomial degree of lagrange functions
73 % dimrange: dimension of the range
75 df.pdeg = df_info.pdeg;
76 df.dimrange = df_info.dimrange;
77 df.grid = df_info.grid;
81 df.nelements = df_info.grid.nelements;
82 df.ndofs = df_info.ndofs;
83 df.ndofs_per_element = df_info.ndofs_per_element;
85 df.dofs = zeros(df.ndofs,1);
87 df.global_dof_index = df_info.global_dof_index;
90 function sdf = scalar_component(df,ncomp)
91 % extraction of component of vectorial fem function
92 [scalardofs, scalar_df_info] = ...
93 fem_scalar_component(df.dofs, ncomp, df);
97 function p = plot(df,params)
102 p = plot_discfunc(df,params);
105 function p = plot_dofmap(df,params)
110 p = fem_plot_dofmap(df,params);
113 function res = evaluate(df,einds,lcoord,dummy1,dummy2)
116 % description of evaluate function
117 res = fem_evaluate(df,einds,lcoord,[],[]);
120 function res = subsref(df, S)
121 % This method enables indexation of discrete functions
123 % redirects arguments to evalute function, so
125 % df(einds, lcoord) == evaluate(df, einds, lcoord)
131 res = builtin('subsref', df, S);
133 res = evaluate(df,S.subs{:});
138 function cdf = copy(df)
143 function df3 = plus(df1,df2)
145 df3.dofs = df1.dofs + df2.dofs;
149 function df3 = minus(df1,df2)
150 df3 = femdiscfunc([],df1.df_info);
151 df3.dofs = df1.dofs - df2.dofs;
155 function df2 =uminus(df1)
156 df2 = femdiscfunc([],df1.df_info);
157 df2.dofs = -df1.dofs;
161 function df2 =mtimes(factor,df1)
162 df2 = femdiscfunc([],df1.df_info);
163 df2.dofs = factor * df1.dofs;
class representing a continous piecewise polynomial function of arbitrary dimension. DOFS correspond to the values of Lagrange-nodes.
nelements
dependent variables: number of elements
nelements
number of overall elements (leaf + nonleaf)
global_dof_index
the global dof index