mkFem2 - Create the core of the solver for mixed elements
Calling sequence:
mkFem(eq_list, unknown_list, old_unknown_list, params_list, unkntestlist, testbsflist);
Parameters:
eq_list - A list of equations defining a PDE problem in variational form.
unknown_list - The list of unknowns as discussed above.
old_unknown_list - The list of unknowns at the previous timestep, as discussed above.
params_list - A list of scalar input parameters.
unkntestlist - A list of testfunction names that couple a certain testfunction with a certain unknown. The number of entries in unkntestlist must be the same as in unknown_list and old_unknown_list.
testbsflist - A list containing three entries, the first two being names of testfunctions, the last the name of a file that contins the definitions of the basefunctions. The two basefunction names are identified with the actual basefunctions via ordering and the name of this file, i.e., with testbsflist:=[v(x,y),q(x,y),`2DP2P1_gsq_bsf`], v(x,y) is P2 and q(x,y) is P1.
Synopsis:
ElementInt(expr)
Generates local residuals by integration over an element. The equations in eq_list must consist of terms enclosed in ElementInt or BoundaryInt calls.
ElementIntHiQ(expr)
This can be used to invoke an alternate integral evaluation, replacing ElementInt(), for selected terms, giving for instance a more accurate Gauss quadrature fomula. It relies on finding a definition of the procedure myElIntHiQ in the basefunction file.
BoundaryInt(expr)
The BoundaryInt call is used to evaluate the boundary integrals that appear in natural boundary conditions in variational formulations. BoundaryInt generates local residuals by integration over element sides. These are assembled for sides located on parts of the boundary that have 'Neumann' boundary conditions. If the string 'qBCval' is encountered it will be replaced by a number read with the mesh when the solver is run. The equations in eq_list must consist of terms enclosed in ElementInt or BoundaryInt calls.
NoExpand(expr)
This is meaningful only when used in the argument of an ElementInt or BoundaryInt function. It alters the way the symbolic calculations are done, but should not affect the numerical results. It can be used to prevent Maple from expanding nonlinear expressions of variables into huge, awkward expressions. For example: ElementInt(test(x,y)*(NoExpand(u(x,y)) )^3) could produce less code than ElementInt(test(x,y)*(u(x,y))^3).
Lump2(expr)
This is an implementation of the familiar FEM-trick of 'lumping the mass matrix'. Typically this is useful in explicit schemes when the unknown u(x,y) is to be solved from something like ElementInt(test(x,y)*u(x,y))=RHS. 'Lumping the mass matrix' means to replace the system matrix on the left hand side by a diagonal matrix ('lumping' the nodes onto the diagonal). So if instead we write ElementInt( Lump(test(x,y)*u(x,y)) ) = RHS, this equation can be solved faster by using the diagonal solver (diag in mkSolve). Lump() is meaningful only when used in the argument of an ElementInt or BoundaryInt function.
PointWise(expr)
This is an implementation of a trick sometimes used in FEM, for cheaper evaluation of nonlinear expressions. It will apply a nonlinear expression to the nodal values directly, instead of first expanding the unknown in base functions, i.e.: u(x,y)^3 is expanded in base functions as
sum_i( u_i^3 * test_i) instead of ( sum_i( ui * test_i))^3. PointWise() is meaningful only when used in the argument of an ElementInt or BoundaryInt function.
Examples:
> # create residual computations etc:
> size_parameters:=mkFem(eq_list,unknown_list,old_unknown_list,params_list,test(x,y), `2DP1_gsq_bsf`);
mkresi
amedsp
addr1
addm1
addr2
addm2
grbcrs
bdedsp
adbr1
adbm1
adbr2
adbm2
addini
check include/size.h:
nvar: 2
nobf: 3
bnobf: 2
changing jacobians list:
false false